title: Java GUI internal classse to separate files
body: <p>I am writing a java program which have a big amount of different GUI objects and GUI class file became huge. I wanted to ask if there is a way to separate these internal files in different files and if so, how to do that.</p>
  
  <p>The general structure of the GUI(Runner)class is following</p>
  
  <pre><code>public class Gui extends JFrame{
   &lt;componendt definition&gt;
  
      public Gui() 
      {
          &lt;component initialization&gt;
  
          &lt;containers and adding objects to container&gt;
  
          &lt;attaching listeners&gt;
          // for example
          generate_button.addActionListener(new generate_ButtonHandler());
      }
  
      // I want to separate these classes in different files
      class generate_ButtonHandler implements ActionListener
      {
          public void actionPerformed(ActionEvent e)
          {
              &lt;some suff&gt;
          }
      }
  
      public static void main(String[] args) {
          JFrame f = new Gui();
          f.setVisible (true);
          f.setDefaultCloseOperation (EXIT_ON_CLOSE); 
      }
  
  }
  </code></pre>
  
  <p>Or may be there is another solution how to handle these big files</p>