How to add background image[JPG] to JFrame?

Swing Designer allows you to quickly create the frames, panels, dialogs, applets and other UI elements that comprise Java Swing applications.

Moderators: Konstantin.Scheglov, gnebling, Alexander.Mitin, jwren, Eric Clayberg

How to add background image[JPG] to JFrame?

Postby noobJavaBB » Mon Oct 12, 2009 2:13 am

Can please advice on how to add a JPG image and set as background to a new JFrame? i manage to add image but the picture seems to overlapped on my components.
Posts: 2
Joined: Sun Oct 11, 2009 10:34 pm

Re: How to add background image[JPG] to JFrame?

Postby Eric Clayberg » Tue Oct 13, 2009 7:12 am

You should subclass JPanel to create your own ImagePanel. You can find examples of how to do this on the Web.

Note that general Swing questions like this should be addressed to the appropriate Java forums/newsgroups.
Eric Clayberg
Software Engineering Manager

Author: "Eclipse Plug-ins"
Eric Clayberg
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA

Return to Swing Designer

Who is online

Users browsing this forum: No registered users and 1 guest