title: Trying to update my JFrame, why won't repaint work?
body: <p>I will run the program, but when I activate the event, the JFrame will not update (it only removes the JLabel ) unless I manually drag the window to resize it, even with the repaint() being called after the event takes place. What's wrong?</p>
  
  <pre><code>public Driver() {
      setLayout( new FlowLayout() );
  
      pass = new JPasswordField( 4 );
          add( pass );
  
      image = new ImageIcon( "closedD.png" );
      label = new JLabel( "Enter the password to enter the journal of dreams" , image , JLabel.LEFT );
          add( label );
  
      button = new JButton( "Enter" );
          add( button );
  
      event e = new event();
          button.addActionListener( e );
  
      setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
      setVisible( true );
      setSize( 1600/2 , 900/2 );
      setTitle( "Diary" );
  }
  
  //main method
  //
  //
  public static void main( String[] args ) {
      win = new Driver();
  }
  
  public class event implements ActionListener {
      private boolean clickAgain = false;
  
      public void actionPerformed( ActionEvent e ) {
          if ( passEquals( password ) &amp;&amp; clickAgain == false ) {
              image2 = new ImageIcon( "openD.png" );
              remove( label );
  
              label = new JLabel( "Good Job! Here is the journal of dreams." , image2 , JLabel.LEFT );
                  add( label );
  
                  clickAgain = true;
          }
  
          repaint();
      }
  }
  </code></pre>