Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Java Input

Posted on 1998-07-21
1
Medium Priority
?
232 Views
Last Modified: 2010-03-30
Can anyone tell me how to use the TextBox to read in numbers? Also how can I hide Labels until there needed?
TIA Matt Lesko
0
Comment
Question by:MattLesko
1 Comment
 
LVL 1

Accepted Solution

by:
dryang earned 100 total points
ID: 1227496
go take a look at the number handling routines in the JDK package, eg. java.lang.Integer and look at the APIs available

using the Constructor
Integer intNum = new Integer(String number_you_want_to_convert);

or to use the API directly
Integer the_answer = Integer.getInteger(String number_you_want_to_convert);

or
int the_answer = Integer.parseInt(String number_you_want_to_convert);

2)
Label labeltest = new Label("Test");
labeltest.setVisible(false);

set the setVisible() to false to hide it setVisible(true) to show it
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Suggested Courses

824 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