?
Solved

Clearing text and message prompts

Posted on 1998-07-16
5
Medium Priority
?
192 Views
Last Modified: 2010-03-30
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
0
Comment
Question by:help_me
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 6

Expert Comment

by:gadio
ID: 1226828
use
TextArea.setText("");
0
 
LVL 5

Accepted Solution

by:
msmolyak earned 150 total points
ID: 1226829
TextComponent.setText("") will clear the text area.

In List you can use removeAll() though I found it to be faster (especially for lists with many items) to create a new, empty list and replace the existing one.

I am not sure I understand the part about the message prompt. Could you elaborate?
0
 

Author Comment

by:help_me
ID: 1226830
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
 
0
 

Author Comment

by:help_me
ID: 1226831
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
 
0
 
LVL 5

Expert Comment

by:msmolyak
ID: 1226832
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.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month8 days, 9 hours left to enroll

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question