/** DayNight.java -- Allow the user to use buttons to change * between a daytime and nighttime image. Special features: * disabling buttons, mnemonics, tool tips. */ import javax.swing.*; import java.awt.*; public class DayNight { /** We want a frame with a panel oriented with a vertical layout. * Inside this panel, put 2 smaller panels, one for the picture * and one for the buttons. */ public static void main(String [] args) { JFrame frame = new JFrame("Eiffel Tower"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JPanel panel = new JPanel(); panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS)); PicturePanel pix = new PicturePanel(); ButtonPanel buttons = new ButtonPanel(pix); panel.add(pix); panel.add(buttons); //JSplitPane pane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, pix, buttons); frame.getContentPane().add(panel); frame.pack(); frame.show(); } }