Re: extending BasicListUI

From: Kleopatra (fastegal_at_swingempire.de)
Date: 06/21/04

  • Next message: Thomas Weidenfeller: "comp.lang.java.gui FAQ"
    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


  • Next message: Thomas Weidenfeller: "comp.lang.java.gui FAQ"

    Relevant Pages

    • extending BasicListUI
      ... I need to change the selection behaviour of a JList in my ... file browsing app. ... original BasicListUI code from Sun and modify it for my app, ...
      (comp.lang.java.gui)
    • Re: Max 7 viewports
      ... Click on a viewport and make it the only one showing ... The default hotkey is Alt+W. ... If this happens, you might try locking your selection, ... (shortcut for Create> Cameras> Create Camera from View). ...
      (comp.graphics.packages.3dstudio)

    Loading