Hp web site - Chapter 13 Graphical User Interface Components: Part 2
Chapter 13 Graphical User Interface Components: Part 2 761 95 // execute application 96 public static void main( String args[] ) 97 { 98 LookAndFeelDemo application = new LookAndFeelDemo(); 99 100 application.setDefaultCloseOperation( 101 JFrame.EXIT_ON_CLOSE ); 102 } 103 104 // private inner class to handle radio button events 105 private class ItemHandler implements ItemListener { 106 107 // process user’s look-and-feel selection 108 public void itemStateChanged( ItemEvent event ) 109 { 110 for ( int count = 0; count < radio.length; count++ ) 111 112 if ( radio[ count ].isSelected() ) { 113 label.setText( "This is a " + 114 strings[ count ] + " look-and-feel" ); 115 comboBox.setSelectedIndex( count ); 116 117 changeTheLookAndFeel( count ); 118 } 119 } 120 121 } // end private inner class ItemHandler 122 123 } // end class LookAndFeelDemo Fig. 13.12 Fig. 13.12 Changing the look-and-feel of a Swing-based GUI (part 3 of 3). All the GUI components and event handling in this example have been covered before, so we concentrate on the mechanism for changing the look-and-feel in this example.
Note: If you are looking for high quality webhost to host and run your jsp application check Vision jsp web hosting services