EDITED CODE:
public static void main(String[] args){
JFrame frame = new JFrame();
frame.setLayout(new FlowLayout(FlowLayout.CENTER, 0, 0));
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.add(new StartPanel());
frame.add(new InstructionsPanel());
frame.add(new GamePanel());
frame.getContentPane().getComponent(1).setVisible(false);
frame.getContentPane().getComponent(2).setVisible(false);
frame.setPreferredSize(new Dimension(500, 500));
frame.pack();
frame.setVisible(true);
}
No matter what outside class I try to modify the frame from (any of the 3 panel classes above), I get a null pointer exception pointing to the line I am modifying something in the frame.