Re: Creating JTrees using Netbeans
Next message: lilburne: "Re: How do you make decisions that optimize software quality?"
Date: Sat, 14 Aug 2004 15:25:53 -0500
Hi Tony,
I had trouble figuring this one out, too. What you can do is go to the
properties pane for the JTree while in the NetBeans gui editor and then
click on "Code" in the panel above the properties where it says
[Properties Events Code]. There you'll see "Custom Creation Code"
that lets you specify the custom code for creating a new JTree
instance, for example, creating one with an argument in it's
constructor instead of the empty default constructor. There's also a
section where you can specify "Pre-Creation Code" and "Post-Creation
Code" which should come in handy.
Hope that helps,
Christian
tony wrote:
> *Hi
>
> I am trying to create a JTree using netbeans, but I am having
> trouble
> finding out how to add nodes to the tree, and changing the root node
> of the tree. When I add a new JTree to a panel, netbeans creates the
> tree with a no argument constructor. How do I use the IDE to add a
> new
> root to the tree, and add nodes to this tree
>
> Thanks
>
> Tony *
--
chumpboy
------------------------------------------------------------------------
Posted via http://www.codecomments.com
------------------------------------------------------------------------
Next message: lilburne: "Re: How do you make decisions that optimize software quality?"
Relevant Pages
- Creating JTrees using Netbeans
... I am trying to create a JTree using netbeans, ... finding out how to add nodes to the tree, and changing the root node ... of the tree. ... (comp.lang.java.softwaretools) - Re: automatic refreshing of JTree not working
... I'm having a hell of a time trying to get a JTree to automatically refresh to show that a node has been moved from one parent node to another. ... I tried the reloadmethod of the tree model and of course when I do that the entire tree collapses and that isn't what I want method useful). ... And *that* issue is due to how JNDI sends search requests to a server. ... I thought if I go back to simplifying my code to make the JTree update itself then I wouldn't even have to go back to my data source, at least for refreshing the node that had one of its children removed. ... (comp.lang.java.gui) - DOM extension of JTree
... I've created the following extension of a JTree. ... Instead the tree just contains the default "colors, sports, foods" ... The class takes as an input a DOM and should process this DOM into the ... private static DefaultMutableTreeNode makeRootNode ... (comp.lang.java.programmer) - JSplitPane, ScrollPanel, JTree not displaying correctly
... JScrollPane is the only component on the left side of the JSplitPane. ... JTree, and the JSplitPane. ... I never get a vertical scroll even though ... it is obvious the tree is much longer then the viewable window. ... (comp.lang.java.gui) - Re: [SWING] Problem with JTree
... I use a subclass of JTree that overwrites getCellRendererto get full control over the cell renders. ... If i try to display the structure and content of the object using my tree the tree is not displayed correctly. ... My TreeCellRenderer implementations are subclasses of DefaultTreeCellRenderer and overwrite getTreeCellRendererComponent(JTree tree, Object value, boolean sel, boolean expanded, boolean leaf, int row, boolean hasFocus) to determine the current value and call the super method. ... Additionally there's a TreeSelectionListener registered at the JTree that triggers the display of extra information on a separate JPanel. ... (comp.lang.java.programmer) |
|