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

x
?
Solved

Creating a new JComponent with event actionPerformed

Posted on 2006-06-01
4
Medium Priority
?
406 Views
Last Modified: 2008-03-06
Hi,

I would need help on this. I have created a JComponent that has JTextField, JButton and another class for popup. So it is works much like a JComboBox, except the popup is not a JList. I would like to fire actionPerformed event from my own component class like JButton do, so I could catch the event from the class that uses the component.

Regards,
Mika
0
Comment
Question by:JamixOy
  • 2
4 Comments
 
LVL 86

Assisted Solution

by:CEHJ
CEHJ earned 450 total points
ID: 16813827
0
 
LVL 14

Accepted Solution

by:
hoomanv earned 450 total points
ID: 16813894
component.dispatchEvent(new ActionEvent(component, ActionEvent.ACTION_PERFORMED, null));
0
 

Author Comment

by:JamixOy
ID: 16814037
Hi CEHJ and hoomanv,

Both solutions worked fine.

Thank you.

/ mika
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 16814060
:-)
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Don’ts and Dos are two important end products of software testing basics that a tester needs to regard. This article attempts to explain the principles of both.
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses
Course of the Month11 days, 12 hours left to enroll

564 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