title: java jdbc and jframe
body: <p>When I execute the application I get 'build successful'  but <code>jframe</code> is not displayed on the screen. The application is about retrieving data from an oracle database and
  finding the particular person(record) from the database. <code>jframe</code> may have details of person
  such as firstname,lastname...etc. I may navigate the records in the database. </p>
  
  <pre><code>class Addressbks extends javax.swing.JFrame
  {
  private JButton browseButton;
  
    private JLabel emailLabel;
    private JTextField emailTextField;
    private JLabel firstNameLabel;
    private JTextField firstNameTextField;
    private JLabel lastNameLabel;
    private JTextField lastNameTextField;
    private JLabel idLabel;
    private JTextField idTextField;  
    private JLabel phoneLabel;
    private JTextField phoneTextField;  
    private JTextField indexTextField;
  
  
    private JPanel navigatePanel; 
    private JPanel displayPanel;
    private JPanel queryPanel;
  
    private JButton  previousButton;
    private JButton  nextButton;
  
    private JLabel ofLabel;
    private JTextField maxTextField;  
    private JTextField queryTextField;  
  
    private Person currentEntry;
    private PersonQueries personQueries;
    private List&lt;Person&gt; results;
    private int numberOfEntries = 0;
    private int currentEntryIndex;
    private JLabel queryLabel;
  
    private JButton queryButton;
    private JButton insertButton;
  
  
      /**
       * Creates new form Address book
       */
      public Addressbks() {
          super("The Addressbook");
         initComponents();     
  
       setLayout(new FlowLayout(FlowLayout.CENTER,10,10));
  
  
       personQueries = new PersonQueries();
  
       navigatePanel = new JPanel();
       previousButton = new JButton();
       indexTextField = new JTextField(2);
       ofLabel = new JLabel();
       maxTextField = new JTextField(2);
       nextButton = new JButton();
  
       displayPanel  = new JPanel();
       idLabel = new JLabel();
       idTextField = new JTextField(10);
       firstNameLabel = new JLabel();
       firstNameTextField = new JTextField(10);
       lastNameLabel = new JLabel();
       lastNameTextField = new JTextField(10);
       emailLabel = new JLabel();
       emailTextField = new JTextField(10);
       phoneLabel = new JLabel();
       phoneTextField = new JTextField(10);   
  
  
  
       queryPanel = new JPanel();
       queryLabel = new JLabel();
       queryTextField =new JTextField(10);
       queryButton= new JButton();
       browseButton = new JButton();
       insertButton = new JButton();
  
  
  
       navigatePanel.setLayout(new BoxLayout(navigatePanel,BoxLayout.X_AXIS));
       previousButton.setText("Previous");
  
       previousButton.setEnabled(false);
  
       previousButton.addActionListener(new ActionListener()
          {
                      @Override
              public void actionPerformed(ActionEvent e)
              {
                  previousButtonActionPerformed(e);
              }
          });
      navigatePanel.add(previousButton);
      navigatePanel.add(Box.createHorizontalStrut(10));
  
      indexTextField.setHorizontalAlignment(JTextField.CENTER);
  
      indexTextField.addActionListener(new ActionListener()
          {
                      @Override
              public void actionPerformed(ActionEvent e)
              {
                   indexTextFieldActionPerformed(e);
              }
          });
  
      navigatePanel.add(indexTextField);
      navigatePanel.add(Box.createHorizontalStrut(10));
  
      ofLabel.setText("of");
      navigatePanel.add(ofLabel);
      navigatePanel.add(Box.createHorizontalStrut(10));
  
      maxTextField.setHorizontalAlignment(JTextField.CENTER);
      maxTextField.setEditable(false);   
      navigatePanel.add(maxTextField);
      navigatePanel.add(Box.createHorizontalStrut(10));
  
       nextButton.setText("Next");     
       nextButton.setEnabled(false);
       nextButton.addActionListener(new ActionListener()
          {
                      @Override
              public void actionPerformed(ActionEvent e)
              {
                  nextButtonActionPerformed(e);
              }
          });
       navigatePanel.add(nextButton);
      add(navigatePanel);
  
       displayPanel.setLayout(new GridLayout(5,2,4,4));
  
       idLabel.setText("Address ID");
       displayPanel.add(idLabel);
  
  
       idTextField.setEditable(false);
       displayPanel.add(idTextField);
  
  
       firstNameLabel.setText("First Name :");
       displayPanel.add(firstNameLabel);
       displayPanel.add(firstNameTextField);
  
        lastNameLabel.setText("Last Name :");
       displayPanel.add(lastNameLabel);
       displayPanel.add(lastNameTextField);
  
        emailLabel.setText("Email :");
       displayPanel.add(emailLabel);
       displayPanel.add(emailTextField);
  
         phoneLabel.setText("Phone Number :");
       displayPanel.add(phoneLabel);
       displayPanel.add(phoneTextField);
       add(displayPanel);
  
       queryPanel.setLayout(new BoxLayout(queryPanel,BoxLayout.X_AXIS));
       queryPanel.setBorder(BorderFactory.createTitledBorder("Find an entry by lastname"));
  
      queryLabel.setText("Last Name");
      queryPanel.add(Box.createHorizontalStrut(5));
  
      queryPanel.add(queryLabel);
      queryPanel.add(Box.createHorizontalStrut(10));
      queryPanel.add(queryTextField);
      queryPanel.add(Box.createHorizontalStrut(10));
  
      queryButton.setText("Find");
      queryButton.addActionListener(new ActionListener()
                  {
  
                      @Override
              public void actionPerformed(ActionEvent e)
              {
                   queryButtonActionPerformed(e);
              }
          });
      queryPanel.add(queryButton);
      queryPanel.add(Box.createHorizontalStrut(5)); 
      add(queryPanel);
  
      browseButton.setText("Browse All Entries");
      browseButton.addActionListener(new ActionListener()
                  {
  
                      @Override
              public void actionPerformed(ActionEvent e)
              {
                   browseButtonActionPerformed(e);
              }
          });
  
      add(browseButton);
  
       insertButton.setText("Insert New Entry");
       insertButton.addActionListener(new ActionListener()
                  {
  
                      @Override
              public void actionPerformed(ActionEvent e)
              {
                   insertButtonActionPerformed(e);
              }
          });
       add(insertButton);
  
    /*  addWindowListener (new WindowAdapter()
      {
              @Override
          public void windowClosing(WindowEvent e)
                   {
              personQueries.close();
              //System.exit(0);
          }
      });*/
  
        // setSize(400,400);
        // setResizable(false);
      // setLocationRelativeTo(null);
      // setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 
       //  setVisible(true); 
  
      }  
  public class Addressbook 
   {
      /**
       * @param args the command line arguments
       */
  
      public static void main(String args[]) throws InterruptedException
      {
  
          try {
              for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                  if ("Nimbus".equals(info.getName())) {
                      javax.swing.UIManager.setLookAndFeel(info.getClassName());
                      break;
                  }
              }
          } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | javax.swing.UnsupportedLookAndFeelException ex) {
              java.util.logging.Logger.getLogger(Addressbook.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
          }
          //&lt;/editor-fold&gt;
  
          /* Create and display the form */
          /*context: a.setVisible(true) still the jframe is not displayed */
  
        java.awt.EventQueue.invokeLater(new Runnable() {
                     @Override
              public void run() {
                  JFrame a = new Addressbks();
                  a.setVisible(true);
  
                  }
          });
      }
   }
  </code></pre>