Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / November 2007

Tip: Looking for answers? Try searching our database.

Jpanel background image issues

Thread view: 
Gorilla3D - 26 Nov 2007 05:11 GMT
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
Knute Johnson - 26 Nov 2007 05:47 GMT
> 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
[quoted text clipped - 9 lines]
> 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.

Signature

Knute Johnson
email s/nospam/knute/



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.