| 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: 530
|
|
You should print the exception's stack trace to help pinpoint the problem:
|
Learning Java using Eclipse on OpenSUSE 11.2
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: 530
|
|
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: 3793
|
|
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!
|
 |
 |
|
|
subject: Can anyone help me to spot a mistake in the method.
|
|
|