// Path: src/com/swabunga/spell/swing/JSpellApplet.java
// public class JSpellApplet extends JApplet {
// 
//   private static final String dictionaryFile = "dict/english.0.zip";
//   private SpellDictionary dictionary;
//   JTextArea text = null;
//   JButton spell = null;
// 
//   /**
//    * @see java.awt.Component#paint(Graphics)
//    */
//   public void paint(Graphics arg0) {
//     super.paint(arg0);
// 
//   }
// 
//   /**
//    * @see java.applet.Applet#init()
//    */
//   public void init() {
//     super.init();
// 
//     try {
//       URL resource = null;
//       ZipInputStream zip = null;
//       try {
//         resource = new URL(getCodeBase().toExternalForm() + dictionaryFile);
//         zip = new ZipInputStream(resource.openStream());
//         /* getCodeBase() throws a NullPointerException when run
//          * outside the context of a browser
//          */
//       } catch (NullPointerException e) {
//         FileInputStream fin = new FileInputStream(dictionaryFile);
//         zip = new ZipInputStream(fin);
//       }
//       zip.getNextEntry();
//       dictionary = new SpellDictionaryHashMap(new BufferedReader(new InputStreamReader(zip)));
// 
//       initGUI();
//     } catch (MalformedURLException e) {
//       e.printStackTrace();
//     } catch (FileNotFoundException e) {
//       e.printStackTrace();
//     } catch (IOException e) {
//       e.printStackTrace();
//     }
// 
//   }
// 
//   private void initGUI() {
//     Container frame = getContentPane();
//     GridBagLayout gridbag = new GridBagLayout();
//     GridBagConstraints c = new GridBagConstraints();
//     frame.setLayout(gridbag);
//     c.anchor = GridBagConstraints.CENTER;
//     c.fill = GridBagConstraints.BOTH;
//     c.insets = new Insets(5, 5, 5, 5);
//     c.weightx = 1.0;
//     c.weighty = 1.0;
//     text = new JTextArea("The quck brwn dog jmped over the fnce.");
//     text.setLineWrap(true);
//     text.setWrapStyleWord(true);
//     addToFrame(frame, text, gridbag, c, 0, 0, 1, 1);
// 
//     GridBagConstraints spellcon = new GridBagConstraints();
//     spellcon.anchor = GridBagConstraints.NORTH;
//     spellcon.insets = new Insets(5, 5, 5, 5);
// 
//     spell = new JButton("spell check");
//     final JTextComponentSpellChecker sc = new JTextComponentSpellChecker(dictionary);
//     spell.addActionListener(new ActionListener() {
//       public void actionPerformed(ActionEvent arg0) {
//         Thread t = new Thread() {
//           public void run() {
//             try {
//               sc.spellCheck(text);
//             } catch (Exception ex) {
//               ex.printStackTrace();
// 
//             }
//           }
//         };
//         t.start();
//       }
//     });
//     addToFrame(frame, spell, gridbag, spellcon, 1, 0, 1, 1);
//   }
// 
//   // Helps build gridbaglayout.
//   private void addToFrame(Container f, Component c, GridBagLayout gbl, GridBagConstraints gbc, int x, int y, int w, int h) {
//     gbc.gridx = x;
//     gbc.gridy = y;
//     gbc.gridwidth = w;
//     gbc.gridheight = h;
//     gbl.setConstraints(c, gbc);
//     f.add(c);
//   }
// }


import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import com.swabunga.spell.swing.JSpellApplet;
import javax.swing.*;
/*
Jazzy - a Java library for Spell Checking
Copyright (C) 2001 Mindaugas Idzelis
Full text of license can be found in LICENSE.txt

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
*/
package com.swabunga.spell.examples;



/** This class shows an example of how to use the spell checking capability
 *  for a text area on a swing form.
 *
 * @author Jason Height (jheight@chariot.net.au)
 */
public class SwingFormExample extends JFrame {

  public SwingFormExample() {
    setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
    addWindowListener(new WindowAdapter() {
      public void windowClosed(WindowEvent e) {
        System.exit(0);
      }
    });

// Path: src/com/swabunga/spell/swing/JSpellApplet.java
// public class JSpellApplet extends JApplet {
// 
//   private static final String dictionaryFile = "dict/english.0.zip";
//   private SpellDictionary dictionary;
//   JTextArea text = null;
//   JButton spell = null;
// 
//   /**
//    * @see java.awt.Component#paint(Graphics)
//    */
//   public void paint(Graphics arg0) {
//     super.paint(arg0);
// 
//   }
// 
//   /**
//    * @see java.applet.Applet#init()
//    */
//   public void init() {
//     super.init();
// 
//     try {
//       URL resource = null;
//       ZipInputStream zip = null;
//       try {
//         resource = new URL(getCodeBase().toExternalForm() + dictionaryFile);
//         zip = new ZipInputStream(resource.openStream());
//         /* getCodeBase() throws a NullPointerException when run
//          * outside the context of a browser
//          */
//       } catch (NullPointerException e) {
//         FileInputStream fin = new FileInputStream(dictionaryFile);
//         zip = new ZipInputStream(fin);
//       }
//       zip.getNextEntry();
//       dictionary = new SpellDictionaryHashMap(new BufferedReader(new InputStreamReader(zip)));
// 
//       initGUI();
//     } catch (MalformedURLException e) {
//       e.printStackTrace();
//     } catch (FileNotFoundException e) {
//       e.printStackTrace();
//     } catch (IOException e) {
//       e.printStackTrace();
//     }
// 
//   }
// 
//   private void initGUI() {
//     Container frame = getContentPane();
//     GridBagLayout gridbag = new GridBagLayout();
//     GridBagConstraints c = new GridBagConstraints();
//     frame.setLayout(gridbag);
//     c.anchor = GridBagConstraints.CENTER;
//     c.fill = GridBagConstraints.BOTH;
//     c.insets = new Insets(5, 5, 5, 5);
//     c.weightx = 1.0;
//     c.weighty = 1.0;
//     text = new JTextArea("The quck brwn dog jmped over the fnce.");
//     text.setLineWrap(true);
//     text.setWrapStyleWord(true);
//     addToFrame(frame, text, gridbag, c, 0, 0, 1, 1);
// 
//     GridBagConstraints spellcon = new GridBagConstraints();
//     spellcon.anchor = GridBagConstraints.NORTH;
//     spellcon.insets = new Insets(5, 5, 5, 5);
// 
//     spell = new JButton("spell check");
//     final JTextComponentSpellChecker sc = new JTextComponentSpellChecker(dictionary);
//     spell.addActionListener(new ActionListener() {
//       public void actionPerformed(ActionEvent arg0) {
//         Thread t = new Thread() {
//           public void run() {
//             try {
//               sc.spellCheck(text);
//             } catch (Exception ex) {
//               ex.printStackTrace();
// 
//             }
//           }
//         };
//         t.start();
//       }
//     });
//     addToFrame(frame, spell, gridbag, spellcon, 1, 0, 1, 1);
//   }
// 
//   // Helps build gridbaglayout.
//   private void addToFrame(Container f, Component c, GridBagLayout gbl, GridBagConstraints gbc, int x, int y, int w, int h) {
//     gbc.gridx = x;
//     gbc.gridy = y;
//     gbc.gridwidth = w;
//     gbc.gridheight = h;
//     gbl.setConstraints(c, gbc);
//     f.add(c);
//   }
// }


// Path: src/com/swabunga/spell/examples/SwingFormExample.java
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import com.swabunga.spell.swing.JSpellApplet;
import javax.swing.*;

/*
Jazzy - a Java library for Spell Checking
Copyright (C) 2001 Mindaugas Idzelis
Full text of license can be found in LICENSE.txt

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
*/
package com.swabunga.spell.examples;



/** This class shows an example of how to use the spell checking capability
 *  for a text area on a swing form.
 *
 * @author Jason Height (jheight@chariot.net.au)
 */
public class SwingFormExample extends JFrame {

  public SwingFormExample() {
    setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
    addWindowListener(new WindowAdapter() {
      public void windowClosed(WindowEvent e) {
        System.exit(0);
      }
    });

    JSpellApplet spellapplet = new JSpellApplet();