java - How can I make the button move from the first JTabbedPanel to the next one? -


i created window panel displays 6 tab panels, , made next , previous buttons move tab tab. problem able make go first tab last tab. buttons skip other tabs , can't seem find way make go through each tab. did:

next = new jbutton("next");     next.addactionlistener(             new actionlistener()             {                 @override                 public void actionperformed(actionevent e)                 {                     for(int = 0; <= tabs.getselectedindex(); i++)                     tabs.setselectedindex(i);                  }              });      previous = new jbutton("previous");     previous.addactionlistener(             new actionlistener()             {                 @override                 public void actionperformed(actionevent e)                 {                     for(int = 0; >= tabs.getselectedindex(); i++)                     tabs.setselectedindex(i);                  }             }); 

i'm still going try figure out.

as want move next/previous can call
tabbedpane.setselectedindex(tabbedpane.getselectedindex()+1) next , -1 previous. nedd check there previous or next tab too.


Comments

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -