Results 1 to 12 of 12
Thread: Java Panels
- 03-12-2011, 11:50 AM #1
Member
- Join Date
- Mar 2011
- Posts
- 45
- Rep Power
- 0
-
Can you elaborate a bit? Your question could benefit from more details.
- 03-12-2011, 12:07 PM #3
- Join Date
- Jan 2011
- Location
- Richmond, Virginia
- Posts
- 3,069
- Blog Entries
- 3
- Rep Power
- 7
While more clarification is needed i will attempt to read your mind. You can add multiple sub panels to one panel. For instance, you can put a panel on the top with buttons, a panel at the bottom with check boxes and an image in the center of the original panel.
- 03-12-2011, 12:18 PM #4
Member
- Join Date
- Mar 2011
- Posts
- 45
- Rep Power
- 0
That's what I mean...
- 03-12-2011, 12:20 PM #5
- Join Date
- Jan 2011
- Location
- Richmond, Virginia
- Posts
- 3,069
- Blog Entries
- 3
- Rep Power
- 7
Alright, this is possible however; I will leave the research up to you. The sun tutorials should have some examples of something like this.
- 03-12-2011, 12:21 PM #6
Member
- Join Date
- Mar 2011
- Posts
- 45
- Rep Power
- 0
- 03-12-2011, 12:23 PM #7
- Join Date
- Jan 2011
- Location
- Richmond, Virginia
- Posts
- 3,069
- Blog Entries
- 3
- Rep Power
- 7
Try creating some panels , put a button on two of them then add them to the third. Then add the panel to a frame and make it visible
- 03-12-2011, 12:46 PM #8
Member
- Join Date
- Mar 2011
- Posts
- 45
- Rep Power
- 0
this way?
it doesn't work...Java Code:JFrame f = new JFrame(); f.setTitle("Window"); f.setSize(200,300); JPanel p = new JPanel(); p.setLayout(new GridLayout(2,1,5,5)); JPanel c = new JPanel(); p.setLayout(new GridLayout(1,2,5,5)); c.add(Button1); c.add(Button2); p.add(c); p.add(Button3);
-
You should simply nest JPanels, each one using the best layout manager for its situation. If you need help, then you may wish to create a Short, Self Contained, Correct (Compilable), Example or SSCCE. This is a small program that compiles, runs, demonstrates your problem, and contains no extraneous code. Please read the link, and have a go at it.
- 03-12-2011, 01:10 PM #10
Member
- Join Date
- Mar 2011
- Posts
- 45
- Rep Power
- 0
Is my code correct? It doesn't work...
-
- 03-12-2011, 02:28 PM #12
Member
- Join Date
- Mar 2011
- Posts
- 45
- Rep Power
- 0
Similar Threads
-
Java Panels and Layouts help
By Zookey in forum New To JavaReplies: 2Last Post: 01-30-2011, 12:06 PM -
Deleting panels
By dilpreet28 in forum New To JavaReplies: 13Last Post: 08-11-2010, 09:23 AM -
issue of mutiple panels
By de.megha in forum AWT / SwingReplies: 1Last Post: 07-26-2010, 09:27 AM -
resizeable panels
By simo_mon in forum AWT / SwingReplies: 4Last Post: 07-29-2009, 01:45 AM -
I obviously don't understand positioning panels
By javatard in forum New To JavaReplies: 2Last Post: 12-10-2008, 07:48 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks