@@ -0,0 +1,1665 @@
+/**%0A * @(#)CheckBoxTest.java%0A *%0A *%0A * @author%0A * @version 1.00 2014/7/14%0A */%0Aimport java.awt.*;%0Aimport java.awt.event.*;%0Aimport javax.swing.*;%0A%0Apublic class CheckBoxTest extends JFrame %7B%0A%09private JTextField field1;%0A%09private JCheckBox bold, italic;%0A%0A%09//set GUI%0A    public CheckBoxTest() %7B%0A    %09super (%22JCheckBox Test%22);%0A%0A    %09//get content pane%0A    %09Container container = getContentPane();%0A    %09container.setLayout( new FlowLayout() );%0A%0A    %09//set up JTextField%0A    %09field1 = new JTextField(%22Hohohoho%22, 20);%0A    %09field1.setFont( new Font(%22Serif%22, Font.PLAIN, 14));%0A    %09container.add(field1);%0A%0A    %09//create checkbox objects%0A    %09bold = new JCheckBox (%22Bold%22);%0A    %09container.add( bold);%0A%0A    %09italic = new JCheckBox (%22Italic%22);%0A    %09container.add( italic);%0A%0A    %09//register listenenr%0A    %09CheckBoxHandler handler = new CheckBoxHandler();%0A    %09bold.addItemListener( handler);%0A    %09italic.addItemListener( handler);%0A%0A    %09setSize( 275, 100);%0A    %09setVisible (true);%0A    %7D%0A%0A    public static void main (String%5B%5D args) %7B%0A    %09CheckBoxTest app = new CheckBoxTest();%0A    %09app.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE);%0A    %7D%0A%0A    //private inner class%0A    private class CheckBoxHandler implements ItemListener %7B%0A    %09private int valBold = Font.PLAIN;%0A    %09private int valItalic = Font.PLAIN;%0A%0A    %09public void itemStateChanged( ItemEvent event) %7B%0A%0A    %09%09if ( event.getSource() == bold )%0A    %09%09%09valBold = bold.isSelected() ? Font.BOLD : Font.PLAIN;%0A%0A    %09%09if ( event.getSource() == bold )%0A    %09%09%09valItalic = italic.isSelected() ? Font.ITALIC : Font.PLAIN;%0A%0A    %09%09//set text field%0A    %09%09field1.setFont( new Font( %22Serif%22, valBold + valItalic, 14) );%0A    %09%7D%0A    %7D%0A%0A%0A%7D%0A

Create CheckBoxTest.java