Results 1 to 9 of 9
  1. #1
    ezee is offline Member
    Join Date
    Mar 2009
    Posts
    14
    Rep Power
    0

    Default getche() in java

    we have a function getche() in 'c'. Do we have any similar purpose function in java also?

    Thank You....

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    25

    Default

    Don't know. For those of us who haven't used C in ages, what does getche() do?

  3. #3
    tomiu is offline Member
    Join Date
    Dec 2008
    Posts
    32
    Rep Power
    0

    Default

    one way is to use JCurses...maybe there are other alternatives too

  4. #4
    ezee is offline Member
    Join Date
    Mar 2009
    Posts
    14
    Rep Power
    0

    Default

    The function getche() use for input stream function for reading 'single'

    ex char ch = getche();
    switch(ch)
    {
    case 1: ....
    ....
    }
    here this function will wait for a single. As we press any button it will jump to next instruction i.e, switch statement ( without pressing enter).

  5. #5
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    25

    Default

    Ah, I see. Thanks for the clarification. As far as I know, there is no similar method in standard Java, that if you want this functionality in the console, you have to use outside libraries (perhaps JCurses as noted above) or create a GUI.

  6. #6
    ezee is offline Member
    Join Date
    Mar 2009
    Posts
    14
    Rep Power
    0

    Default

    1) How can i use 'JCurses'. please give its syntax...

    2) I am a CS student and i am learning java from "java 2 The Complete Reference". Which is the best book or tutorial on web for learning GUI

  7. #7
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    25

    Default

    Quote Originally Posted by ezee View Post
    1) How can i use 'JCurses'. please give its syntax...
    JCurses AFAIK is not part of core Java and to learn its syntax and download its code, you'd have to go to its site. Google can help you here.

    2) I am a CS student and i am learning java from "java 2 The Complete Reference". Which is the best book or tutorial on web for learning GUI
    The Sun Swing tutorials are where most of us learned GUI programming. You can find it here: Lesson: Using Swing Components (The Java™ Tutorials > Creating a GUI with JFC/Swing)

  8. #8
    ezee is offline Member
    Join Date
    Mar 2009
    Posts
    14
    Rep Power
    0

    Default What is the difference b/w Applet & JApplet?

    I found these two file types during opening menu of new file in Netbeans.

    Thank You...

  9. #9
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    25

    Default

    Applet and JApplet are both ways to allow you to embed a GUI in an HTML page. Applet uses the older AWT libraries while JApplets use the newer, more powerful and robust Swing libraries. If you are planning to program Java GUIs, I recommend that you go with Swing.

Posting Permissions

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