|
In the code you posted, you could add the elements directly to the window (JFrame) by calling app.getContentPane().add(element), or alternatively add them to the panel (JPanel) by calling pan.add(element). If you choose the former you can remove pan from your code.
|