Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / January 2004

Tip: Looking for answers? Try searching our database.

JTree collapse/selection

Thread view: 
Peter Kirk - 12 Jan 2004 14:19 GMT
Hi there

I have a JTree used for displaying a some hierarchical data in an applet.

If a user has expands a node, selects a leaf under that node, and then
collapses the node, the selection is removed from the leaf and the node is
selected instead. Is it possible to stop this behaviour?

What I want is that the leaf will stay selected (even though it can't be
seen because the branch it resides in is collapsed).

Thanks,
Peter
Andrew Thompson - 12 Jan 2004 20:03 GMT
...
| If a user has expands a node, selects a leaf under that node, and then
| collapses the node, the selection is removed from the leaf and the node is
| selected instead. Is it possible to stop this behaviour?

Changing the default behaviour of a UI
confuses the end user. If you want to confuse
the users of the program, there are much
simpler ways to achieve that.

You could, for example, have the actions
of buttons and menu items randomly selected
from a list once the ActionEvent is detected.

| What I want is that the leaf will stay selected (even though it can't be
| seen because the branch it resides in is collapsed).

Are you the only user of your program?
What do your _users_ want?

--
Andrew Thompson
* http://www.PhySci.org/ PhySci software suite
* http://www.1point1C.org/ 1.1C - Superluminal!
* http://www.AThompson.info/andrew/ personal site
Peter - 12 Jan 2004 20:48 GMT
> ...
> | If a user has expands a node, selects a leaf under that node,
[quoted text clipped - 7 lines]
> the users of the program, there are much
> simpler ways to achieve that.

I am sure, but I don't see it as particularly confusing. It's just different
from the "default". One could argue that the default behaviour is a
inconsistent. Sometimes when you collapse a node it becomes selected,
sometimes not.

> You could, for example, have the actions
> of buttons and menu items randomly selected
> from a list once the ActionEvent is detected.

Hmm. I hadn't thought of that. But good point. How does one generate a
really good random number?

> | What I want is that the leaf will stay selected (even though it
> can't be
> | seen because the branch it resides in is collapsed).
>
> Are you the only user of your program?
> What do your _users_ want?

Well, that *is* what the users want. I just want to give them what they
want, have a good day at work, and go home to the wife and kids.

It is an applet used by a relatively small number of people, who are trained
in its use. It is a small part of a larger system. They want selected items
to remain selected even if the branch they reside in is collapsed.

Thanks,
Peter
Andrew Thompson - 13 Jan 2004 03:29 GMT
..
| > What do your _users_ want?
|
| Well, that *is* what the users want. I just want to give them what they
| want, have a good day at work, and go home to the wife and kids.

Aaah..  Thanks for clarifying.

That being the case, I'll have to hope
someone who _actually knows_ how
to achieve what you want jumps in,
I was just checking you were not going
down a dark alley into a GUI nightmare..

[ ..and say 'hi' to the wife and kids.   ;-) ]

--
Andrew Thompson
* http://www.PhySci.org/ PhySci software suite
* http://www.1point1C.org/ 1.1C - Superluminal!
* http://www.AThompson.info/andrew/ personal site
Jim Sculley - 12 Jan 2004 21:00 GMT
> You could, for example, have the actions
> of buttons and menu items randomly selected
> from a list once the ActionEvent is detected.

I prefer the more subtle approach.  Swap the M and N keys on their
keyboards.

Jim S.

Signature

Remove my extraneous mandibular appendages to reply via e-mail

Andrew Thompson - 13 Jan 2004 07:04 GMT
| > You could, for example, have the actions
| > of buttons and menu items randomly selected
| > from a list once the ActionEvent is detected.
|
| I prefer the more subtle approach.  Swap the M and N keys on their
| keyboards.

Dom't be silly Jin, that wouldm't fool amyome.

Amdrew Thonpsom
* http://www.PhySci.org/ PhySci software suite
* http://www.1point1C.org/ 1.1C - Superluminal!
* http://www.AThompson.info/andrew/ personal site
ak - 13 Jan 2004 08:23 GMT
> I prefer the more subtle approach.  Swap the M and N keys on their
> keyboards.

why not to swap randomly _all_ keys. every action.

____________

http://reader.imagero.com the best java image reader.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.