Results 1 to 7 of 7
Thread: no display
- 07-15-2010, 10:00 AM #1
no display
i not that good with applets and this is my second one. i am trying to add components to different Jpanels. then i put those Jpanels in the JPanel panel. but when i run the applet it shows nothing.
note: panel is the main JPanel
Java Code:public void init(){ //button groups ButtonGroup skill = new ButtonGroup(); skill.add(noob); skill.add(good); skill.add(r_good); skill.add(beast); ButtonGroup y_n = new ButtonGroup(); y_n.add(yes); y_n.add(no); //panels id_panel.add(ID); id_panel.add(your_ID); rank_panel.add(rank); rank_panel.add(your_rank); BoxLayout box = new BoxLayout(WAR_panel, BoxLayout.Y_AXIS); WAR_panel.setLayout(box); WAR_panel.add(rifle); WAR_panel.add(sniper); WAR_panel.add(knife); WAR_panel.add(flame); WAR_panel.add(RPG); WAR_panel.add(grenade); BoxLayout box2 = new BoxLayout(skill_panel, BoxLayout.Y_AXIS); skill_panel.setLayout(box2); skill_panel.add(noob); skill_panel.add(good); skill_panel.add(r_good); skill_panel.add(beast); BoxLayout box3 = new BoxLayout(yn_panel, BoxLayout.Y_AXIS); yn_panel.setLayout(box3); yn_panel.add(yes); yn_panel.add(no); //displaying the components panel.add(id_panel); panel.add(rank_panel); panel.add(what_r_u); panel.add(add_info); panel.add(yn_panel); } }
- 07-15-2010, 11:55 AM #2
- 07-15-2010, 06:21 PM #3
what i meant was a made a Jpanel and named it panel. that is the panel where all of the components are going. then i made other Jpanels like WAR_panel,skill_panel and added them to the Jpanel panel too.
- 07-15-2010, 06:39 PM #4
Then what did you do with this panel named panel so that you could see it? JPanels are containers not windows.
- 07-16-2010, 03:11 AM #5
Senior Member
- Join Date
- Jul 2009
- Posts
- 1,145
- Rep Power
- 5
Have you read the section from the Swing tutorial on How to Make Applets for a working example?
- 07-16-2010, 04:21 AM #6
never mind i found out my problem. i didn't add the panel
Java Code:panel.add(skill_panel); panel.add(yn_panel); panel.add(blank); panel.add(send); [COLOR="Red"]add(panel);[/COLOR]
- 07-22-2010, 10:01 AM #7
Similar Threads
-
What is the different between Text format display on web browser and display on midle
By Basit781 in forum CLDC and MIDPReplies: 1Last Post: 05-31-2010, 08:46 AM -
Cannot display in JPanel
By atch in forum New To JavaReplies: 2Last Post: 02-05-2010, 02:21 PM -
Display tag help
By kirtichopra2003 in forum Advanced JavaReplies: 0Last Post: 11-12-2009, 09:10 AM -
How to display a list of items and on click display subitems?
By mandyj in forum New To JavaReplies: 8Last Post: 12-29-2008, 07:12 AM -
How to display information about the display device in SWT
By Java Tip in forum SWTReplies: 0Last Post: 06-28-2008, 09:26 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks