I have created a JList was built with a vector of strings and then loaded into a JScrollPane. The scrollbars for the JScrollPane have both been set up as always. Some of the text in the JList is long and does not show in the list. My problem is in the horizontal scrolling. The vertical scrollbar scrolls up and down, however, if the text is too long horizontally, I see several dots to the right but when I click the horizontal scrollbar nothing happens. Any ideas??? I'm stuck. barry
// listOne is the JList and // scrollOne is the JScrollPane // listItems is a Vector of strings listOne = new JList( listItems ); listOne.setCellRenderer(new TextListRenderer (pageItem)); listItems.elementAt( startIndex ), true); listOne.setFixedCellWidth(380); listOne.setSelectionMode ( (ListSelectionModel.SINGLE_SELECTION); listOne.setFont( new Font( "serif", Font.BOLD, 18 ) );
scrollOne = new JScrollPane( listOne, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS );
Bhagya Tangutur
Ranch Hand
Joined: Oct 21, 2002
Posts: 88
posted
0
I guess your calling setFixedCellWidth(xx) method...which restricts the Label Width...try removing it.
Sun Certified Java Programmer
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.