Solved

programmatically setting radio-button to selected is not firing the actionPerformed event

Posted on 2004-09-10
6
539 Views
Last Modified: 2008-02-26
hello,

as question title suggests i want to programmatically select a radio-button, but i want it also to fire the radio-buttons actionListener event, how do i do this??
0
Comment
Question by:cathalmchale
  • 3
  • 2
6 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 12028531
You'll have to either call actionPerformed directly or post an event with EventQueue.postEvent(...)
0
 

Author Comment

by:cathalmchale
ID: 12028939
ah ok, no problem that works!!

is there a way of doing this:
the main frame has a tabbed pane - so each tab is a panel.  when a tab is clicked then panelMe becomes visible.
can panelMe listen for an event "when i become visible to the user then do something" ??
0
 
LVL 86

Assisted Solution

by:CEHJ
CEHJ earned 25 total points
ID: 12028988
Add a ChangeListener and then do that something if it's the right panel selected:

http://javaalmanac.com/egs/javax.swing/tabbed_TpEvt.html
0
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 
LVL 92

Accepted Solution

by:
objects earned 25 total points
ID: 12031837
button.doClick();
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 12064885
:-)
0
 
LVL 92

Expert Comment

by:objects
ID: 12071463
thanks mate :)
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Java Timer (static) 9 43
netstat -ano | find "8000" and taskkill /f /pid 2984 3 56
web services creation SOAP vs REST 5 38
Configure a Bean in an XML file 4 31
For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…

785 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