Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Tools / January 2005

Tip: Looking for answers? Try searching our database.

Entering Input using NetBeans

Thread view: 
DaLoverhino - 12 Jan 2005 06:23 GMT
Hello there.  I am trying to learn Java on Windows.  I've
been developing C/C++ code on Unix.  I figure netbeans
would shield me from most of Unix-to-Windows growing pains.

Anyways, I am trying to do something as simple as get input
from the user:  System.in.read();

When running this program, this seems to make the program hang.
I figure it's because the program is waiting for user input.
How do I give that user input within the NetBeans development
environment?

I've tried to venture out into the DOS world to run the program,
but I am running into environmental issues like NoClassDefFound.

I can't find the DOS equivalent of the following:

which java (or whatever command)
env
setenv JAVA_HOME blah

Anyways, thanks for your time.
Jorge Cecílio - 12 Jan 2005 09:17 GMT
Try:
System.out.println(String);    or
System.out.print(String);
(The String concatenation operator is "+")

To set DOS environment:
set var=value      or
set var=%var%;value

To view DOS environment values:
echo %var%

If you're starting to learn JAVA, I suggest you take a look at
(excellent!) Sun's tutorial:
http://java.sun.com/docs/books/tutorial/reallybigindex.html
(you may want to start from the beginning:
http://java.sun.com/docs/books/tutorial/reallybigindex.html#getStarted)
Hope this helps,
JC
Jorge Cecílio - 12 Jan 2005 09:24 GMT
Sorry, I gave you wrong commands: those
System.out.println(String);    or
System.out.print(String);
are to print out!

To input data, perhaps you should take a look at a GUI's library such
as Swing (See Sun's tutorial)

JC


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.