| Author |
show OptionDialog without JTabbedPane changing tab
|
khuong pham
Greenhorn
Joined: Dec 15, 2005
Posts: 6
|
|
I want to show an optionDialog when an user click on a tab in a JTabbedPane but the JTabbedPane must not show the clicked tab before the user selected the right option in the Dialog. Thx in advance.
|
 |
Craig Wood
Ranch Hand
Joined: Jan 14, 2004
Posts: 1535
|
|
|
|
 |
Ben Zung
Ranch Hand
Joined: Mar 25, 2004
Posts: 109
|
|
1. extend JOptionPane 2. have the component, say comp that contains the tabbed pane implements "ChangeListener" 3. in your "public void stateChanged(ChangeEvent e) " method, instead of use Gook luck. [ March 30, 2006: Message edited by: Ben Zung ]
|
 |
khuong pham
Greenhorn
Joined: Dec 15, 2005
Posts: 6
|
|
|
thx a lot ...The first example works great
|
 |
Paulo Guzman
Greenhorn
Joined: Dec 07, 2010
Posts: 2
|
|
You can extends JTabbedPane to override the setSelectedIndex method and then call super.setSelectedIndex(index); after doing your validation something like:
|
 |
 |
|
|
subject: show OptionDialog without JTabbedPane changing tab
|
|
|