Article View: borland.public.jbuilder.java.swing
Article #10998Re: Any way to veto JList list selection?
From: Michael Sashnikov
Date: Mon, 26 Jul 1999 00:00
Date: Mon, 26 Jul 1999 00:00
51 lines
1927 bytes
1927 bytes
Of course, your listener (ListSelectionListener) can listen to the selection and come back it if you selecta wrong item. However if you write your own selection model it will be a more beautiful solution. In fact, it is not complex thing to extend your class from DefaultListSelectionModel and override the addSelectionInterval() method. Regards, Michael ________________________________________ Michael Sashnikov Architect of 2LKit for VJ++ mail: michael@jstyle.spb.ru http://www.jstyle.spb.ru Lois Neo <slneo@cybergal.com> wrote in message news:7nefk7$snu9@forums.borland.com... >Is there an easier way to achieve the same effect on JList as the >SubfocusChanging event in jbuilder ListControl? >Anyone has done that before, can kindly post some sample codes? >-- >Thanks for any help given > >Lois > >Michael Sashnikov <michael@jstyle.spb.ru> wrote in message >news:7ndrur$s4316@forums.borland.com... >> Hi Lois, >> >> You will have the full control under the selection policy if you write a >> custom selection model and attach it to the JList. >> >> Michael >> >> >> ________________________________________ >> >> Michael Sashnikov >> Architect of 2LKit for VJ++ >> >> mail: michael@jstyle.spb.ru >> http://www.jstyle.spb.ru >> >> >> > > >
Technical Details
Message-ID:
<7ngf34$1dt5@forums.borland.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<7nah6e$pkq1@forums.borland.com> <7ndrur$s4316@forums.borland.com> <7nefk7$snu9@forums.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,fcd29a05347971a5 X-Google-Attributes: gid111d45,public From: "Michael Sashnikov" <michael@jstyle.spb.ru> Subject: Re: Any way to veto JList list selection? Date: 1999/07/26 Message-ID: <7ngf34$1dt5@forums.borland.com> X-Deja-AN: 505224722 References: <7nah6e$pkq1@forums.borland.com> <7ndrur$s4316@forums.borland.com> <7nefk7$snu9@forums.borland.com> X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.0810.800 Organization: Another Netscape Collabra Server User X-MSMail-Priority: Normal Newsgroups: borland.public.jbuilder.java.swing