I have a
JFrame with a
JTable and 2 buttons - Select and Cancel. How can I make it automatically go to a specific tabbed panel after I click Select or Cancel button?
Here's the frame with table:
What I want to do is, after I click the Select or Cancel button, I want to open another
JFrame that is automatically set to a specific panel. Like this.
I want it to automatically open this window in that "End User" Tab.
Parameterize the frame class so that you can tell it what tab you want open by default?
hmm. my description kinda inaccurate. what i want is to call a jFrame with a jTabbedpanel and set a selectedIndex. whats the code for that? markspace
Does the window know ahead of time which tabbed should be selected? In any case, simply call JTabbedPane#setSelectedIndex, maybe have a look at How to Use Tabbed Panes
So, is your problem dealing with the button click? Opening the window? Setting the selected tabbed? Cause, that's like 3 or 4 questions right there. Perhaps you should narrow you problem so it deals with a single question
1) See The Use of Multiple JFrames, Good/Bad Practice? 2) For better help sooner, post a Minimal, Complete, and Verifiable example or Short, Self Contained, Correct Example.