KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > lucane > client > widgets > jazzy > JSpellDialog


1 package org.lucane.client.widgets.jazzy;
2
3 import com.swabunga.spell.event.SpellCheckEvent;
4
5 import javax.swing.*;
6
7
8 import java.awt.*;
9 import java.awt.event.ActionEvent JavaDoc;
10 import java.awt.event.ActionListener JavaDoc;
11 import java.awt.event.WindowEvent JavaDoc;
12 import java.awt.event.WindowListener JavaDoc;
13
14 /** Implementation of a spell check dialog.
15  *
16  * @author Jason Height (jheight@chariot.net.au)
17  */

18 public class JSpellDialog extends JDialog implements ActionListener JavaDoc, WindowListener JavaDoc {
19   private JSpellForm form = new JSpellForm();
20   private SpellCheckEvent event = null;
21
22   public JSpellDialog(Frame owner, String JavaDoc title, boolean modal) {
23     super(owner, title, modal);
24     initialiseDialog();
25   }
26
27   public JSpellDialog(Dialog owner, String JavaDoc title, boolean modal) {
28     super(owner, title, modal);
29     initialiseDialog();
30   }
31
32   private void initialiseDialog() {
33     getContentPane().add(form);
34     form.addActionListener(this);
35     addWindowListener(this);
36     //setDefaultCloseOperation(JDialog.HIDE_ON_CLOSE);
37
pack();
38   }
39
40
41   public void show(SpellCheckEvent e) {
42     // System.out.println("Show");
43
this.event = e;
44     form.setSpellEvent(e);
45     show();
46   }
47
48   public void actionPerformed(ActionEvent JavaDoc e) {
49     hide();
50   }
51
52   public void windowOpened(WindowEvent JavaDoc e) {
53   }
54
55   /** Cancel the event if the Dialog Close button is pressed*/
56   public void windowClosing(WindowEvent JavaDoc e) {
57     if (event != null)
58       event.cancel();
59   }
60
61   public void windowClosed(WindowEvent JavaDoc e) {
62   }
63
64   public void windowIconified(WindowEvent JavaDoc e) {
65   }
66
67   public void windowDeiconified(WindowEvent JavaDoc e) {
68   }
69
70   public void windowActivated(WindowEvent JavaDoc e) {
71   }
72
73   public void windowDeactivated(WindowEvent JavaDoc e) {
74   }
75 }
76
Popular Tags