Results 1 to 3 of 3
  1. #1
    jperson is offline Member
    Join Date
    Jan 2010
    Posts
    61
    Rep Power
    0

    Default problem in action

    i make a simple gui using netbeans designer (JFrame and JButton)
    now i want to handle my actions
    i have this methods >>

    Java Code:
       private void jButton1MouseClicked(java.awt.event.MouseEvent evt) {   
                     
                     System.out.println("OK");                  
           
        }                                     
    
        private void formKeyPressed(java.awt.event.KeyEvent evt) {   
               if(evt.getKeyCode() ==KeyEvent.VK_ENTER)
                      // now i want to make the same action of above method
                      // like this  jButton1MouseClicked(....)
    
    
                      
            
        }

  2. #2
    camickr is offline Senior Member
    Join Date
    Jul 2009
    Posts
    1,236
    Rep Power
    7

  3. #3
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,387
    Rep Power
    25

    Default

    Add listeners to the components that you want to respond to your actions.

Similar Threads

  1. decorator.jsp problem building Struts Menu in JSP when Struts action is used
    By dkirvan in forum JavaServer Pages (JSP) and JSTL
    Replies: 3
    Last Post: 04-29-2010, 05:33 AM
  2. JButton action
    By jperson in forum New To Java
    Replies: 3
    Last Post: 03-24-2010, 06:47 PM
  3. Please help on Button action
    By michaelxiao in forum New To Java
    Replies: 4
    Last Post: 04-24-2009, 10:55 PM
  4. action class
    By jayagowri in forum Web Frameworks
    Replies: 1
    Last Post: 05-07-2008, 03:23 PM
  5. jsp:forward action
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 12-24-2007, 10:04 AM

Posting Permissions

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