Action Performed

Posted on 2003-03-26
Medium Priority
Last Modified: 2010-03-31

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)) {

Question by:sewalsh
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
LVL 86

Accepted Solution

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

LVL 86

Expert Comment

ID: 8214090

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

LVL 92

Expert Comment

ID: 8214191
myButton.addActionListener(new ActionListener() {
  public void actionPerformed(ActionEvent e) {


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