Text Areas and drawString
From: BladeZ (cockjupp_at_hotmail.com)
Date: 02/24/05
- Next message: Andrew: "Compiler: Line 39 { expected"
- Previous message: proGex: "Re: compareTo() problems"
- Next in thread: klynn47_at_comcast.net: "Re: Text Areas and drawString"
- Reply: klynn47_at_comcast.net: "Re: Text Areas and drawString"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 24 Feb 2005 11:24:45 -0500
Ok I have a task to do,
"Write a program that uses drawString to display the number of characters
that the user enters into a text area and updates the count each time a
check box event occurs. If the check box has been selected then the count
should be on the piece of text that has been selected by clicking and
dragging the mouse, otherwise it should be on the whole of the text in the
text area."
I'm pretty new to Java, I've done it at a slow pace since last September.
I have a reference book "Bell and Parr Java for Students" however its
explanation of textArea is not helpful at all.
I'm really stuck on this! This is all i have so far
--------------------------------------
import java.awt.*;
import java.applet.*;
import java.awt.event.*;
public class CharacterCount extends Applet{
public void init() {
TextArea textArea = new TextArea(10, 30);
textArea.setText("place your message here");
add(textArea);
}
}//make a method for adding up selected. getselectedtextend and "start.
As you can see theres not much, I have some notation at thre bottom of how
I think I can sort out the selected text problem.
If anyone can throuw me some pointers or suggestion it'd be a huge help!
Thanks in advance.
- Next message: Andrew: "Compiler: Line 39 { expected"
- Previous message: proGex: "Re: compareTo() problems"
- Next in thread: klynn47_at_comcast.net: "Re: Text Areas and drawString"
- Reply: klynn47_at_comcast.net: "Re: Text Areas and drawString"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]