Solved

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

Posted on 2004-09-10
6
534 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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
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 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 …
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

706 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now