I have the following class. When I comment out this.add( rightPanel ); leftPanel appears perfectly. When I comment out this.add( leftPanel );, my rightPanel animates perfectly. When I have both, I only see rightPanel.
How can I manipulate my layout (potentially with a layout manager such as FlowLayout or BoxLayout) to see both objects?
import javax.swing.*; import java.awt.Dimension; public class MainFrame extends JFrame { JPanel leftPanel; // Contains some TJextField, JButton, JLabel objects JApplet rightPanel; // Shows an animation public MainFrame(String name) { super(name); leftPanel = new LeftPane(); rightPanel = new RightPane(); // This is a failed attempt to avoid losing my leftPanel leftPanel.setMinimumSize( new Dimension( 120, 100) ); this.add( leftPanel ); this.add( rightPanel ); rightPanel.start(); } }