Listing 5. Beginning of the constructor. |
---|
controlPanel.setLayout(new GridLayout(2,1)); controlPanel.add(colorPanel); controlPanel.add(buttonPanel); colorPanel.setBackground(Color.RED); colorPanel.add(new JLabel( "Red pixel Color at Cursor: ")); colorPanel.add(redField); buttonPanel.setBackground(Color.BLUE); buttonPanel.add(getDataButton); getContentPane().add(controlPanel); setTitle("Dick Baldwin"); setVisible(true); |