JList, multiple_interval_selection does not work

Hi! Im using the tutorial at URL

http://java.sun.com/docs/books/tutorial/uiswing/components/list.html#selection

The codes compile ok, but the Jlist multiple interval selection just refuses to work. I need to select more than 1 item on my list. Am I missing something here. My Jlist doesnt have a "response to event e" method, is that the prob?

thanks and best rgds

Rick

******************************************************************************

String [] weekdays= {"Mon","Tue","Wed","Thu","Fri","Sat","Sun"};

weekDaysList= new JList (weekdays);

weekDaysList.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);

weekDaysList.setLayoutOrientation(JList.VERTICAL_WRAP);

weekDaysList.setVisibleRowCount(-2);

Font displayFont = new Font("courier new", Font.BOLD, 12);

weekDaysList.setFont(displayFont);

weekDaysList.setPreferredSize(new Dimension(95, 35));

inputPanel.add(weekDaysList, a);

******************************************************************************

[1093 byte] By [program_grunta] at [2007-11-27 0:21:39]
# 1

> I need to select more than 1 item on my list.

How are you doing this? You need to use the control or shift key when making a multiple selection.

If you need further help then you need to create a [url http://homepage1.nifty.com/algafield/sscce.html]Short, Self Contained, Compilable and Executable, Example Program[/url] (SSCCE) that demonstrates the incorrect behaviour, because I can't guess exactly what you are doing based on the information provided.

Don't forget to use the [url http://forum.java.sun.com/help.jspa?sec=formatting]Code Formatting Tags[/url] so the posted code retains its original formatting.

camickra at 2007-7-11 22:15:40 > top of Java-index,Desktop,Core GUI APIs...
# 2

Sorry about that.

I forget to describe the problem.

I was assuming that it could multi select using mouse clicks also. The hold-shift + arrow keys works.

But how can I use mouse clicks to select it? Does it work for double clicks?

Like double click on "tue, sat, sun"

rgds

Rick

program_grunta at 2007-7-11 22:15:40 > top of Java-index,Desktop,Core GUI APIs...
# 3
You use the control or shift key in combination with a mouse click.
camickra at 2007-7-11 22:15:40 > top of Java-index,Desktop,Core GUI APIs...
# 4
.... i feel stupid, lolthanks for your help.Is there a way to use double-clicks? Cos users always wants user friendly HCI things nowadays. I thought it might be good to let them use the mouse only.rgdsRick
program_grunta at 2007-7-11 22:15:40 > top of Java-index,Desktop,Core GUI APIs...
# 5
This should be possible by inheriting the events for the JList, right?
FBLa at 2007-7-11 22:15:40 > top of Java-index,Desktop,Core GUI APIs...