Re: extending BasicListUI
From: Kleopatra (fastegal_at_swingempire.de)
Date: 06/21/04
- Previous message: Thomas Weidenfeller: "Re: How can I fire an event ?"
- In reply to: Abs: "extending BasicListUI"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 21 Jun 2004 13:48:06 +0200
Abs wrote:
>
> Hi!
>
> Has anyone changed the default behaviour of a JList extending
> BasicListUI ? I need to change the selection behaviour of a JList in my
> file browsing app. If I click over an empty zone in my JList, the
> nearest item gets selected. I don't want this. When I click in an empty
> zone in Windows Explorer nothing gets selected. This is the way I want
> my JList to work. Can anyone help me, please ? I mean, I could pick the
> original BasicListUI code from Sun and modify it for my app, but I don't
> know if this is illegal.
>
can't say anthing about illegal or not - but subclassing the
ui-delegates always is a pain, usually involving c&p of lots of private
methods which are changing between versions.
There's another approach: make sure the list is doesn't grow beyond the
area that's filled with items (return false on
getScrollableTracksViewportHeight), make sure the viewport has the same
background color as the list and register a mouselistener with the
viewport that clears the selection on pressed.
Greetings
Jeanette
- Previous message: Thomas Weidenfeller: "Re: How can I fire an event ?"
- In reply to: Abs: "extending BasicListUI"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|