Results 1 to 3 of 3
  1. #1
    l245c4l is offline Member
    Join Date
    Apr 2009
    Posts
    2
    Rep Power
    0

    Default Pressing ENTER when Button is selected doesnt fire buttonActionPerformed...

    The question is above.
    Well it worked untill I defined:
    Java Code:
     InputMap im = loginDialog.getRootPane().getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
    Now when I press ENTER when Exit button is selected it fires:
    Java Code:
      	loginDialog.getRootPane().getActionMap().put("ENTER_PRESSED", new AbstractAction() {
    
    		public void actionPerformed(ActionEvent e)
    		{
    			loginButtonActionPerformed(e);
    			//throw new UnsupportedOperationException("Not supported yet.");
    		}
    		});
    but not anymore:
    Java Code:
     private void exitButtonActionPerformed(java.awt.event.ActionEvent evt)
    So why now it doesnt work anymore?
    Is pressing a button with ENTER not an action anymore after defining ActionMap?:confused:

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

    Default

    This question has been cross-posted and answered in about a gazillion fora. To the OP, please don't do this, or at least post links to the cross-posts.

  3. #3
    l245c4l is offline Member
    Join Date
    Apr 2009
    Posts
    2
    Rep Power
    0

    Default

    This is the one I posted is at coderanch but somehow I cant include links im my post, till I will post 20 posts (strange)

    So please, could you send me the answer?
    Maybe I dont know how to form a question, Igoogled but I just havent found it.

Similar Threads

  1. Fire j2me 2.0 alpha
    By Java Tip in forum Java Software
    Replies: 0
    Last Post: 07-29-2008, 04:24 PM
  2. Replies: 5
    Last Post: 01-17-2008, 09:01 PM
  3. My program doesnt display anything
    By Bojevnik in forum AWT / Swing
    Replies: 2
    Last Post: 10-19-2007, 02:50 PM
  4. Fire j2me 1.2
    By JavaBean in forum Java Software
    Replies: 0
    Last Post: 06-21-2007, 11:46 PM
  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
  •