title: JButton from different class
body: <p><br>
  please help me with this issue.<br>
  How to create a JButton from a different class, is it even possible?<br>
  The first button is here the second is not:</p>
  
  <pre><code>import javax.swing.JButton;
  import javax.swing.JFrame;
  
  public class Source {
  
      public static void main(String[] args){
          JFrame jf = new JFrame();
          jf.setLayout(null);
          jf.setSize(640, 360);
          jf.setVisible(true);
          jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  
          JButton jb = new JButton("first button");
          jb.setBounds(50, 50, 110, 20);
  
          jf.add(jb);
          jf.add(new Button());
      }
  
  }
  
  class Button extends JButton {
      public Button(){
          JButton jb = new JButton("second button");
          jb.setBounds(0, 0, 110, 20);
      }
  }
  </code></pre>
  
  <p>Thank you in advance.
  Best regards.</p>