File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes JSplitPane/JScrollPane/JList alignment Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JSplitPane/JScrollPane/JList alignment" Watch "JSplitPane/JScrollPane/JList alignment" New topic

JSplitPane/JScrollPane/JList alignment

Gary Down
Ranch Hand

Joined: Apr 09, 2004
Posts: 46
How do I make the items (all String items) in my JList display in the centre of the panel?

The Jlist is held in a JScrollPane inside a JSplitPane.

Please don't just tell me to read the doco again as I have read it over a few times but still don't understand it. Pointing me to something specific might be of use though.


Craig Wood
Ranch Hand

Joined: Jan 14, 2004
Posts: 1535
Gary Down
Ranch Hand

Joined: Apr 09, 2004
Posts: 46
Thanks Craig,
I had advanced to using a cell renderer

Your way is much smarter and neater.
I agree. Here's the link:
subject: JSplitPane/JScrollPane/JList alignment
It's not a secret anymore!