// Create the frame String title = " Title"; J frame = new J(title); // Create a component to add to the frame JComponent comp = new JTextArea(); // Add the component to the frame's content pane; // by default, the content pane has a border layout frame.getContentPane().add(comp, BorderLayout.CENTER); // Show the frame int width = 300; int height = 300; frame.setSize(width, height); frame.setVisible(true);