aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Can anyone help me to spot a mistake in the method. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Can anyone help me to spot a mistake in the method." Watch "Can anyone help me to spot a mistake in the method." New topic
Author

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

Bobby Marvikuan
Ranch Hand

Joined: Mar 14, 2012
Posts: 54
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

Joined: Oct 24, 2010
Posts: 563
You should print the exception's stack trace to help pinpoint the problem:



Always learning Java, currently using Eclipse on Fedora.
Linux user#: 501795
Koen Aerts
Ranch Hand

Joined: Feb 07, 2012
Posts: 344

exception.toString() or exception.printStackTrace() is probably more informative.
Greg Brannon
Bartender

Joined: Oct 24, 2010
Posts: 563
Koen Aerts wrote:exception.toString() or exception.printStackTrace() is probably more informative.

Yep, that's what I meant. Sorry.
Bobby Marvikuan
Ranch Hand

Joined: Mar 14, 2012
Posts: 54
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

Joined: Apr 06, 2010
Posts: 4464
    
    8

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

Joined: Mar 14, 2012
Posts: 54
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!
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Can anyone help me to spot a mistake in the method.