Link to home
Start Free TrialLog in
Avatar of help_me
help_me

asked on

Clearing text and message prompts

How do you clear text from a textarea and from list box? Please give me the exact method.

Also how do you get a message prompt to display, which shows a message and allows you to click OK

Thanks

Mel
Avatar of gadio
gadio

use
TextArea.setText("");
ASKER CERTIFIED SOLUTION
Avatar of msmolyak
msmolyak

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of help_me

ASKER

Please could you help further with the following:
Is there a method that will clear the text area completely, as I recall setText only
clears the first part of it.
For the message prompt I mean a small message box which will appear when the user clicks on a button. It will contain a message and an OK and Cancel button.

Thanks
Mel
 
Avatar of help_me

ASKER

Please could you help further with the following:
Is there a method that will clear the text area completely, as I recall setText only
clears the first part of it.
For the message prompt I mean a small message box which will appear when the user clicks on a button. It will contain a message and an OK and Cancel button.

Thanks
Mel
 
Mel,

What do you mean by "first part of text area"?

As for the message box, AWT has nothing of the like, you would have to subclass Dialog and create your own notification box, which is not terribly difficult.

Swing, on the other hand, has exactly what you need in the class JOptionPane.