Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Multiple select list box

0 views
Skip to first unread message

rog...@bareviking.com

unread,
Mar 26, 1999, 3:00:00 AM3/26/99
to
Hi.

I am trying to create a Multiple-select list box in my Java app that works
"windows-style". Basically, I want to only allow users to select multiple
items when they have the CTRL key pressed. So, if they click on a list item
and the CTRL key is held down, that list item is selected, along with
whatever other items that were selected. If the user didn't hold down CTRL,
then that item is selected and the others are deselected.

The problem that I have using the java.awt.List is that LIST_SELECT and
LIST_DESELECT events don't pass in the modifier keys. I know that
MOUSE_DOWN's do, but I can't seem to catch the MOUSE_DOWN's that occur (they
are LIST_SELECTs) before I get to my List subclass.

Anyone have any idea on how this can be done?

Thanks,

Roger Ly

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own

Marc van der Linde

unread,
Mar 30, 1999, 3:00:00 AM3/30/99
to r...@homestead.com
Hello,

use Event.controldown

Marc

rog...@bareviking.com

unread,
Mar 30, 1999, 3:00:00 AM3/30/99
to
Not quite sure what you mean. Do you mean use the Event.CTRLMASK? Because
when I catch the LIST_SELECT events, the modifiers aren't passed in at all.
The CTRLMASK will show that the Control key wasn't pressed, even if it was.

It seems like the only way to do this is to recreate the entire list class,
but that seems like a waste, and will probably require a bit of hacking.

I do have a question about VJ++ 6. I am trying to debug my app and can't
seem to get into the Java src files while debugging. I can only go as high
up as my own classes. Does anyone know how to set it up so that I can step
through the awt classes, etc?

Thanks,
Roger

In article <36FFFCD7...@rulsfb.leidenuniv.nl>,

0 new messages