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 ; 10 import java.awt.event.ActionListener ; 11 import java.awt.event.WindowEvent ; 12 import java.awt.event.WindowListener ; 13 14 18 public class JSpellDialog extends JDialog implements ActionListener , WindowListener { 19 private JSpellForm form = new JSpellForm(); 20 private SpellCheckEvent event = null; 21 22 public JSpellDialog(Frame owner, String title, boolean modal) { 23 super(owner, title, modal); 24 initialiseDialog(); 25 } 26 27 public JSpellDialog(Dialog owner, String 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 pack(); 38 } 39 40 41 public void show(SpellCheckEvent e) { 42 this.event = e; 44 form.setSpellEvent(e); 45 show(); 46 } 47 48 public void actionPerformed(ActionEvent e) { 49 hide(); 50 } 51 52 public void windowOpened(WindowEvent e) { 53 } 54 55 56 public void windowClosing(WindowEvent e) { 57 if (event != null) 58 event.cancel(); 59 } 60 61 public void windowClosed(WindowEvent e) { 62 } 63 64 public void windowIconified(WindowEvent e) { 65 } 66 67 public void windowDeiconified(WindowEvent e) { 68 } 69 70 public void windowActivated(WindowEvent e) { 71 } 72 73 public void windowDeactivated(WindowEvent e) { 74 } 75 } 76 | Popular Tags |