Results 1 to 3 of 3
Thread: spell check
- 12-05-2007, 11:31 PM #1
Member
- Join Date
- Oct 2007
- Posts
- 10
- Rep Power
- 0
- 12-06-2007, 01:21 AM #2
Java Code:// <applet code="SpellCheck" width="300" height="200"></applet> // use: >appletviewer SpellCheck.java import java.awt.*; import java.awt.event.*; import javax.swing.*;; public class SpellCheck extends JApplet implements ActionListener { JTextField textField; String[] words = new String[10]; public void init() { // read file and store the 10 "words" in the words array. textField = new JTextField(16); textField.addActionListener(this); JPanel first = new JPanel(); first.add(textField); JButton button = new JButton("check"); button.addActionListener(this); JPanel last = new JPanel(); last.add(button); getContentPane().add(first, BorderLayout.PAGE_START); getContentPane().add(last, BorderLayout.PAGE_END); } public void actionPerformed(ActionEvent e) { String text = textField.getText(); System.out.println("text = " + text); checkSpelling(text); } private void checkSpelling(String s) { // Run through the words array and test the // variable "s" against each word in the list // that begins with the same first letter as // "s" has. Print the results of your test. } }
- 12-20-2007, 11:37 AM #3
Member
- Join Date
- Oct 2007
- Posts
- 10
- Rep Power
- 0
thank you sooooo much
but I can't understand the following lines, can anyone plz explain it?
private void checkSpelling(String s) {
// Run through the words array and test the
// variable "s" against each word in the list
// that begins with the same first letter as
// "s" has. Print the results of your test.
}
Similar Threads
-
How to check whether file is exists or not
By Java Tip in forum java.ioReplies: 0Last Post: 04-05-2008, 10:13 AM -
CRC check program 1 error
By javakid9000 in forum New To JavaReplies: 1Last Post: 03-19-2008, 05:04 AM -
Check if a web page exists or not
By Java Tip in forum Java TipReplies: 0Last Post: 03-02-2008, 07:24 PM -
Can someone check my code
By joz_12345 in forum Java 2DReplies: 7Last Post: 02-18-2008, 02:58 AM -
Spell check feature
By ravian in forum Advanced JavaReplies: 2Last Post: 12-27-2007, 09:28 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks