Results 1 to 9 of 9
Thread: Questions On Java GUI Library
- 02-12-2009, 11:19 AM #1
Member
- Join Date
- Oct 2008
- Posts
- 58
- Rep Power
- 0
Questions On Java GUI Library
I got a few questions on Java GUI.
Firstly, how do you change the background picture of a JPanel to a gif. I have only been taught simple GUI like JRadioButton,JButton etc.
2) How do I import com.sun.java.swing ? I can seem to find the jar file. All I discovered was 421 class files and I dunno what to do?
3) For those using netbeans, how do you see the code from Desktop Application?
- 02-12-2009, 12:53 PM #2
Member
- Join Date
- Apr 2008
- Posts
- 15
- Rep Power
- 0
to use the swing API
you just put
tutorial here on JButtons with imagesPHP Code:import javax.swing.*;
h**p://java.sun.com/docs/books/tutorial/uiswing/components/button.html
- 02-12-2009, 05:44 PM #3
Here is a post about adding an image to a JPanel. Ignore the first few comments.
- 02-13-2009, 08:37 AM #4
Member
- Join Date
- Oct 2008
- Posts
- 58
- Rep Power
- 0
Ummm. how do I change the entire JPanel into a gif picture that I want? Not as background but as foreground?
-
If you want to display an image with nothing on top of it, no buttons, textfields, etc, then don't use a JPanel. Place the image into an ImageIcon and then the ImageIcon into a JLabel and then add the JLabel to whereever you want to display your image.
If you search the Sun tutorials on JLabel and ImageIcon, you'll see much more detail on this and sample code. Good luck.
Also: if this is not what you want to do, then please post back with more details on your problem. Again, good luck.
- 02-13-2009, 08:43 PM #6
Fubarable is correct. I was about to say the same thing when I saw his post. I misunderstood your question...
- 02-14-2009, 12:23 PM #7
Member
- Join Date
- Oct 2008
- Posts
- 58
- Rep Power
- 0
ok solved. How do you make the [solved] thing?
- 02-26-2009, 06:04 AM #8
Member
- Join Date
- Jun 2008
- Posts
- 56
- Rep Power
- 0
- 02-26-2009, 10:50 AM #9
Senior Member
- Join Date
- Dec 2008
- Location
- Hong Kong
- Posts
- 473
- Rep Power
- 5
[solved] thing?
in thread tool
Similar Threads
-
Pls i need help with these 2 Java Questions
By jyde in forum New To JavaReplies: 23Last Post: 11-11-2008, 05:23 AM -
Pls i need help with these 2 Java Questions
By jyde in forum Advanced JavaReplies: 2Last Post: 10-19-2008, 07:33 PM -
Java Questions...
By Xarver in forum New To JavaReplies: 11Last Post: 09-20-2008, 05:37 AM -
Few Questions about java
By Grom in forum NetBeansReplies: 11Last Post: 09-13-2008, 02:26 PM -
few java questions
By hiaslpix in forum New To JavaReplies: 4Last Post: 01-01-2008, 05:47 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks