• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 551
  • Last Modified:

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

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
cathalmchale
Asked:
cathalmchale
  • 3
  • 2
2 Solutions
 
CEHJCommented:
You'll have to either call actionPerformed directly or post an event with EventQueue.postEvent(...)
0
 
cathalmchaleAuthor Commented:
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
 
CEHJCommented:
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
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

 
objectsCommented:
button.doClick();
0
 
CEHJCommented:
:-)
0
 
objectsCommented:
thanks mate :)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now