Solved

Java Input

Posted on 1998-07-21
1
209 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 50 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

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…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
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 …

808 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