AppletTalk.com Forum Index AppletTalk.com
Java discussions newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

[Swing] JSplitPanes

 
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java GUI Toolkits
View previous topic :: View next topic  
Author Message
Jan Biel
Guest





PostPosted: Wed Mar 03, 2004 12:42 pm    Post subject: [Swing] JSplitPanes Reply with quote



Hello!

I'd like to implement a GUI with multiple SplitPanes, like this

----------
Quote:
| | |
|--| |
| | |
----------


Now in Swing it's only possible to create a SplitPane that splits the screen
in two halves, not more. I can cascade JSplitpanes, but that doesn't look
the way I'd like because the divider doesn't join [1] the lower bottom of
the JFrame, like it does with uncascaded JSplitPanes.

Is there a way to do this?

Or even better: Is there a way to do it the way Eclipse does? They have
closable subwindows implemented in SWT instead of SplitPanes. Is it possible
to do it in Swing? http://www.jgoodies.com/ can do it somehow [2]. Is there
a native-swing way or to I have to code it myself? It's important to me that
the subwindows behave like SplitPanes (especially in resizing), but are
closable as well.

[1] The problem can be seen at
http://www.jgoodies.com/freeware/metamorphosis/images/frankenui.gif
A solution image is also shown:
http://www.jgoodies.com/freeware/metamorphosis/images/rookieui.gif

[2] http://www.jgoodies.com/freeware/metamorphosis/images/standardui.gif
(The "Outline" window on the right)


Back to top
Edwin Dankert
Guest





PostPosted: Wed Mar 03, 2004 6:47 pm    Post subject: Re: [Swing] JSplitPanes Reply with quote



Hi Jan,

If it is just the borders you want to get rid of, try this:

JSplitPane split = new JSplitPane( JSplitPane.HORIZONTAL_SPLIT, leftPanel,
rightPanel);
split.setBorder( null);

Object ui = split.getUI();
if ( ui instanceof BasicSplitPaneUI) {
((BasicSplitPaneUI)ui).getDivider().setBorder( null);
}

Now create only the borders you really want...

Regards,
Edwin Dankert

Exchanger XML Editor
http://www.exchangerxml.com/


"Jan Biel" wrote in message news:c24k0k$2rov$1 (AT) ariadne (DOT) rz.tu-clausthal.de...
Hello!

I'd like to implement a GUI with multiple SplitPanes, like this

----------
Quote:
| | |
|--| |
| | |
----------


Now in Swing it's only possible to create a SplitPane that splits the screen
in two halves, not more. I can cascade JSplitpanes, but that doesn't look
the way I'd like because the divider doesn't join [1] the lower bottom of
the JFrame, like it does with uncascaded JSplitPanes.

Is there a way to do this?

Or even better: Is there a way to do it the way Eclipse does? They have
closable subwindows implemented in SWT instead of SplitPanes. Is it possible
to do it in Swing? http://www.jgoodies.com/ can do it somehow [2]. Is there
a native-swing way or to I have to code it myself? It's important to me that
the subwindows behave like SplitPanes (especially in resizing), but are
closable as well.

[1] The problem can be seen at
http://www.jgoodies.com/freeware/metamorphosis/images/frankenui.gif
A solution image is also shown:
http://www.jgoodies.com/freeware/metamorphosis/images/rookieui.gif

[2] http://www.jgoodies.com/freeware/metamorphosis/images/standardui.gif
(The "Outline" window on the right)



Back to top
Jan Biel
Guest





PostPosted: Fri Mar 05, 2004 5:46 am    Post subject: Re: [Swing] JSplitPanes Reply with quote



Edwin Dankert wrote:
Quote:
Hi Jan,

If it is just the borders you want to get rid of, try this:

JSplitPane split = new JSplitPane( JSplitPane.HORIZONTAL_SPLIT,
leftPanel, rightPanel);
split.setBorder( null);

Object ui = split.getUI();
if ( ui instanceof BasicSplitPaneUI) {
((BasicSplitPaneUI)ui).getDivider().setBorder( null);
}

Now create only the borders you really want...

Ok, I'll try that, thanks.
Janbiel

Back to top
Karsten Lentzsch
Guest





PostPosted: Fri Mar 05, 2004 10:21 am    Post subject: Re: [Swing] JSplitPanes Reply with quote

Jan Biel wrote:

Quote:
Or even better: Is there a way to do it the way Eclipse does? They have
closable subwindows implemented in SWT instead of SplitPanes. Is it possible
to do it in Swing? http://www.jgoodies.com/ can do it somehow [2].

The JGoodies Looks ship with a BorderlessSplitPane
and a panel that provides the eclipse-like appearance.
See the sources for the accompanying demo.

In addition to the code Edwin posted, my class
tries to remove the split divider's border
everytime the UI refreshes - in #updateUI.

I've just released version 1.2.1 of the Looks:
http://looks.dev.java.net/

Best regards,
Karsten

Back to top
Display posts from previous:   
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java GUI Toolkits All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.