I'm Having a problem with trying to figure out how to get my program to switch from one tab to another after a specific "Jbutton" is clicked. As displayed Below.
Clif40RD
0
Junior Poster in Training
Recommended Answers
Jump to PostHi Clif40RD!
Pleae post your code, what you have tried, that will help to understand your level..,
Jump to PostAssuming you asre using a JTabbedPane (if not, you should be), you can learn how to respond to a button click here
http://docs.oracle.com/javase/tutorial/uiswing/components/button.html
and how to work with tabbed panes here
Jump to PostYou will probably find it easier to use the next method
public void setSelectedIndex(int index)
where index is 0 for the first tab, 1 for the second etc
Jump to PostYou need to store the Staff object as you search for it. An easier way to do this is with an enhanced for loop which uses Iterators for you, but they are hidden.
Staff displayMe = null; boolean found = false; for (Staff s : staffList) …
All 15 Replies
Clif40RD
0
Junior Poster in Training
Clif40RD
0
Junior Poster in Training
raj.mscking
0
Newbie Poster
Clif40RD
0
Junior Poster in Training
JamesCherrill
4,733
Most Valuable Poster
Team Colleague
Featured Poster
Clif40RD
0
Junior Poster in Training
Clif40RD
0
Junior Poster in Training
JamesCherrill
4,733
Most Valuable Poster
Team Colleague
Featured Poster
Clif40RD
0
Junior Poster in Training
JamesCherrill
4,733
Most Valuable Poster
Team Colleague
Featured Poster
Clif40RD
0
Junior Poster in Training
llaspina
19
Light Poster
Team Colleague
Clif40RD
0
Junior Poster in Training
Clif40RD
0
Junior Poster in Training
llaspina
19
Light Poster
Team Colleague
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.