Results 1 to 8 of 8

Thread: [RESOLVED] showing all the input

  1. #1

    Thread Starter
    Addicted Member dbasenoob's Avatar
    Join Date
    Jan 2009
    Location
    San Pedro Laguna - Philippines
    Posts
    206

    Resolved [RESOLVED] showing all the input

    I dont like this sequence because i should input first the name before showing the next input fields i want to happen is showing all the input fields then i can use the arrow keys to scroll up and down.

    Code:
    System.out.print("Enter Your Name: ");
    name =input.readLine();
    System.out.print("Enter Your Age: ");
    age =input.readLine();
    System.out.print("Your Address: ");
    add = input.readLine();
    This is i want to happen:

    Enter Your Name:________
    Enter Your Age:__________
    Your Address:___________

  2. #2
    Arabic Poster ComputerJy's Avatar
    Join Date
    Nov 2005
    Location
    Happily misplaced
    Posts
    2,513

    Re: showing all the input

    Try this
    Code:
    public static void main(final String[] args)
    {
    	final Scanner input = new Scanner(System.in);
    	System.out.print("Enter Your Name: ");
    	final String name = input.nextLine();
    	System.out.print("Enter Your Age: ");
    	final int age = input.nextInt();
    	System.out.print("Your Address: ");
    	input.nextLine();
    	final String add = input.nextLine();
    	System.out.println("You are \"" + name + "\"\nYou are \"" + age + "\" years old.\nYou live in: " + add);
    }
    "I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
    My Blog

  3. #3

    Thread Starter
    Addicted Member dbasenoob's Avatar
    Join Date
    Jan 2009
    Location
    San Pedro Laguna - Philippines
    Posts
    206

    Re: showing all the input

    thanks! but this is not i want to happen in the program.

    i want to happen is all the input fields will showing at the same time then you can type which you want to input data first. is just like a form.

  4. #4
    Arabic Poster ComputerJy's Avatar
    Join Date
    Nov 2005
    Location
    Happily misplaced
    Posts
    2,513

    Re: showing all the input

    then do a swing form.
    "I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
    My Blog

  5. #5

    Thread Starter
    Addicted Member dbasenoob's Avatar
    Join Date
    Jan 2009
    Location
    San Pedro Laguna - Philippines
    Posts
    206

    Re: showing all the input

    is just like a gui swing but i want to make on a console can you do that?
    what is the code for that?

  6. #6
    Junior Member
    Join Date
    Sep 2008
    Posts
    18

    Re: showing all the input

    Check this guy out:
    http://rghosh.free.fr/text_console.html

    He's written a couple of classes with which you can do exactly what you want.

  7. #7

    Thread Starter
    Addicted Member dbasenoob's Avatar
    Join Date
    Jan 2009
    Location
    San Pedro Laguna - Philippines
    Posts
    206

    Re: showing all the input

    Quote Originally Posted by monotonehell View Post
    Check this guy out:
    http://rghosh.free.fr/text_console.html

    He's written a couple of classes with which you can do exactly what you want.
    the given link is made of gui. but is it possible to make on a console?

  8. #8
    Junior Member
    Join Date
    Sep 2008
    Posts
    18

    Re: showing all the input

    Oh sorry I misread - I thought you wanted to emulate the look and feel of a console on top of a GUI.

    Not sure how to implement that without some kind of fake-gui, like Ncurses.

    Could be a load of work but maybe look at some or all of these:
    http://www.pitman.co.za/projects/charva/
    http://sourceforge.net/projects/javacurses/

    Or if you're really game roll your own.
    http://plindenbaum.blogspot.com/2008...-notebook.html

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width