Results 1 to 4 of 4
Thread: Adding a Background image?
- 10-20-2012, 09:52 PM #1
Member
- Join Date
- Sep 2012
- Posts
- 11
- Rep Power
- 0
Adding a Background image?
Hey, I'm trying to add in a background image and I'm unsure on how to do
My code starts out like this if more info is needed let me know. Thanks!
Java Code:import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.Random; import javax.swing.*; public class App extends JApplet { String Val; String[] brand = { "Arc Keyboard","Arc Mouse"}; JLabel label = new JLabel("Select a brand"); JButton button = new JButton("Generate"); JComboBox brands = new JComboBox(brand); JPanel panel = new JPanel(); JTextField box = new JTextField(" " + Val); public void init() { JFrame window = new JFrame(); setSize(200, 100); BuildPanel(); add(panel); }
- 10-21-2012, 06:50 AM #2
Re: Adding a Background image?
Moved from New to Java.
Go through this Tutorial Lesson: Performing Custom Painting (The Java™ Tutorials > Creating a GUI With JFC/Swing)
Why does your class extend JApplet and create a JFrame? Are you creating an Applet or a desktop application? Do you know the difference?
dbWhy do they call it rush hour when nothing moves? - Robin Williams
- 10-21-2012, 04:20 PM #3
Member
- Join Date
- Sep 2012
- Posts
- 11
- Rep Power
- 0
-
Re: Adding a Background image?
Similar Threads
-
use image for background
By tony_stark in forum AWT / SwingReplies: 1Last Post: 05-31-2011, 08:20 PM -
Adding image in background
By nayanjyoti in forum New To JavaReplies: 1Last Post: 04-26-2011, 11:47 AM -
Adding JButton to JFrame with background
By bzknight in forum AWT / SwingReplies: 1Last Post: 01-19-2011, 06:55 PM -
adding background image to jtabbedpane
By Gloomy in forum AWT / SwingReplies: 1Last Post: 08-09-2010, 02:17 PM -
Image as background
By Java.child in forum AWT / SwingReplies: 2Last Post: 10-02-2008, 11:37 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks