Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Adding a splitpane / divider between coulmns in JTable

Posted on 2004-04-25
5
Medium Priority
?
495 Views
Last Modified: 2008-02-26
Hi!

I would like to add split pane or divider between columns with a single scroll pane for JTable. Is their any way to do this?

0
Comment
Question by:joshidin
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 92

Expert Comment

by:objects
ID: 10915665
not really, but column widths are user adjustable anyways. what is it u r trying to achieve exactly?
0
 

Author Comment

by:joshidin
ID: 10915739
I would like to differentiate between two columns, i want to add some thing like a divider..a thik line deiffrentitation between columns.

Any way to do it.
0
 
LVL 92

Accepted Solution

by:
objects earned 450 total points
ID: 10915761
0
 
LVL 15

Expert Comment

by:Javatm
ID: 10915881
> I would like to add split pane or divider between columns with a single scroll pane for JTable. Is their any way to do this?

Yes basically you need to add the 2 panels on the splitpane and add a JTable w/ a JScrollpane to the splitpane.
Its just basically like :

// Declare the panels . . .
JPanel p1 = new JPanel();
JPanel p1 = new JPanel();

// Declare a JTable . . .
JTabel t1 = new JTable();

//Add the Table w/ a ScrollPane to the Panel . . .
p1.add(new JScrollPane(t1));

// Add the p1 & p2 panels to the SplitPane . . .
JSplitPane s2 = new JSplitPane(JSplitPane.VERTICAL_SPLIT, p1, p2);

// Declare the controls . . .
s2.setMinimumSize(new Dimension(100, 50));
s2.setDividerLocation(260);
s2.setResizeWeight(0.5);
s2.setOneTouchExpandable(true);
s2.setContinuousLayout(true);

Here is a sweet tutorial of JSplitPane :
http://java.sun.com/docs/books/tutorial/uiswing/components/splitpane.html

Hope that helps . . .
Javatm
0
 
LVL 92

Expert Comment

by:objects
ID: 10954610
:)
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
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 learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Suggested Courses

610 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