title: How to access variables from the main method in another class
body: <p>This is probably a noob question but oh well, I need to collect the frameWidth and frameHeight variables from my main method</p>
  
  <hr>
  
  <p>frame.java</p>
  
  <pre><code>public static void main(String[] args) { 
      .....
      .......                                                
      int frameWidth  = frame.getContentPane().getWidth();
      int frameHeight  = frame.getContentPane().getHeight();
  }
  </code></pre>
  
  <p>Board.java</p>
  
  <pre><code>public class board extends JPanel {
      private frame Frame;
  
      public board() {
          Frame = new frame();
          int FrameWidth = frame.main().frameWidth;
          int FrameWidth = frame.main().frameHeight;
      }
  }
  </code></pre>
  
  <hr>
  
  <p>What is the proper way of accessing the variable?</p>