Get the tools you need to learn Java skills fast!
Video tutorials, eBooks, hands-on lab exercises, sample code.
Get started
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 The Software Craftsman this week in the Agile 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.
Have you tried LearnNowOnline?
subject: JSplitPane/JScrollPane/JList alignment