Is this your first time here? SwingWiki is a Java Swing Developer community site with an big archive of Swing-related usenet groups and mailing lists, but also tips, tricks and articles and book reviews written by your colleagues from around the world. If you came here through a search engine and did not find what you were looking for, make sure to check the wiki table of contents.

Frame background image packing

If you have a background image in a frame (depending on the method you use to display it), image dimensions may not be taken into account while packing the frame. Override getPreferredSize() to return the image dimension. This should give correct packing dimensions.

Since Java 1.5, this can be done without overriding, just by calling frame.setPreferredSize(dimension), where dimension is a Dimension, and frame is any component (but in this case probably a JFrame).

See also Pack Frames,Background Image.

 

Comments? Corrections? Contact us or Login to edit pages directly (registration is free and takes less than displaying a JLabel)
  workaround/frame_background_image_packing.txt · Last modified: 2006/05/08 20:31 by 86.133.152.165 (ricky_clarkson)
 
Recent changes | RSS changes | Table of contents | News Archive | Terms And Conditions | Register | The Quest For Software++| Ruby Resources

Sedo - Buy and Sell Domain Names and Websites project info: swingwiki.org Statistics for project swingwiki.org etracker� web controlling instead of log file analysis