private JPanel getMainPanel ( ) { if ( mainPanel == null ) { mainPanel = new JPanel ( ) ; mainPanel . setLayout ( new GridBagLayout ( ) ) ; GridBagConstraints c = new GridBagConstraints ( ) ; c . insets = new Insets ( 5 , 5 , 5 , 5 ) ; c . fill = GridBagConstraints . HORIZONTAL ; c . gridx = 0 ; c . gridy = 0 ; c . weightx = 0.0D ; mainPanel . add ( new JLabel ( "Host" ) , c ) ; c . gridx = 1 ; c . weightx = 1.0D ; mainPanel . add ( getHostField ( ) , c ) ; c . gridx = 0 ; c . gridy = 1 ; c . weightx = 0.0D ; mainPanel . add ( new JLabel ( "User" ) , c ) ; c . gridx = 1 ; c . weightx = 1.0D ; mainPanel . add ( getUserField ( ) , c ) ; c . gridx = 0 ; c . gridy = 2 ; c . weightx = 0.0D ; mainPanel . add ( new JLabel ( "Password" ) , c ) ; c . gridx = 1 ; c . weightx = 1.0D ; mainPanel . add ( getPasswordField ( ) , c ) ; c . gridx = 0 ; c . gridy = 3 ; c . weightx = 1.0D ; c . gridwidth = 2 ; mainPanel . add ( getRememberPasswordCheckBox ( ) , c ) ; c . gridx = 0 ; c . gridy = 4 ; c . weightx = 1.0D ; c . weighty = 1.0D ; c . gridwidth = 2 ; mainPanel . add ( new JPanel ( ) , c ) ; } return mainPanel ; }
This method initializes mainPanel