I don't actually use the Layout manager, but nobody more knowledgeable has
answered yet, so....
Keep in mind that the JTabbedPane is the object that contains the various tabs;
you need other containers to be each of the individual tabs. I'd guess that
when you drag something to the JTabbedPane, it gets put directly within it -
that is, it becomes one of the tabs.
I'm guessing what you want to do is drag a JPanel into the JTabbedPane, then
drag the things you want to put into the tab into the JPanel, rather than
directly into the JTabbedPane.
Warren J. Dew
Powderhouse Software
----
Subject: Cw8/Java: How to use JTabbedPane in Layout Manager?
From: Jonathan Fisher <A
HREF="mailto:hq8jk4302@sneakemail.com.nospam">hq8jk4302@sneakemail.com.nos
pam</A>
Date: Mon, Mar 1, 2004 11:47 PM
Message-id: <hq8jk4302-E8991A.23472301032004@news.starband.net>
Hi,
Is there documentation on how to use JTabbedPanes in the Layout Manager?
I looked in the IDE User Guide and "Targetting the Java VM", and there
wasn't any explanation; I didn't see any other documents in "CodeWarrior
Manuals" that seemed appropriate.
Lacking documentation, I tried to figure out how to manipulate
tabbed-panes by guess and by gosh, but I didn't have much luck. I
eventually figured out that (apparently?) I need to select "JTabbedPane"
in the palette and then drag an outline-rectangle to select a
tabbed-pane area, and then select "JTabbedPane" again and single-click
in that area to create an actual tab (curiously labelled
"jTabbedPane2"), and then single-click to the right of the jTabbedPane2
to create more tabs.
But then how do I select which tab is active, ie, will be the container
of what I draw in the area of the tabbed-pane? "Send to back" and
"Bring to front" has no effect on which tab is frontmost, and neither
does clicking on the tabs or selecting one tab or another in the Object
Inspector or in the Object tree on the left side of the frame window.
And how do I actually put things into a tabbed-pane? Whatever I draw
(such as a JButton) in the area of the tabbed-pane (or drag into it)
immediately grows to fill the whole area, and receives a little tab of
its own - although it remains a JButton (or whatever it originally was)
according to Object Inspector.
I am using CW 8.3 under MacOS 10.3.2 on a 40-MHz G4.
TIA for any advice,
Jonathan
Jonathan Fisher - 05 Mar 2004 06:04 GMT
> I don't actually use the Layout manager, but nobody more knowledgeable has
> answered yet, so....
[quoted text clipped - 53 lines]
> TIA for any advice,
> Jonathan
Ah, the light dawns! Thanks much for the clarification. And thanks to
Eric and Miro, and to MW Ron, for helpful answers to my other questions.
BTW, in case anyone else needs to know: the only way I was able to find
to select which tab/JPanel is active is to select the JTabbedPane in the
Object Inspector and type the appropriate value into SelectedIndex.
Cheers,
Jonathan