This week's book giveaway is in the General Computing forum. We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line! See this thread for details.
I have a JMenu class (GoofyMenuBar.java) and a JTabbedPane class (LoginTabbedPane.java) that I�m putting into a splitPane (SplitPane.java).
Clicking on the Go button opens a new tab. I need to invoke the same action from the menu but somehow I�m not making the connection between the components.
Regardless of the ugliness, how can I invoke a method on JTabbedPane from the JMenu, and later from the JToolBar. Apparently, simply instantiating the class does not do the trick.
you want item1 of the menu to create/add an info page? (same as clickig the 'Go' button)
if so, follow the changes here, and you should get it to work OK
the main differences are the passing of the LoginTabbedPane reference to the GoofyMenuBar class, and the creation of a separate method to create/add the info page - this can then be called by both the Go button and the menu item
note: lots of 'comment-outs', just to get it to compile - I don't have programix.* stuff, or FormLayout stuff. I put them all in one java file, but you have 2 x main()
you will probably need to handle a second click on the menu item - do you want a second info page created/added etc etc