• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 550
  • 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
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
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

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

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