File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can anyone help me to spot a mistake in the method.

 
Bobby Marvikuan
Ranch Hand
Posts: 54
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anyone help me to spot a mistake in the method. In previous post method now works but the problem with that is it labels a JLabel in JPanel but I want now to place an image in JPanel itself. what I am doing wrong???. Cheers in advance
 
Greg Brannon
Bartender
Posts: 563
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should print the exception's stack trace to help pinpoint the problem:

 
Koen Aerts
Ranch Hand
Posts: 344
Java Linux Oracle
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
exception.toString() or exception.printStackTrace() is probably more informative.
 
Greg Brannon
Bartender
Posts: 563
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Koen Aerts wrote:exception.toString() or exception.printStackTrace() is probably more informative.

Yep, that's what I meant. Sorry.
 
Bobby Marvikuan
Ranch Hand
Posts: 54
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Greg Brannon wrote:
Koen Aerts wrote:exception.toString() or exception.printStackTrace() is probably more informative.

Yep, that's what I meant. Sorry.

thanks for the advice but the problem is not in the exception because if there was an exception it would probably print at least "Problem occour when to open the file" but here it works with try block but does not do what I want it to do I mean it does not do anything at all
 
Matthew Brown
Bartender
Posts: 4549
8
Java Netbeans IDE Scala
  • 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your code appears to be doing the following at the moment:
- you load an image into a BufferedImage
- you get the graphics context of the BufferedImage
- you draw the BufferedImage onto itself
- you don't do anything else with the image

I suspect that's not what you were wanting.
 
Bobby Marvikuan
Ranch Hand
Posts: 54
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Matthew Brown wrote:Your code appears to be doing the following at the moment:
- you load an image into a BufferedImage
- you get the graphics context of the BufferedImage
- you draw the BufferedImage onto itself
- you don't do anything else with the image

I suspect that's not what you were wanting.

thanks a lot this makes sense!
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic