Win a copy of OCP Java SE 8 Programmer II Exam Study Guide this week in the OCP forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Split windows in panels  RSS feed

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

Take a look at the attachment. See how beautiful the window is split into several panels?
How do I do that in Java? Do I get beautiful panels like this using JSplitPane?
panels.jpg
[Thumbnail for panels.jpg]
 
Rancher
Posts: 2455
80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could use a JSplitPane, but that deals only with two components. So, to achieve the effect shown, you need to split those components into one or more components themselves. But you don't need per se a JSplitPane, you can set a decent LayoutManager that can handle more then just one other panel. FlowLayout, GridLayout, BorderLayout, et cetera. So do have a look at the Oracle tutorial about LayoutManagers:
layout managers
 
Rancher
Posts: 2887
17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Do I get beautiful panels like this using JSplitPane?



Try it!

If it does what you want, great. If not then you ask a more detailed question stating what you like or don't like about using a split pane.
 
Bartender
Posts: 600
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you should be aware that Eclipse uses a much more complex way of creating split windows than simply using JSplitPanes. This is usually called docking panes.
There are several resources available, such as here or this previous post.

However, this can get rather complex and is not recommended for the beginner.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!