title: Changing the size for my applet also in eclipse "run as applet"
body: <p>I am currently doing my first applet. While testing the results I want to be able to run it in eclipse in the preview windows instead of always deploying the applet into a jar and opening the page in the browser (the browser cache kills me! I always need to restart the browser...)</p>
  
  <p>Anyway, when I try to run the app with "run as -> Java Applet" I got the preview but its always very small (guess below 200x200). When I change the size per hand, the window grows but the content stay that small. When I call <code>setSize(width, height)</code> the window starts bigger, the content stays small. Small doesn't mean its scaled down, it means that I only see the black panel, the white one (which is visible in the browser) is not visible so its not seemed to be scaled...</p>
  
  <p>What am I missing?</p>
  
  <p>My code so far (which works like expected in the broswer with width of 560 and height of 500)</p>
  
  <pre><code>import java.awt.BorderLayout;
  import java.awt.Color;
  import java.awt.Dimension;
  import java.awt.GridLayout;
  
  import javax.swing.JApplet;
  import javax.swing.JButton;
  import javax.swing.JLabel;
  import javax.swing.JPanel;
  
  public class Benchmark extends JApplet {
   private static final long serialVersionUID = -8767182603875435760L;
  
   GridLayout gridLayout = new GridLayout(7, 1);
   JButton startTests = new JButton("Start");
   JPanel testPanel = new JPanel();
   JPanel topPanel = new JPanel();
  
   @Override
   public void init() {
    super.init();
    try {
     java.awt.EventQueue.invokeAndWait(new Runnable() {
      public void run() {
       initComponents();
       invalidate();
      }
     });
    } catch (Exception ex) {
     ex.printStackTrace();
    }
   }
  
   public void initComponents() {
       setSize(660, 500);
       topPanel.setBackground(Color.BLACK);
       topPanel.setSize(500, 500);
  
       testPanel.setBackground(Color.WHITE);
       testPanel.setSize(160, 500);
  
       getContentPane().add(topPanel, BorderLayout.WEST);
       getContentPane().add(testPanel, BorderLayout.EAST);
       testPanel.setLayout(gridLayout);
       testPanel.add(new JLabel("Triangles"));
       testPanel.add(new JLabel("Pyramids"));
       testPanel.add(new JLabel("Cubes"));
       testPanel.add(new JLabel("Blending"));
       testPanel.add(new JLabel("Spheres"));
       testPanel.add(new JLabel("Lights"));
       testPanel.add(new JLabel("Mass"));
   }
  }
  </code></pre>
  
  <p>The screenshot should show the problem. If the window has the size of 660x500 (set with <code>setSize()</code> the visible area stays small: <img src="https://i.stack.imgur.com/sWzP5.png" alt="Java Applet"></p>