title: Can't call a JFrame Method from my main
body: <p>I have built a small program in java to fetch a result from an input.</p>
  
  <p>It works in console, but now I want it to have a GUI, for wich I'm using swing JFrames.</p>
  
  <p>And that's where I'm stuck : I manage to display a form, creating it from my main code.
  But then I want to manipulate this form at will, using simple setters and getters.</p>
  
  <p>I've made a setter to change the value of my form panel, but the main code won't recognize the method.</p>
  
  <p>I'm very new to GUI, so I wager that I'm just lacking the right logic to use Swing, but if anyone would be kind enough to find what gross mistake i'm making, here's my code, striped down to the bare minimum of what I'm stuck with:</p>
  
  <p>NB: here I've put my main code directly into the class out of convenience, but I've tried separating my GUI class from my main with the same result.</p>
  
  <pre><code>public class mainform {
  
  public JPanel panel1;
  private JLabel output;
  
  public void setRes()
  {
      output.setText("hello");
  }
  
  
  public static void main(String[] args) throws IOException {
      JFrame frame = new JFrame("mainform");
      frame.setContentPane(new mainform().panel1);
      frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      frame.pack();
      frame.setVisible(true);
  
      frame.setRes(); // HERE IS WHERE "setRes" won't be recognized as a method...
  
  }
  
  }
  </code></pre>