title: intellij and swing - changing jpanel size
body: <p>I am using intellij with swing.<br>
  My application runs on different computers with different monitors.<br>
  I want to display my form in different sizes. </p>
  
  <p>I have a JPanel (not the main . inner jpanel ) set to (-1,670) in the intellij gui editor.<br>
  And I try to change it with this code :</p>
  
  <pre><code>  MyFormUI myform = new MyFormUI();
    if (thisIsTheCase){
        myform.setLongView() 
    }
  </code></pre>
  
  <p>and in MyFormUI -> </p>
  
  <pre><code>  public void setLongView(){ 
         myPanel.setPrefferedSize(new Dimension(-1, 1000))
         myPanel.repaint() ;
         revalidate();    
         // I tried also repaint and revalidate on a higher jpanel in the hierarchy
    }
  </code></pre>
  
  <p>When I change it in the gui editor - it does change, but not through code.<br>
  any suggestions?   </p>