public HostListPanel(){
  m_List=new JList();
  m_List.setModel(new DefaultListModel());
  m_DeleteBut.setEnabled(false);
  m_DeleteBut.addActionListener(this);
  m_HostField.addActionListener(this);
  setLayout(new BorderLayout());
  setBorder(BorderFactory.createTitledBorder("Hosts"));
  JPanel topLab=new JPanel();
  GridBagLayout gb=new GridBagLayout();
  GridBagConstraints constraints=new GridBagConstraints();
  topLab.setBorder(BorderFactory.createEmptyBorder(10,5,10,5));
  topLab.setLayout(gb);
  constraints.gridx=0;
  constraints.gridy=0;
  constraints.weightx=5;
  constraints.fill=GridBagConstraints.HORIZONTAL;
  constraints.gridwidth=1;
  constraints.gridheight=1;
  constraints.insets=new Insets(0,2,0,2);
  topLab.add(m_DeleteBut,constraints);
  constraints.gridx=1;
  constraints.gridy=0;
  constraints.weightx=5;
  constraints.gridwidth=1;
  constraints.gridheight=1;
  topLab.add(m_HostField,constraints);
  add(topLab,BorderLayout.NORTH);
  add(new JScrollPane(m_List),BorderLayout.CENTER);
}

public HostListPanel ( ) { m_List = new JList ( ) ; m_List . setModel ( new DefaultListModel ( ) ) ; m_DeleteBut . setEnabled ( false ) ; m_DeleteBut . addActionListener ( this ) ; m_HostField . addActionListener ( this ) ; setLayout ( new BorderLayout ( ) ) ; setBorder ( BorderFactory . createTitledBorder ( "Hosts" ) ) ; JPanel topLab = new JPanel ( ) ; GridBagLayout gb = new GridBagLayout ( ) ; GridBagConstraints constraints = new GridBagConstraints ( ) ; topLab . setBorder ( BorderFactory . createEmptyBorder ( 10 , 5 , 10 , 5 ) ) ; topLab . setLayout ( gb ) ; constraints . gridx = 0 ; constraints . gridy = 0 ; constraints . weightx = 5 ; constraints . fill = GridBagConstraints . HORIZONTAL ; constraints . gridwidth = 1 ; constraints . gridheight = 1 ; constraints . insets = new Insets ( 0 , 2 , 0 , 2 ) ; topLab . add ( m_DeleteBut , constraints ) ; constraints . gridx = 1 ; constraints . gridy = 0 ; constraints . weightx = 5 ; constraints . gridwidth = 1 ; constraints . gridheight = 1 ; topLab . add ( m_HostField , constraints ) ; add ( topLab , BorderLayout . NORTH ) ; add ( new JScrollPane ( m_List ) , BorderLayout . CENTER ) ; }
create the host list panel initially disabled .
