Results 1 to 4 of 4
  1. #1
    masa is offline Member
    Join Date
    Nov 2008
    Posts
    21
    Rep Power
    0

    Default enter key problem

    hi all
    i have a login screen done in swings and it has username,password,repository and a login button. its working fine when i click the login button and displaying another frame. but my problem is when i insert username and password and press enter button from keyboard its not forwarding to another frame. i mean i want to generate some key event that can handle enter key on my keyboard. how to do that .................

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

    Default

    This post confuses me a bit. Can you clarify a bit more exactly what you are trying to do that's not working? What keyboard strokes are you trying to get, why, where, any and all information would help. Good luck!

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,234
    Rep Power
    19

    Default

    Read the API for JRootPane and look for a method related to the default button.

    db

  4. #4
    Aseem is offline Senior Member
    Join Date
    Mar 2009
    Location
    USA
    Posts
    127
    Rep Power
    0

    Default

    //action event

    public void actionPerformed(ActionEvent e){
    if(e.getSource()==btnEnter)
    new ChildDialog(this); //repalce ChildDialog with the class //you want to open
    }

Similar Threads

  1. enter a string sentence
    By amorosa19 in forum New To Java
    Replies: 13
    Last Post: 09-06-2013, 10:34 AM
  2. Applet - enter URL and view the page
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 03-10-2008, 02:38 PM
  3. Reading Char without needing to press enter
    By x0psci in forum New To Java
    Replies: 0
    Last Post: 11-23-2007, 04:28 PM
  4. enter data from an optic device
    By bbq in forum Advanced Java
    Replies: 2
    Last Post: 07-04-2007, 08:02 AM
  5. Javascript and enter button
    By Eric in forum Advanced Java
    Replies: 1
    Last Post: 06-11-2007, 09:39 PM

Posting Permissions

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