hi i have to take in an input from the user.
i then have to find if the input contains a certain letter, if the letter is found in the string then the letter has to be drawn graphically
anyone have any ideas thanks
Printable View
hi i have to take in an input from the user.
i then have to find if the input contains a certain letter, if the letter is found in the string then the letter has to be drawn graphically
anyone have any ideas thanks
Does your question have anything to do with Applets?
db
yh i have to do this in an applet
Do you have any specific questions about
how to get the the input from the user: a text field?
how to search for a letter; See the String class's methods
Or how to draw the letter: override a JPanel's paintComponent method.
sorry if i may have confused people . I have to take text inputted in a text field, the text then has to be checked if the letter m occurs in the string, if the letter occurs in the string then the m has to be deleted from the string and then the the m has to be drawn graphically in it place
what code do you have? Do you have any specific questions?
The only thing i have done is
String search;
search = e.getActionCommand();
then this is sent to the paint method where the string is displayed
eg
if the string the user inputs is "damp" then the "m" has to be replaced a graphically drawn "m"
If you have any java programming questions please post them.
yeah how can remove the letter m from a string in java
Look at the String class's API doc. It has many methods for working with Strings.
Java Platform SE 6
thank for the help