Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

swing blob image

 
muntago Richard
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 20527
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Tom Reilly
Rancher
Posts: 618
 
muntago Richard
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 20527
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have used
but it still display empty page
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic