public void createUserInterface()
{
// get content pane for attaching GUI components
Container contentPane = getContentPane();
// enable explicit positioning of GUI components
contentPane.setLayout( null );
contentPane.setBackground(Color.BLACK);
// set up myDrawJPanel
myDrawJPanel = new DrawJPanel2();
myDrawJPanel.setBounds( 150, 8, 350, 274 );
myDrawJPanel.setBackground(Color.WHITE);
contentPane.add( myDrawJPanel );
// set properties of application's window
setTitle( "Painter" ); // set title bar text
setSize( 516, 330 ); // set window size
setVisible( true ); // display window
} // end method createUserInterface
As far as I know, this should give a black window with a white panel to the right side, but the panel is black too. Oh well.
No comments:
Post a Comment