posted 18 years ago
The rule is that you can add a component to only one container. If you add a component to one container and then add it to another, it is removed from the first and added to the second. You could pass the component around from one JFrame to another but this seems inelegant. For options you could launch a JDialog to show the controls and to get user input. You could add a control panel to your JFrame and use the button to toggle it visible/invisible. Swing offers the JTabbedPane that can be useful here. Another option is the AWT CardLayout used here: