This week's giveaways are in the MongoDB and Jobs Discussion forums.
We're giving away four copies of Mongo DB Applied Patterns and 4 resume reviews from Five Year Itch and have the authors/reps on-line!
See this thread and this one for details.
The moose likes Swing / AWT / SWT and the fly likes How to create a horizontal JList? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of Mongo DB Applied Patterns this week in the MongoDB forum
or a resume review from Five Year Itch in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Reply Bookmark "How to create a horizontal JList?" Watch "How to create a horizontal JList?" New topic
Author

How to create a horizontal JList?

Qusay Jaafar
Ranch Hand

Joined: May 06, 2002
Posts: 127
I need JList into a GUI but I need to scroll its elements horizontally not vertically.
just consider its element (right now) as one object.


Qusay
Craig Wood
Ranch Hand

Joined: Jan 14, 2004
Posts: 1535
Check out the information for the setLayoutOrientation method in the Method Details section of the JList api.
Qusay Jaafar
Ranch Hand

Joined: May 06, 2002
Posts: 127
thanks for that.
my second question is:
consider these information:

first name
last name
address
email
phone

I want all those information to be in one element. when the user scroll to another element there will be another information for another person.
How can achieve that?
Qusay Jaafar
Ranch Hand

Joined: May 06, 2002
Posts: 127
any idea please?
Kriti Garg
Ranch Hand

Joined: Sep 13, 2004
Posts: 50
Hi,

I think OOPS will help u out of this problem

Make a class like Employee or Person

with variable like Name,phone etc what u need.

in your JList add this Object and in
the Class toString() method return Name+Phone+...; etc

Use Default List model if necessary.

addElemet takes Object as argument .


BBye
Kriti.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: How to create a horizontal JList?
 
Similar Threads
JList selection method
Loading/Saving a Listbox
Vector or ArrayList use for dropdown with more than 1000 entries
JList Autosearch with Custom Renderer
Count items in JList