Re: Jpanel background image issues
- From: Knute Johnson <nospam@xxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sun, 25 Nov 2007 21:47:42 -0800
Gorilla3D wrote:
I am having trouble showing the background image onto a panel All the
JPanel code should be right but when I run the app, it just shows the
JFrame with no panel. There is no IOException when ran so it reads the
file with no problem.
NewJFrame.java
http://paste2.org/p/9818
ImagePanel.java
http://paste2.org/p/9819
Does anyone have and ideas?
Using: Java 1.6u3
You've got a couple of problems, first you add the ImagePanel after calling pack() on the container. I don't know how that layout manager works so there could be problems there. ImagePanel has no preferred size. That will probably make it difficult to layout.
See http://www.knutejohnson.com and look at the code for the ImageIOExample.
--
Knute Johnson
email s/nospam/knute/
.
- References:
- Jpanel background image issues
- From: Gorilla3D
- Jpanel background image issues
- Prev by Date: Jpanel background image issues
- Next by Date: Re: Screen Resolution
- Previous by thread: Jpanel background image issues
- Index(es):