davydude
10-22-2008, 12:01 PM
I've just started to learn JAVA, and I recentley had a piece of homework to create an array to find & count a certain letter from a textfield, say for example 'f', and then display the result.
I haven't really had much practice with array's, so i'm a little lost with how to layout this code let alone do this method.
Currently here is my code:
import java.applet.*;
import java.awt.*;
import java.lang.*;
public class VowelCount extends Applet implements ActionListener
{
Label LabelA;
TextField TextFieldA;
public void init();
{
TextFieldA = new TextField(12);
LabelA = new Label ("Enter a sentence or word: ");
add(LabelA);
add(TextFieldA);
TextFieldA.addActionListener(this);
}
public final class Array
{
getChar[] (
Then i just get a little stuck with what to do next :confused:
Guidance would be much appreciated! Thanks very much
I haven't really had much practice with array's, so i'm a little lost with how to layout this code let alone do this method.
Currently here is my code:
import java.applet.*;
import java.awt.*;
import java.lang.*;
public class VowelCount extends Applet implements ActionListener
{
Label LabelA;
TextField TextFieldA;
public void init();
{
TextFieldA = new TextField(12);
LabelA = new Label ("Enter a sentence or word: ");
add(LabelA);
add(TextFieldA);
TextFieldA.addActionListener(this);
}
public final class Array
{
getChar[] (
Then i just get a little stuck with what to do next :confused:
Guidance would be much appreciated! Thanks very much