title: The Program Compiles and Runs but no Output
body: <p>Currently i have created 2 <code>JFrame</code>s , one <code>JFrame</code> for <strong>login authentication</strong> and other one is the <strong>main menu</strong>. The problem is when i compile and run the program there is no output , the screen is just blank. The <strong>NetBeans</strong> compiler shows that its running but nothing appears. </p>
  
  <p>Here is what i have done : This is the login frame code.</p>
  
  <pre><code>public class Login_screen extends javax.swing.JFrame {
  
      /**
       * Creates new form Login_screen
       */
      public Login_screen() {
          initComponents();
          this.getContentPane().setBackground(new Color(0,176,80)); //changed the background colour of the frame
      }
  
      JFrame frame=new JFrame();
  
      Main_Menu_screen openscreen=new Main_Menu_screen();
      createLogin_class createAccount=new createLogin_class();
  
      private void btnloginActionPerformed(java.awt.event.ActionEvent evt) {                                         
          try{
              libraryLogin_class loginObject=new libraryLogin_class();
              createAccount.login();
              String username=txtusername.getText();
              String password=new String(txtpassword.getPassword());
  
              FileInputStream file=new FileInputStream("login.txt");
              ObjectInputStream readFile=new ObjectInputStream(file);
  
              loginObject=(libraryLogin_class)readFile.readObject();
  
              readFile.close();
              if(loginObject.getUsername().equals(username) &amp;&amp; 
                      loginObject.getPassword().equals(password)){
  
                  JOptionPane.showMessageDialog(frame,"Login Successful");
                  this.setVisible(false);
                  openscreen.setVisible(true);
              }
              else
              {
                  JOptionPane.showMessageDialog(frame,"Username/Password Incorrect!");
              }
          }catch(Exception e){}
      }
  
      public static void main(String args[]) {
          java.awt.EventQueue.invokeLater(new Runnable() {
              public void run() {
                  new Login_screen().setVisible(true);
              }
          });
      }
  }
  </code></pre>
  
  <p>These are 2 separate classes which associates with the login frame.</p>
  
  <pre><code>public class createLogin_class {
  
      /**
       * Below method creates a login with the given 
       * username and password and passes  them to createLogin method
       */
  
      public void login(){
  
          String username="shehan";
          String password="123";
  
          createLogin_class user=new createLogin_class();
          user.createLogin(username, password);
      }
  
      /**
       * This method calls the constructor of libraryLogin class 
       * and pass the parameters to create an object, 
       * after the object is created it is written in to a file.
       * @param username
       * @param password 
       */
      public void createLogin(String username,String password){
  
          libraryLogin_class logins=new libraryLogin_class(username,password);
  
          try{
              FileOutputStream write=new FileOutputStream("login.txt");
              ObjectOutputStream writeTofile=new ObjectOutputStream(write);
  
              writeTofile.writeObject(logins);
              writeTofile.flush();
              writeTofile.close();
          }catch(Exception e){}
      }
  }
  </code></pre>
  
  <p>The other Class :</p>
  
  <pre><code>public class libraryLogin_class implements Serializable {
  
      private String username;
      private String password;
  
      public libraryLogin_class(){}
  
      public libraryLogin_class(String username, String password) {
          this.username = username;
          this.password = password;
      }
  
      public String getUsername() {
          return username;
      }
  
      public String getPassword() {
          return password;
      }
  }
  </code></pre>