?
Solved

Action Performed

Posted on 2003-03-26
3
Medium Priority
?
197 Views
Last Modified: 2010-03-31
Hi,

could someone map this code into an actionperformed of a pressing of a button?

myEditingComponent.addKeyListener(new KeyAdapter() {
 public void keyPressed(KeyEvent ke) {
      if ((ke.getKeyCode()==ke.VK_ENTER) && (ke.getModifiers()==ke.CTRL_MASK)) {
     stopCellEditing();
      }
    }
   });




thanks
0
Comment
Question by:sewalsh
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 86

Accepted Solution

by:
CEHJ earned 100 total points
ID: 8214075
myEditingComponent.addActionListener(new ActionAdapter() {
public void actionPerformed(ActionEvent e) {
  // do something
     }
   }
  });

0
 
LVL 86

Expert Comment

by:CEHJ
ID: 8214090
Sorry:

myEditingComponent.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
 // do something
    }
  }
 });

0
 
LVL 92

Expert Comment

by:objects
ID: 8214191
myButton.addActionListener(new ActionListener() {
  public void actionPerformed(ActionEvent e) {
    stopCellEditting();
   }});

0

Featured Post

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month11 days, 9 hours left to enroll

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question