Hey I'm working on a program where I have a tabbed pane and one of the tabs I am displaying a label for username and a un text field as well as the pass label and pw field. I tired using a springlayout to do this because i want the u/n label and txtfield one one line with the pw label and field under that, but they go right next to each other..here is the code i have..


JFrame frame = new JFrame("Away Bot");
Container contentPane = frame.getContentPane();
SpringLayout layout = new SpringLayout();
contentPane.setLayout(layout);
JTabbedPane tabby = new JTabbedPane();
JPasswordField pw = new JPasswordField(20);
JTextField sn = new JTextField(20);
JPanel login = new JPanel();
{
JLabel scrn = new JLabel("Screen name:",JLabel.TRAILING);
login.add(scrn);
scrn.setLabelFor(sn);
login.add(sn);
JLabel pass = new JLabel("Password:",JLabel.TRAILING);
login.add(pass);
pass.setLabelFor(pw);
login.add(pw);
}
JPanel options = new JPanel();
JPanel chat = new JPanel();

tabby.add("Login",login);
tabby.add("Options",options);
tabby.add("Chat",chat);
frame.getContentPane().add(tabby);
frame.setSize(500,300);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
}
}