Go4Expert

Go4Expert (http://www.go4expert.com/)
-   Java (http://www.go4expert.com/forums/java/)
-   -   Very Simple Java Input (http://www.go4expert.com/forums/simple-java-input-t3781/)

stalepretzel 6Apr2007 21:28

Very Simple Java Input
 
Hello, I was trying to learn Java a few months ago through the Sun tutorials and Sun.com. However, I stopped trying because I COULD NOT FIND HOW TO DO ANY SIMPLE INPUT. All I could do was make a command promt style program that said "hi, would you like to see my array? I'll show you my array, because you cannot give me any Yes/No input!" Exciting... anyway, would anyone please tell me the simplest input function for Java? Or is there a reason that I couldn't find it? I'd like to start learning Java again! Thank you very much.
~ASauce

evileye 15Apr2007 09:40

Re: Very Simple Java Input
 
Google some info on DIS - Data Input Streams.

They are one way to accept input in Java proggs.

prasundev 15Jun2007 18:06

Re: Very Simple Java Input
 
Quote:

Originally Posted by stalepretzel
Hello, I was trying to learn Java a few months ago through the Sun tutorials and Sun.com. However, I stopped trying because I COULD NOT FIND HOW TO DO ANY SIMPLE INPUT. All I could do was make a command promt style program that said "hi, would you like to see my array? I'll show you my array, because you cannot give me any Yes/No input!" Exciting... anyway, would anyone please tell me the simplest input function for Java? Or is there a reason that I couldn't find it? I'd like to start learning Java again! Thank you very much.
~ASauce


import Javax.swing.* package,
and use the JOptionPane.showInputDialog( String msg)
to accept input. It returns String so type cast to your desired type. :)


All times are GMT +5.5. The time now is 21:00.