Tab
(1000+ posts)
Send PM |
Profile |
Ignore
|
Tue Jan-31-06 04:36 PM
Original message |
| Java swing question (programming) |
|
I'm trying to go up the Java learning curve (finally), and am screwing around with layouts. I want to use a grid layout, and populate each "cell" with its own stuff. I understand that I need to insert panels into the grid, but from there I fail to connect the dots.
Let's say I have
mainContent =getContentPane(); mainContent.setLayout(new GridLayout(3,1));
Okay, so I have a 3-row grid.
Now what? I want to stick some stuff into the first row. How would I do that?
cxPanel =new(JPanel());
cxNameLabel =new JLabel("Name"); cxAddressLabel =new JLabel("Address");
cxPanel.add(cxNameLabel); cxPanel.add(cxAddressLabel);
??
How do I associate the panel to the particular position in the grid? Would the above work (well, I know it doesn't) - what am I missing here?
Thanks
- Tab
|