public void init(){
  super.setTitle("Font Chooser");
  TitledBorder panelBorder=new TitledBorder("Sample");
  fList.setSelectionMode(0);
  stList.setSelectionMode(0);
  sizeList.setSelectionMode(0);
  jtfTest.setHorizontalAlignment(JTextField.CENTER);
  jspFont.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
  jspStyle.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
  jspSize.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
  panel.setBorder(panelBorder);
  jtfFonts.setBounds(8,5,121,20);
  jspFont.setBounds(8,29,121,82);
  jtfStyle.setBounds(136,5,121,20);
  jspStyle.setBounds(136,29,121,82);
  jtfSize.setBounds(264,5,41,20);
  jspSize.setBounds(264,29,41,82);
  panel.setBounds(6,121,301,67);
  container.add(jlbFonts);
  container.add(jtfFonts);
  container.add(jspFont);
  container.add(jlbStyle);
  container.add(jtfStyle);
  container.add(jspStyle);
  container.add(jlbSize);
  container.add(jtfSize);
  container.add(jspSize);
  container.add(panel);
  jtfTest.setBounds(8,20,288,35);
  panel.add(jtfTest);
  container.setLayout(null);
  panel.setLayout(null);
  setSize(340,278);
  setResizable(false);
  setModal(true);
  setContentPane(container);
  jtfFonts.addActionListener(this);
  jtfSize.addActionListener(this);
  jtfStyle.addActionListener(this);
  fList.addListSelectionListener(this);
  stList.addListSelectionListener(this);
  sizeList.addListSelectionListener(this);
}

public void init ( ) { super . setTitle ( "Font Chooser" ) ; TitledBorder panelBorder = new TitledBorder ( "Sample" ) ; fList . setSelectionMode ( 0 ) ; stList . setSelectionMode ( 0 ) ; sizeList . setSelectionMode ( 0 ) ; jtfTest . setHorizontalAlignment ( JTextField . CENTER ) ; jspFont . setHorizontalScrollBarPolicy ( JScrollPane . HORIZONTAL_SCROLLBAR_NEVER ) ; jspStyle . setHorizontalScrollBarPolicy ( JScrollPane . HORIZONTAL_SCROLLBAR_NEVER ) ; jspSize . setHorizontalScrollBarPolicy ( JScrollPane . HORIZONTAL_SCROLLBAR_NEVER ) ; panel . setBorder ( panelBorder ) ; jtfFonts . setBounds ( 8 , 5 , 121 , 20 ) ; jspFont . setBounds ( 8 , 29 , 121 , 82 ) ; jtfStyle . setBounds ( 136 , 5 , 121 , 20 ) ; jspStyle . setBounds ( 136 , 29 , 121 , 82 ) ; jtfSize . setBounds ( 264 , 5 , 41 , 20 ) ; jspSize . setBounds ( 264 , 29 , 41 , 82 ) ; panel . setBounds ( 6 , 121 , 301 , 67 ) ; container . add ( jlbFonts ) ; container . add ( jtfFonts ) ; container . add ( jspFont ) ; container . add ( jlbStyle ) ; container . add ( jtfStyle ) ; container . add ( jspStyle ) ; container . add ( jlbSize ) ; container . add ( jtfSize ) ; container . add ( jspSize ) ; container . add ( panel ) ; jtfTest . setBounds ( 8 , 20 , 288 , 35 ) ; panel . add ( jtfTest ) ; container . setLayout ( null ) ; panel . setLayout ( null ) ; setSize ( 340 , 278 ) ; setResizable ( false ) ; setModal ( true ) ; setContentPane ( container ) ; jtfFonts . addActionListener ( this ) ; jtfSize . addActionListener ( this ) ; jtfStyle . addActionListener ( this ) ; fList . addListSelectionListener ( this ) ; stList . addListSelectionListener ( this ) ; sizeList . addListSelectionListener ( this ) ; }
initializes font chooser dialog .
