A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Swing / AWT / SWT
JPanel using boxlayout
Joined: Feb 14, 2006
Feb 27, 2006 13:22:00
i cant seem to figure this out, or why it does this.
panel3 = new JPanel(new BoxLayout(panel3,BoxLayout.Y_AXIS));
This line of code does not work, it makes a awt error. yet when i type it this way:
panel3 = new JPanel();
panel3.setLayout(new BoxLayout(panel3, BoxLayout.Y_AXIS));
i dont get it. Can someone please explain this to me.
("Anger is not an emotion, its a symptom of fear.")
Joined: Aug 21, 2004
Feb 27, 2006 13:32:00
I don't think your Panel3 is instansiated on the first exampel. On the second example it works fine cause it has been instansiated.
I agree. Here's the link:
subject: JPanel using boxlayout
Box.createVerticalGlue() not working! Help?
Problem adding JPanels to a box layout
Alignment of RadioButtons
Why are my JFrames closing?
unable to remove spaces between buttons(making a calculator)
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014