title: Display a JPanel on full screen
body: <p>Hello I have a JPanel who contained a JTable and a TextField. I want that the display screen is displayed in full screen because  in my case it appears half of the screen.here's not a parameter of screen size that I have to specify or change?</p>
  
  <p>This is the result:</p>
  
  <p><a href="https://i.stack.imgur.com/bmUZX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bmUZX.png" alt="http://i.stack.imgur.com/bmUZX.png"></a></p>
  
  <pre><code> public MainWindow()
   {
  super("Fullscreen");
  getContentPane().setPreferredSize(      
  
  Toolkit.getDefaultToolkit().getScreenSize());
  pack();
  setResizable(false);
  show();
  </code></pre>