public void setSampleFont()
   {  
      // Get font name   
      String facename 
            = (String) facenameCombo.getSelectedItem();
      
      // Get font style
      
      int style = 0;
      if (italicCheckBox.isSelected()) 
      { 
         style = style + Font.ITALIC; 
      }
      if (boldCheckBox.isSelected()) 
      { 
         style = style + Font.BOLD; 
      }
         
      // Get font size   

      int size = 0;
      
      final int SMALL_SIZE = 24;
      final int MEDIUM_SIZE = 36;
      final int LARGE_SIZE = 48;

      if (smallButton.isSelected()) { size = SMALL_SIZE; }
      else if (mediumButton.isSelected()) { size = MEDIUM_SIZE; }
      else if (largeButton.isSelected()) { size = LARGE_SIZE; }
         
      // Set font of text field
      
      sampleField.setFont(new Font(facename, style, size));      
      sampleField.repaint();
   }