title: why the classes have to be inside the other class?
body: <pre><code>public class AreaDeRectangulo extends JFrame {
  
      public static final int WIDTH = 640;
      public static final int HEIGHT = 480;
  
      public JLabel AltoL, AnchoL, AreaL, PerimetroL;
      public JTextField AltoTF, AnchoTF, AreaTF, PerimetroTF;
      public JButton Calcular, Salir;
  
      public BotonDeCalcular cbHandler;
      public BotonDeSalir ebHandler;
  
  
      }
  
      public class BotonDeCalcular implements ActionListener {
  
          public void actionPerformed(ActionEvent e) {
              double alto, ancho, area;
  
              ancho = Double.parseDouble(AnchoTF.getText());
              alto = Double.parseDouble(AltoTF.getText());
              area = ancho * alto;
  
              AreaTF.setText(" " + area);
          }
      }
  
      public static class BotonDeSalir implements ActionListener {
  
          public void actionPerformed(ActionEvent e) {
              System.exit(0);
          }
  
          public static void main(String[] args) {
  
              AreaDeRectangulo rectObj = new AreaDeRectangulo();
          }
  
      }
  }
  </code></pre>
  
  <p>Why the classes "BotondeCalcular" and "BotondeSalir" have to be created inside the main class? are they like a mini-classes?
  PD: it gives me an error if I try to separate the classes</p>