Solved

Java Input

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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
endX challenge 2 49
ArrayLists in ArrayLists/HashMaps? 4 39
Python Assistance 7 31
eclipse compiler vs Installed JREs option 3 38
An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…

707 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now