import java.awt.*; import java.awt.event.*; import javax.swing.*; public class FindDialog1 extends KDialog { JLabel findLabel = new JLabel("Find:"); JTextField findText = new JTextField(); JCheckBox caseCheck = new JCheckBox("Match Case"); JCheckBox wordCheck = new JCheckBox("Whole Word"); JRadioButton topRadio = new JRadioButton("Start at Top"); JRadioButton wrapRadio = new JRadioButton("Wrap Around"); JButton findButton = new JButton("Find"); JButton closeButton = new JButton("Close"); public static void main(String[] args) { JDialog dialog = new FindDialog1(new Frame(), "Find Dialog 1", true); dialog.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent event) { System.exit(0); } }); dialog.setVisible(true); System.exit(0); } public FindDialog1(Frame owner, String title, boolean modal) { super(owner, title, modal); closeButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent event) { setVisible(false); } }); layoutComponents(); } private void layoutComponents() { Container box = getContentPane(); box.add(findLabel); box.add(findText); box.add(caseCheck); box.add(wordCheck); box.add(topRadio); box.add(wrapRadio); box.add(findButton); box.add(closeButton); } }