title: JFrame not opening in Eclipse Mac
body: <p>I am trying to run a simple Swing program through Eclipse in my Mac. The application runs but i am not able to see the UI appearing.</p>
  
  <p>I am on Mac Mojave and Eclipse Version: Oxygen.2 Release (4.7.2)</p>
  
  <p>This is working fine if i am running the program through command line</p>
  
  <p>Below is my code</p>
  
  <pre><code>import javax.swing.JButton;
  import javax.swing.JFrame;
  import javax.swing.JLabel;
  import javax.swing.JTextField;
  import org.saurav.simpletests.io.HttpClientTester;
  
  public class HelloWorldSwing {
  
      public static void main (String[] args) {
  
          JFrame  frame  = new JFrame("Swing");
          frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  
          JLabel usernameLabel = new JLabel("Username");
          frame.getContentPane().add(usernameLabel);
  
          JTextField userText = new JTextField();
          frame.getContentPane().add(userText);
  
  
          JLabel passwordLabel = new JLabel("password");
          frame.getContentPane().add(passwordLabel);
  
          JTextField passwordText = new JTextField();
          frame.getContentPane().add(passwordText);
  
          JButton button = new JButton("Submit");
          frame.getContentPane().add(button);
          button.addActionListener(e -&gt; {
              // TODO Auto-generated method stub
              String userName = userText.getText();
  
              String password = passwordText.getText();
  
              HttpClientTester httpClientTester = new HttpClientTester();
              httpClientTester.executeHttp(Constants.URL, userName, password);
          });
          frame.setSize(100,100);
          frame.pack();
          frame.setVisible(true);
      }
  }
  </code></pre>