| Author |
need help to set horizontal bar to JList
|
Vaishali Paramane
Ranch Hand
Joined: Mar 05, 2007
Posts: 106
|
|
Hi
I am using JList and I want horizontal scroll bar so I used following code . It shows horizontal bar but not exactly scrollbar. I cann't scroll horizontal.
I used setPrototypeCellValue to fix width of JList . I am unable to see remaining part of the list. That is why I want horizontal scroll bar.
Thanks
Vaishali
|
SCJP, SCJD
Preparing for SCWCD
|
 |
Rob Spoor
Sheriff
Joined: Oct 27, 2005
Posts: 19216
|
|
|
Can you please post an SSCCE?
|
SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
|
 |
Vaishali Paramane
Ranch Hand
Joined: Mar 05, 2007
Posts: 106
|
|
|
Please help me
|
 |
Rob Spoor
Sheriff
Joined: Oct 27, 2005
Posts: 19216
|
|
|
Not without an SSCCE.
|
 |
Vaishali Paramane
Ranch Hand
Joined: Mar 05, 2007
Posts: 106
|
|
Do you want me to post whole code?
|
 |
Rob Camick
Ranch Hand
Joined: Jun 13, 2009
Posts: 1788
|
|
|
|
 |
Rob Spoor
Sheriff
Joined: Oct 27, 2005
Posts: 19216
|
|
From that method's Javadoc info:
Sets the prototypeCellValue property, and then (if the new value is non-null), computes the fixedCellWidth and fixedCellHeight properties by requesting the cell renderer component for the given value (and index 0) from the cell renderer, and using that component's preferred size.
As I understand it, you've given each cell a fixed width that's shorter than the cells should be. By commenting out that line, as Rob C suggested, each cell gets its correct preferred width.
|
 |
 |
|
|
subject: need help to set horizontal bar to JList
|
|
|