JTree usage/archetecture

From: don (dexter_at_uwm.edu)
Date: 10/19/04


Date: 19 Oct 2004 10:40:09 -0700

Hello,

no doubt this problem has been solved multiple times, so it's likely
that for a kind expenditure of a few minutes of your time you could
save me oodles (technical term) of my time spent following the wrong
path(s)...

i'm looking to create a JSplitpane w/ a JTree on the left and a
custom, node-dependant editor on the right. user selects a node,
right pane gets filled with that node's editor...often a JComboBox,
perhaps something more extravagant.

i guess i'm looking for a clear answer as to what classes/interfaces i
need concern myself with (JTree, TreeModel, DefaultMutableTreeNode,
TreeCellEditor??) and what events/listeners are appropriate.

from the extensive amount of swing-provided tree-based archetecture,
i'm guessing there's a definite "right" way of doing this. i can
think of what is probably a "wrong" way by subclassing
DefaultMutableTreeNode to be something like TreeNodeWithEditor,
listining for selection events on the tree side, obtaining the editor
from the (re-cast) treenode, displaying it on the right side,
listining for a custom event on the editor then refressing the tree.

thoughts? good pointers to documented solutions? (i've read the "how
to use trees")

thanks muchly,

-don.



Relevant Pages

  • Re: [PHP] php image and javascript include
    ... in a text editor, not a GUI, I just guess I prefer Kate. ... replaces tabs with spaces more often than not. ... Thats not what I was talking abount either,The tree view of project files ... Tree view of a project, ...
    (php.general)
  • Re: [PHP] php image and javascript include
    ... in a text editor, not a GUI, I just guess I prefer Kate. ... replaces tabs with spaces more often than not. ... Thats not what I was talking abount either,The tree view of project files ... Tree view of a project, ...
    (php.general)
  • Re: JTree usage/archetecture
    ... node-dependant editor on the right. ... > need concern myself with (JTree, TreeModel, DefaultMutableTreeNode, ... > listining for a custom event on the editor then refressing the tree. ... I have been working on an XML ...
    (comp.lang.java.gui)
  • Re: VCL component I wish someone wrote
    ... A specialized control, a hybrid of a treeview and text ... editor, specifically for editing outlines. ... It does much more than edit outlines, ... It really is a cross between a tree and a memo. ...
    (borland.public.delphi.thirdpartytools.general)