This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Swing / AWT / SWT and the fly likes swing blob image Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "swing blob image" Watch "swing blob image" New topic
Author

swing blob image

muntago Richard
Ranch Hand

Joined: Nov 13, 2010
Posts: 82
good day experts, this code was aimed at displaying image from database but the codes runs and display an empty page.
please help me fix the problem

thanks
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19672
    
  18

Are you sure the image is loaded from the database properly? What's the value of bytes?

And why are you using JDesktopPane? Why not simply extend JPanel?


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Tom Reilly
Rancher

Joined: Jun 01, 2010
Posts: 618
You should QuoteYourSources: http://www.roseindia.net/tutorial/java/swing/retrieveImage.html.
muntago Richard
Ranch Hand

Joined: Nov 13, 2010
Posts: 82
i have ammended the code as you said but its still displaying an empty page. just as you said ,is like the image is not loaded properly. So what do i do.
below is the code as being ammended thanks

Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19672
    
  18

You should start by not catching Exception and then ignoring it. This may very well be causing the problem. The least you should do with any exception you don't want to handle is print its stack trace.
muntago Richard
Ranch Hand

Joined: Nov 13, 2010
Posts: 82
I have used
but it still display empty page
 
 
subject: swing blob image