Results 1 to 6 of 6
Thread: JFrame image background
- 03-09-2010, 05:32 PM #1
Member
- Join Date
- Mar 2010
- Posts
- 3
- Rep Power
- 0
- 03-09-2010, 05:34 PM #2
Look at the Sun Java Tutorial for Swing, go to the part about layered pane.
- 03-09-2010, 05:49 PM #3
Member
- Join Date
- Mar 2010
- Posts
- 3
- Rep Power
- 0
Is there any way to do it cliking on something in NetBeans?
- 03-09-2010, 06:05 PM #4
I assume you are using Matisse, which is included in NetBeans. I don't mean to be negative, but Swing is made for creating heavy-duty applications. That means you have to know how the internals work and to write somewhat low-level code. It is not a lot of code, but you have to do it right, or you will end up with, at best, an applications that is slow and filled with problems. Do it right, and Swing rocks. Please read the Swing tutorial, from the start.
- 03-09-2010, 06:12 PM #5
Member
- Join Date
- Mar 2010
- Posts
- 3
- Rep Power
- 0
Yeah, I start redaing it and trying understanding how it work xD and I look into NetBeans generated code and this is wierd plus one of the method that work in eclipse dosen't work into netBeans.
Point origin = new Point(10, 20);
label = createColoredLabel(" ",java.awt.Color.BLACK, origin);
jLayeredPane1.add(label);
createColoredLabel() dosen't work because of a
"Exception in thread "AWT-EventQueue-0" java.lang.RuntimeException: Uncompilable source code"
EDIT: are you sure I can use that for a picture because in the tutorial they are only talking about color.Last edited by 851marc; 03-09-2010 at 06:18 PM.
- 03-09-2010, 06:27 PM #6
Senior Member
- Join Date
- Jul 2009
- Posts
- 1,236
- Rep Power
- 13
I have a label witch contain the image but I don't find the way to set it as the backgroup of my JFrame so now I can't add any component in front of my Label. How can I do that ?
Similar Threads
-
How to add a background image to JFrame
By dunafrothint in forum AWT / SwingReplies: 1Last Post: 02-26-2010, 10:17 PM -
Need help with JFrame background image
By ProGenius in forum New To JavaReplies: 6Last Post: 12-27-2009, 04:17 PM -
JFrame window doesnt change background color
By Addez in forum New To JavaReplies: 7Last Post: 11-07-2009, 09:38 PM -
Background in JFrame ( GUI).
By Twister03 in forum AWT / SwingReplies: 2Last Post: 03-12-2009, 03:24 AM -
GUI... setting my background to an image, im using a JFrame
By newtojava7 in forum New To JavaReplies: 2Last Post: 03-24-2008, 05:29 AM
Bookmarks