S
Sean Anderson
here is the code
Box form = Box.createVerticalBox();
form.setBorder(BorderFactory.createRaisedBevelBorder());
// Put form fields here
for (int a=0; a < 6; a++){
JL[a].setAlignmentX(0); //inserted for the hell-of-it to see if it
would change anything, supposed to default left
form.add(JL[a]);
if (a==0) {form.add(Title = new JTextField(30));
Title.setMaximumSize(new Dimension (325,20)); }
if (a==1) {form.add(Author = new JTextField(25));
Author.setMaximumSize(new Dimension (300,20));}
if (a==2) {form.add(Category = new JComboBox());
Category.setEditable(true); Category.setMaximumSize(new Dimension
(300,20));}
if (a==3) {form.add(Code = new JTextField(20)); Code.setMaximumSize(new
Dimension (200,20));}
if (a==4) {form.add(Publisher = new JComboBox());
Publisher.setEditable(true); Publisher.setMaximumSize(new Dimension
(300,20));}
if (a==5) {form.add(Year = new JTextField(10)); Year.setMaximumSize(new
Dimension (100,20));}
}
when the app runs the JTextFields and JLabels are all in the center!? I
have done this in a JFrame and this worked fine as everything aligned to the
left. I have checked through several references/doc and none of them get
detailed enough. What am I doing wrong?
Sean
Box form = Box.createVerticalBox();
form.setBorder(BorderFactory.createRaisedBevelBorder());
// Put form fields here
for (int a=0; a < 6; a++){
JL[a].setAlignmentX(0); //inserted for the hell-of-it to see if it
would change anything, supposed to default left
form.add(JL[a]);
if (a==0) {form.add(Title = new JTextField(30));
Title.setMaximumSize(new Dimension (325,20)); }
if (a==1) {form.add(Author = new JTextField(25));
Author.setMaximumSize(new Dimension (300,20));}
if (a==2) {form.add(Category = new JComboBox());
Category.setEditable(true); Category.setMaximumSize(new Dimension
(300,20));}
if (a==3) {form.add(Code = new JTextField(20)); Code.setMaximumSize(new
Dimension (200,20));}
if (a==4) {form.add(Publisher = new JComboBox());
Publisher.setEditable(true); Publisher.setMaximumSize(new Dimension
(300,20));}
if (a==5) {form.add(Year = new JTextField(10)); Year.setMaximumSize(new
Dimension (100,20));}
}
when the app runs the JTextFields and JLabels are all in the center!? I
have done this in a JFrame and this worked fine as everything aligned to the
left. I have checked through several references/doc and none of them get
detailed enough. What am I doing wrong?
Sean