Very Simple Java Input

Discussion in 'Java' started by stalepretzel, Apr 6, 2007.

  1. stalepretzel

    stalepretzel New Member

    Joined:
    Dec 13, 2006
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    Student
    Location:
    USA
    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
     
  2. evileye

    evileye New Member

    Joined:
    Jan 7, 2007
    Messages:
    51
    Likes Received:
    0
    Trophy Points:
    0
    Google some info on DIS - Data Input Streams.

    They are one way to accept input in Java proggs.
     
  3. prasundev

    prasundev New Member

    Joined:
    May 29, 2007
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    PROJECT LEADER
    Location:
    New Delhi

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

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice