A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
Win a copy of
The Mikado Method
this week in the
Agile and other Processes
forum!
JavaRanch
»
Java Forums
»
Java
»
Swing / AWT / SWT
Author
Add a background image for Java GUI...Please help
Chaturaka Gunatilaka
Greenhorn
Joined: Oct 06, 2012
Posts: 16
posted
Dec 29, 2012 00:23:43
0
import java.awt.*; import javax.swing.*; class Demo1{ public static void main(String args[]){ JFrame f1=new JFrame("NetBeans IDE Installer"); f1.setSize(600,450); f1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f1.setLocationRelativeTo(null); JButton nextButton=new JButton("Next >"); JButton cancelButton=new JButton("Cancel"); JButton customizeButton=new JButton("Customize"); JPanel buttonPane1=new JPanel(new FlowLayout(FlowLayout.RIGHT)); JPanel buttonPane2=new JPanel(new FlowLayout(FlowLayout.CENTER)); buttonPane1.add(nextButton); buttonPane1.add(cancelButton); buttonPane2.add(customizeButton); f1.add("South",buttonPane1); f1.add("Center",buttonPane2); f1.setVisible(true); } }
I want to add this image to my GUI code.How can I do that?Thank you.
This is the image related to the question.
Michael Dunn
Ranch Hand
Joined: Jun 09, 2003
Posts: 4632
posted
Dec 29, 2012 00:57:10
0
read the Swing FAQ on this forum's main page
Jan Cumps
Bartender
Joined: Dec 20, 2006
Posts: 2343
I like...
posted
Dec 29, 2012 06:46:29
0
This is the link
into that faq.
OCUP UML fundamental
ITIL foundation
Kemal Sokolovic
Bartender
Joined: Jun 19, 2010
Posts: 792
2
I like...
posted
Dec 29, 2012 06:47:34
0
As Michael pointed, you can refer to
Swing Faq
. There is a page that will give you a solution to your problem.
The quieter you are, the more you are able to hear.
I agree. Here's the link:
http://aspose.com/file-tools
subject: Add a background image for Java GUI...Please help
Similar Threads
getText() is not working?
Very Very New
to add image in prog
Laying out a JPanel
Wizards and CardLayout
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter