public void createConnectionDialog(){
  userNameLabel=new JLabel("User name: ",JLabel.RIGHT);
  userNameField=new JTextField("app");
  passwordLabel=new JLabel("Password: ",JLabel.RIGHT);
  passwordField=new JTextField("app");
  serverLabel=new JLabel("Database URL: ",JLabel.RIGHT);
  serverField=new JTextField("jdbc:derby://localhost:1527/sample");
  driverLabel=new JLabel("Driver: ",JLabel.RIGHT);
  driverField=new JTextField("org.apache.derby.jdbc.ClientDriver");
  connectionPanel=new JPanel(false);
  connectionPanel.setLayout(new BoxLayout(connectionPanel,BoxLayout.X_AXIS));
  JPanel namePanel=new JPanel(false);
  namePanel.setLayout(new GridLayout(0,1));
  namePanel.add(userNameLabel);
  namePanel.add(passwordLabel);
  namePanel.add(serverLabel);
  namePanel.add(driverLabel);
  JPanel fieldPanel=new JPanel(false);
  fieldPanel.setLayout(new GridLayout(0,1));
  fieldPanel.add(userNameField);
  fieldPanel.add(passwordField);
  fieldPanel.add(serverField);
  fieldPanel.add(driverField);
  connectionPanel.add(namePanel);
  connectionPanel.add(fieldPanel);
}

public void createConnectionDialog ( ) { userNameLabel = new JLabel ( "User name: " , JLabel . RIGHT ) ; userNameField = new JTextField ( "app" ) ; passwordLabel = new JLabel ( "Password: " , JLabel . RIGHT ) ; passwordField = new JTextField ( "app" ) ; serverLabel = new JLabel ( "Database URL: " , JLabel . RIGHT ) ; serverField = new JTextField ( "jdbc:derby://localhost:1527/sample" ) ; driverLabel = new JLabel ( "Driver: " , JLabel . RIGHT ) ; driverField = new JTextField ( "org.apache.derby.jdbc.ClientDriver" ) ; connectionPanel = new JPanel ( false ) ; connectionPanel . setLayout ( new BoxLayout ( connectionPanel , BoxLayout . X_AXIS ) ) ; JPanel namePanel = new JPanel ( false ) ; namePanel . setLayout ( new GridLayout ( 0 , 1 ) ) ; namePanel . add ( userNameLabel ) ; namePanel . add ( passwordLabel ) ; namePanel . add ( serverLabel ) ; namePanel . add ( driverLabel ) ; JPanel fieldPanel = new JPanel ( false ) ; fieldPanel . setLayout ( new GridLayout ( 0 , 1 ) ) ; fieldPanel . add ( userNameField ) ; fieldPanel . add ( passwordField ) ; fieldPanel . add ( serverField ) ; fieldPanel . add ( driverField ) ; connectionPanel . add ( namePanel ) ; connectionPanel . add ( fieldPanel ) ; }
creates the connectionpanel , which will contain all the fields for the connection information .
