public class Interface extends JPanel { public Interface(){ super(); setLayout(new GridLayout(3, 1)); add(new JTextArea()); add(new JButton()); add(new JTextArea()); } public static void main(String[] args){ JFrame f = new JFrame(); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.add(new Interface()); f.setBounds(100, 100, 200, 200); f.setVisible(true); } }