Solved

How to draw lines in GUI, somethign like border line

Posted on 2007-11-27
5
1,404 Views
Last Modified: 2012-05-05
Hi Experts,

I am trying to divide my GUI  window into 3 categories, I was thinking of separating each part by some line.
do you have any suggestion about how to draw a line in GUI?

Thank You
0
Comment
Question by:eternity5219
  • 3
5 Comments
 
LVL 26

Expert Comment

by:ksivananth
ID: 20357156
I would suggest to go with JSplitPane or JSeparator than drawing lines...
0
 
LVL 26

Expert Comment

by:ksivananth
ID: 20357174
see the example below using JSeparator,

http://www.onjava.com/pub/a/onjava/excerpt/swing_14/index6.html?page=2 - look for section "Using a Separator Outside of a Menu"
0
 
LVL 13

Accepted Solution

by:
Bart Cremers earned 500 total points
ID: 20357182
If you want to divide a GUI you should compose you GUI using three separate JPanels. You then can simply set a Border on the different Panels

JPanel panelOne = new JPanel();
panel.setBorder(BorderFactory.createTitledBorder("Panel One"));
// ... add components to panelOne

// ... panel two, three, ...

There are several types of borders present.

Note that using borders is only viable if you don't need to "slide" parts of the gui out of the way. You should use a splitpane for that.

 
0
 
LVL 92

Expert Comment

by:objects
ID: 20357187
0
 
LVL 26

Expert Comment

by:ksivananth
ID: 20357191
>>Note that using borders is only viable if you don't need to "slide" parts of the gui out of the way
>>

JSeparator is there!
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
allStar challenge 1 43
What is JNDI datasource in spring 1 38
create a gui in perl 3 46
mockito example issue 8 38
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now