Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.gui > #335

Re: Right Click on JTree

From "Jason Cavett" <jason.cavett@THRWHITE.remove-dii-this>
Subject Re: Right Click on JTree
Message-ID <1165351204.994336.171460@16g2000cwy.googlegroups.com> (permalink)
Newsgroups comp.lang.java.gui
References <1165339655.553432.233500@j72g2000cwa.googlegroups.com>
Date 2011-04-27 15:26 +0000
Organization TDS.net

Show all headers | View raw


  To: comp.lang.java.gui


On Dec 5, 12:27 pm, "Jason Cavett" <jason.cav...@gmail.com> wrote:
> I was wondering about the functionality of mouse events on a JTree.
>
> When I left click on items on a JTree, it behaves like I expect.  The
> paths are selected appropriately, holding Shift or Control works
> appropriately and the tree is always updated to show what has currently
> been selected (the nodes are highlighted).
>
> I would like the right mouse button to behave the same way.  It seems
> that paths are selected correctly, but the tree is not updated to show
> these paths have been selected (AKA, the nodes aren't highlighted).
> Can anybody provide any suggestions of how to do this, or will I have
> to program this functionality in manually?
>
> Thanks

After searching around, I realized that Sun *wants* the functionality
to be this way (even though this is not what happens using the Windows
look and feel).  So, I have to implement it myself.  I basically have
it, but I'm having trouble with tree selection when SHIFT and CONTROL
are held down.  How do I determine everything that is selected?  Or,
should I not worry about SHIFT and CONTROL for right clicking?  Any
advice?

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

Back to comp.lang.java.gui | Previous | NextNext in thread | Find similar


Thread

Re: Right Click on JTree "Jason Cavett" <jason.cavett@THRWHITE.remove-dii-this> - 2011-04-27 15:26 +0000
  Re: Right Click on JTree "Oliver Wong" <oliver.wong@THRWHITE.remove-dii-this> - 2011-04-27 15:26 +0000
    Re: Right Click on JTree "Jason Cavett" <jason.cavett@THRWHITE.remove-dii-this> - 2011-04-27 15:26 +0000

csiph-web