j
/////////////////////////////////////////
Hello;
I Have a JDesktopPane that opens with a x frame (JInternalFrame)wit
a JMenuBar and 11 JTabbedPanels .produced by x.class.I click the menuItem to produce z.frame using x.class
a new JInternalFrame with 4 tabbedPanels on it again produced by x.class.
Now I click on x.frame and try to again use the menuBar and
x.frame is out of scope the menuItem clicked tries to perform its actionPerformed
using the InternalFrame with 4 tabs instead of the intended 11 tabbed JInternalFrame.

Is there a standard for requesting scope or fireing InternalFrame events or validation of which frame is
enabled?
Thanks
error

Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException: Index: 8, Tab count: 2
tlaa get vu.getResource: tabCount: 11
        at javax.swing.JTabbedPane.checkIndex(JTabbedPane.java:1736)
        at javax.swing.JTabbedPane.setSelectedIndex(JTabbedPane.java:572)
        at view.menus.innerframe.admin.JMenuControlAdmin.controlJMenuItems(JMenuControlAdmin.java:53)
        at view.menus.innerframe.admin.CreateInnerFrameMenuAdmin$16.actionPerformed(CreateInnerFrameMenuAdmin.java:449)
        at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
        at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
        at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
        at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
        at javax.swing.AbstractButton.doClick(AbstractButton.java:357)
        at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1225)
        at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1266)
        at java.awt.Component.processMouseEvent(Component.java:6134)
        at javax.swing.JComponent.processMouseEvent(JComponent.java:3265

Recommended Answers

All 6 Replies

Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException: Index: 8, Tab count: 2
tlaa get vu.getResource: tabCount: 11
at javax.swing.JTabbedPane.checkIndex(JTabbedPane.java:1736)
at javax.swing.JTabbedPane.setSelectedIndex(JTabbedPane.java:572)
at view.menus.innerframe.admin.JMenuControlAdmin.controlJMenuItems(JMenuControlAdmin.java:53)

That says it all. Read the error messages that you get. Don't just throw them to other people.
At that line you are trying to set a too large index. It is like having an array of length 10 and are doing array[12]

Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException: Index: 8, Tab count: 2
tlaa get vu.getResource: tabCount: 11
at javax.swing.JTabbedPane.checkIndex(JTabbedPane.java:1736)
at javax.swing.JTabbedPane.setSelectedIndex(JTabbedPane.java:572)
at view.menus.innerframe.admin.JMenuControlAdmin.controlJMenuItems(JMenuControlAdmin.java:53)

That says it all. Read the error messages that you get. Don't just throw them to other people.
At that line you are trying to set a too large index. It is like having an array of length 10 and are doing array[12]

Thanks, yes I noticed that and that is why I wanted to know how to get the JIntternalframe
with 11 tabs back in scope of it menu because the menu is using the last JInternalframe it created to run an operation.

the menu creates a new internal frame with 4 or so tabs but I need to learn how to grab focus on the origanal tab.

Hello could any of this code bring the JinternalFrame with 11 tabs back into the scope of the menu items actionPerforme()?

.setSelected(true)  setSelectedFrame(JInternalFrame f)

thanks. I am not at my computer to try it but any additional key words to google would be great

Hllo;
How does a JInternalFrame in a JDesktop know when is the focus owner if it is not
selected by the user?
thanks

MusicSys:unsolved:

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.