Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

JTabbedPane-How to change order or tabs in Wrap_tab_layout

435 views
Skip to first unread message

stacey

unread,
Dec 2, 2008, 11:36:34 AM12/2/08
to
Hello everyone,

I ve made a JtabbedPane with layout Wrap_tab_layout. TO simplify
things lets say i have 10 tabs, 5 are in one row, and the remaining 5
are in the second row. What i d like to do, is when i choose one of
the tabs that are in the second row, i want to flip the two rows
together, so i can get the second row now first (which is the one that
includes the tab i chose) and the first row, second.

You can see this in Netbeans. You have the same effect that i want to
make when creating your gui in the gui section, but this dosesnt stay
when you compile & run it.

Does anyone know how to do this? I appreciate any help.

Thanx in advance,

Stacey

Stefan Rybacki

unread,
Dec 2, 2008, 11:41:47 AM12/2/08
to
stacey schrieb:

I think that is L&F specific, isn't it?
Karsten if you read this, can you shed some light here?

> Thanx in advance,
>

Btw. why is that functionality important to you? One way (and I don't like that
way) would be to remove the tabs from second row and insert it before the first
row, reselecting previously selected tab. (But again I don't quite like that
solution, better let the L&F handle that for you)
> Stacey
>
Stefan

stacey

unread,
Dec 2, 2008, 11:51:05 AM12/2/08
to

This is my thesis, and i was told to do it. :S

Oh, so L&F is charge of this? i didnt know.

Thank you very much for the instant reply.

Stacey

On Dec 2, 6:41 pm, Stefan Rybacki <noem...@noemail.foobar> wrote:

>
> I think that is L&F specific, isn't it?
> Karsten if you read this, can you shed some light here?
>
>

Thomas A. Russ

unread,
Dec 2, 2008, 5:22:14 PM12/2/08
to
stacey <staceyv...@gmail.com> writes:

[Context: Swapping the row with the selected tab to be in front.]

> This is my thesis, and i was told to do it. :S

Too bad. Is it a central part of your thesis or just something
incidental to the program you are writing as part of it?

If this were from someone I was advising, I would be pleased if they
would present arguments for why this was a bad idea. But I realize that
not all supervisors are that reasonable.

I think that this is a bad idea, because it makes what I feel is a
unneeded and indeed unhelpful change in the layout of the window.
Having the tab rows move around means that users can't learn, for
example, that a particular tab is in the middle of the top row. Because
sometimes it's there, and sometimes it's in the bottom row instead. And
that placement may be determined by a choice completely unrelated to the
tab in question.

So it seems this particular design element will reduce the efficiency of
the interface, reduce the benefits of learning to work with the software
and generally move things around on the screen to the annoyance and
possible frustration of users. OK, it's probably not quite that bad,
but I don't see what BENEFIT you get from moving the rows of tabs. And
I see a bunch of disadvantages.

--
Thomas A. Russ, USC/Information Sciences Institute

stacey

unread,
Dec 4, 2008, 4:40:07 AM12/4/08
to
i kind of agree with you, but..
I ll try an talk to him about it again.

Still if someone knows how to do it, i would appreciate it if he gave
me some guidelines.

Thank you again.

Regards,
Stacey


On Dec 3, 12:22 am, t...@sevak.isi.edu (Thomas A. Russ) wrote:

Stefan Rybacki

unread,
Dec 4, 2008, 5:09:59 AM12/4/08
to
stacey schrieb:

> i kind of agree with you, but..
> I ll try an talk to him about it again.
>
> Still if someone knows how to do it, i would appreciate it if he gave
> me some guidelines.

I think the problem is that you might be able to solve this by implementing your
own tabbed pane ui but the problem is that you can't solve it for any other L&F
provided UI.
If you don't mind then try starting to write your own ui for tabbed pane
starting with:

BasicTabbedPaneUI

especially have a look at
getTabBounds


But again I have to agree with Thomas, that this seems to be a ridiculous
requirement from your supervisor.

John B. Matthews

unread,
Dec 4, 2008, 10:29:33 AM12/4/08
to
In article <4937ac7b$1...@news.uni-rostock.de>,
Stefan Rybacki <noe...@noemail.foobar> wrote:

Thomas & Stefan are on target. IIRC, this approach to tabbed panes
appeared in the MS Word 6 preferences window. It was not well-received.
Is it possible that your advisor intends for you to investigate this
aspect of UI programming? If so, you might look at a few existing Look &
Feel implementations to see how they vary:

<http://java.sun.com/docs/books/tutorial/uiswing/lookandfeel/plaf.html>

--
John B. Matthews
trashgod at gmail dot com
http://home.roadrunner.com/~jbmatthews/

stacey

unread,
Dec 5, 2008, 1:48:21 PM12/5/08
to
Thank you all for your help.
No, he told me to find a way to do it cause he didnt like it static. I
wasnt sure how the result would look like, so i agreed to do it and
then decide.
I havent talked to him about it again..I ll probably see him next
week.
I ll look through what you have told me in the next days, and if i
find any problem i ll post again.

Thanx again,

Best regards,

Stacey


On Dec 4, 5:29 pm, "John B. Matthews" <nos...@nospam.com> wrote:
> In article <4937ac7...@news.uni-rostock.de>,

0 new messages