Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Action Performed

Posted on 2003-03-26
3
Medium Priority
?
203 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
  • 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Suggested Courses
Course of the Month14 days, 18 hours left to enroll

578 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