On the Frameview, I added a method as show below:
public void setSelectedTab (Integer tabIndex) {
tabPanel.setSelectedIndex(tabIndex);
}
The tabPanel in my case is the JTabbedPane instance.
In the SingleFrameApplication, I modified the
startup()
method to display the tab I want.Note: You must set it after a call to
show()
the FrameView
@Override
protected void startup() {
FrameViewImpl frameView = new FrameViewImpl(this);
show(frameView);
//This must be done after the GUI is displayed
frameView.setSelectedTab(0);
}
1 comments :
Thanks...I was having an issue with setSelectedIndex() not working (kept showing the last opened tab) until I found your clue on doing it after showing the frame.
Post a Comment