JPanel content = (JPanel)getContentPane();
content.setLayout(new FormLayout("5dlu, pref, 3dlu, fill:100dlu:grow(0.5), pref, 5dlu",
"30dlu, 5dlu, pref, 3dlu, pref, 3dlu, pref, fill:pref:grow, pref, 5dlu"));
CellConstraints cc = new CellConstraints();
JPanel panel = new JPanel(new FormLayout("7dlu, pref, fill:pref:grow", "7dlu, center:21dlu, 2dlu, 1px"));
panel.setOpaque(true);
panel.setBackground(Color.WHITE);
panel.setForeground(Color.BLACK);
JLabel top = new JLabel(mLocalizer.msg("title", "Login"));
top.setFont(top.getFont().deriveFont(Font.BOLD, 20));
panel.add(top, cc.xy(2,2));
JPanel black = new JPanel();
black.setBackground(Color.BLACK);
panel.add(black, cc.xyw(1,4,3));
content.add(panel, cc.xyw(1,1,6));
JLabel name = new JLabel(mLocalizer.msg("user", "Username")+":");
content.add(name, cc.xy(2, 3));
mNameField = new JTextField();
content.add(mNameField, cc.xy(4,3));
mNameField.setText(mUsername);
JLabel password = new JLabel(mLocalizer.msg("password", "Password")+":");
content.add(password, cc.xy(2, 5));
mPasswordField = new JPasswordField();
content.add(mPasswordField, cc.xy(4,5));
mPasswordField.setText(mPassword);
mStorePassword = new JCheckBox(mLocalizer.msg("storePassword", "Store Password"));
content.add(mStorePassword, cc.xy(4,7));
mStorePassword.setSelected(mStore);
ButtonBarBuilder2 builder = new ButtonBarBuilder2();
builder.addGlue();
JButton ok = new JButton(Localizer.getLocalization(Localizer.I18N_OK));
ok.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
mReturnValue = JOptionPane.OK_OPTION;
setVisible(false);
}
});
getRootPane().setDefaultButton(ok);
JButton cancel = new JButton (Localizer.getLocalization(Localizer.I18N_CANCEL));
cancel.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
close();
}
});
builder.addButton(new JButton[] {ok, cancel});
content.add(builder.getPanel(), cc.xyw(1,9,5));
setSize(Sizes.dialogUnitXAsPixel(200, this), Sizes.dialogUnitYAsPixel(140, this));
}