tags:

views:

86

answers:

2

I would like to create extend a Java Swing application to have a look somewhat similar to an IDE such as Eclipse or Visual Studio. That’s, there would be a panel at the left that displays a tree, and a tab panel on the right that allows several elements of the tree to be opened and edited on right. For this I could easily use a BorderLayout and just use the center and left areas.

However, I would also like to have the ability for the user to drag the border between these two panels, just like Eclipse and Visual Studio allow. I can think of several ways to do this, but was curious if anyone had found a particularly good way to do this, or knew of an example. I’ve googled for it, but have not found anything.

+3  A: 

You could use JSplitPane. And maybe have a look at an article about a MultiSplitPane.

Jonas
Thanks! Not sure how I missed JSplitPane. Looks like it will do just what I need.
JeffHeaton
+2  A: 

While JSplitPane does exactly what you asked for, you might also be interested in JToolBar, which does other Eclipse-like things such as attach/detach and drag a panel of tools around the UI.

DJClayworth