You are not logged in.

#1 2009-03-08 12:33:16

MrAllan
Member
Registered: 2008-12-08
Posts: 132

Create tabs with Swing?

I'm trying to write a Java GUI editor using Swing. The program should work cross-platform, while still looking like a native application.
The editor should work with tabs where you can see and select which file to edit.
That's where the problem lies: How does one create tabs with Swing?
There obviously is the JTabbedPane, but it creates tabs like these:

2dv0w7b.jpg

What I would like to create are browser-like tabs, like these:

34gr4lx.jpg

Is it possible to create such tabs with Swing?
Is there anything else than a JTabbedPane?


EDIT: Maybe this is something usefull? http://bits.netbeans.org/dev/javadoc/or … mmary.html

EDIT 2: I found a little plugin for Netbeans, that also changes the tabbar to what I'd like to have as tabbar. http://code.google.com/p/macbeans/sourc … s/tab/?r=5 I don't understand the code though....

Last edited by MrAllan (2009-03-08 18:26:58)

Offline

#2 2009-03-08 17:12:36

bavardage
Member
Registered: 2008-02-17
Posts: 160

Re: Create tabs with Swing?

Have you tried setting a native lookAndFeel?

http://www.tutorialized.com/view/tutori … Java/10062

though from what I can remember, the linux 'native' look is fairly lame. Does it have to be swing? Iirc SWT looks more native in many cases.

Offline

#3 2009-03-08 17:18:46

bavardage
Member
Registered: 2008-02-17
Posts: 160

Re: Create tabs with Swing?

http://java.sun.com/docs/books/tutorial … #available <-- this is perhaps a better link.

Offline

#4 2009-03-08 17:50:28

MrAllan
Member
Registered: 2008-12-08
Posts: 132

Re: Create tabs with Swing?

Thanks for your answers!

Yes, I have set the native LaF. Generally, I would like to use Swing, but for the tabbar I'd use SWT, too (if it's possible to mix Swing and SWT).

Offline

Board footer

Powered by FluxBB