Jtree custom nodes

Hi there,
the "How to Use Trees" tutorial shows how to create simple JTrees where each node is a String:
http://java.sun.com/docs/books/tutorial/uiswing/components/tree.html
I need to have tree structure where each node is like a form entry.
For example some like this:
+ name: [ ........... ]
+ surname: [ ........... ]
+ child
---------+ name: [ ........... ]
---------+ surname: [ ........... ]
and so on...
The best way that I can think of to do that is to make each node be a JPanel and add to it a JLabel and a JTextField. If this is really the best way to do that then my JTree needs to have something different than DefaultMutableTreeNode as nodes because they can only be used to display Strings.
So provided there is no better way to do what I want to do, the question is, how do I put a JPanel in a JTree node?

I think the better way is to use a UserObject giving a summary String in its toString method for standard node display, and to display an extra JDialog for editing all the details of the UserObject if the user chooses to edit the node. Imho, displaying complex nodes directly in the tree tends to confuse the user.

Similar Messages

  • How to set up SSO between e-portal employee node & ebill customer node?

    We have a requirement to set up SSO between e-portal employee node & ebill customer node.
    I am told that sso is possible only between 2 employee nodes.
    Please advise.

    Not sure I understand which part is failing.
    Is it the C program calling your packaged function? Or does the error occur in the PL/SQL code, in which case you should be able to pinpoint where it's wrong?
    A few comments :
    1) Using DOM to build XML out of relational data? What for? Use SQL/XML functions.
    2) Giving sample data is usually great, but it's not useful here since we can't run your code. We're missing the base tables.
    3) This is wrong :
    vStrSqlQuery := 'SELECT * FROM ' || vTblName                     || ' WHERE record_update_tms <= TO_DATE(''' || TO_CHAR(vLastPubTms, 'MM/DD/YYYY HH24:MI:SS') || ''', ''MM/DD/YYYY HH24:MI:SS'') ' ;
    A bind variable should be used here for the date.
    4) This is wrong :
    elmt_value := xmldom.createTextNode (doc, l_clob(1));
    createTextNode does not support CLOB so it will fail as soon as the CLOB you're trying to pass exceeds 32k.
    Maybe that's the problem you're referring to?
    5) This is most wrong :
         l_clob(1):=REPLACE(l_clob(1),'&lt;?xml version=&quot;1.0&quot;?&gt;', NULL); 
         l_clob(1):=REPLACE(l_clob(1),'&lt;', '<'); 
         l_clob(1):=REPLACE(l_clob(1),'&gt;', '>'); 
    I understand what you're trying to do but it's not the correct way.
    You're trying to convert a text() node representing XML in escaped form back to XML content.
    The problem is that there are other things to take care of besides just '&lt;' and '&gt;'.
    If you want to insert an XML node into an existing document, treat that as an XML node, not as a string.
    Anyway,
    Anyone that can help me to find out the required magic number
    That would be a bad idea. Fix what needs to be fixed.
    And please clearly state which part is failing : the C program or the PL/SQL code?
    I'd vote for PL/SQL, as pointed out in [4].

  • How to "repaint" a custom node

    Hi everybody.
    I have working with JavaFX for a short time and a problem has come up... I'm developing an application where I dragg and drop elements from one half of the Scene to the other. Each half is represented by a Custom node that shows some thumbnails. When I dragg an element from one side to the other, I managed to insert that element in the sequence belonging to the destiny (Custom node) side.
    What I want is making this change of position visible, Each side of the Scene has a lot of thumbnails and I use a scroll to browse all the elements. When I transfer a thumbnail from one side of the Scene to the other is still the origin custom node scroll which moves the just transferred thumbnail altought it should be managed by the destiny custom node scroll...
    What I would need is a kind of "repaint" method, like the Swing's one...
    Thank's in advanced. Regards.

    Hi Nachy,
      Thanks for your replay,
    Regards,
    Anumaala Kumar

  • What is the recommended way to handle mouse click events for custom nodes that subclass Panes?

    Hi,
    I have created a custom node that is a StackPane containing a Label on top of a Polygon.
    import javafx.scene.control.Label;
    import javafx.scene.layout.StackPane;
    import javafx.scene.paint.Color;
    import javafx.scene.shape.Polygon;
    public class CustomHexagon extends StackPane {
        private Polygon hexagon;
        private Label overlayText;
        public CustomHexagon( String text, double... points ) {
            this.hexagon = new Polygon( points );
            this.overlayText = new Label( text );
            overlayText.setStyle( "-fx-font-weight: bold;" );
            hexagon.setStroke( Color.GREEN );
            hexagon.setStrokeWidth( 5.0 );
            hexagon.setFill( Color.WHITE );
            this.getChildren().addAll( hexagon, overlayText );
    // Lays out the node where it should be according to the points provided for the Polygon.
            this.setLayoutX( points[0] - getLayoutBounds().getMinX() );
            this.setLayoutY( points[1] - getLayoutBounds().getMinY() );
    // Show the border of the StackPane.
            this.setStyle( "-fx-border-color: black; -fx-border-width: 1; -fx-border-style: dashed;");
        public String getOverlayText() {
            return overlayText.getText();
    I want to display a tesselation of these custom hexagons. Because a CustomHexagon is a StackPane, not a Polygon, MouseClick events can be picked up when the mouse is clicked outside of the stroke of the hexagon but still within the StackPane (which takes up a rectangle larger than the hexagon). The following program demonstrates this.
    public class Main extends Application {
        @Override
        public void start(Stage primaryStage) {     
            Group root = new Group();
            CustomHexagon[] hexagons = {
                new CustomHexagon( "00", 10.0, 10.0, 30.0, 10.0, 40.0, 27.3205080756, 30.0, 44.6410161512, 10.0, 44.6410161512, 0.0, 27.3205080756 ),
                new CustomHexagon( "01", 70.0, 10.0, 90.0, 10.0, 100.0, 27.3205080756, 90.0, 44.6410161512, 70.0, 44.6410161512, 60.0, 27.3205080756 ),
                new CustomHexagon( "02", 130.0, 10.0, 150.0, 10.0, 160.0, 27.3205080756, 150.0, 44.6410161512, 130.0, 44.6410161512, 120.0, 27.3205080756 ),
                new CustomHexagon( "03", 190.0, 10.0, 210.0, 10.0, 220.0, 27.3205080756, 210.0, 44.6410161512, 190.0, 44.6410161512, 180.0, 27.3205080756 ),
                new CustomHexagon( "04", 250.0, 10.0, 270.0, 10.0, 280.0, 27.3205080756, 270.0, 44.6410161512, 250.0, 44.6410161512, 240.0, 27.3205080756 ),
                new CustomHexagon( "10", 40.0, 27.3205080756, 60.0, 27.3205080756, 70.0, 44.6410161512, 60.0, 61.961524226799995, 40.0, 61.961524226799995, 30.0, 44.6410161512 ),
                new CustomHexagon( "11", 100.0, 27.3205080756, 120.0, 27.3205080756, 130.0, 44.6410161512, 120.0, 61.961524226799995, 100.0, 61.961524226799995, 90.0, 44.6410161512 ),
                new CustomHexagon( "12", 160.0, 27.3205080756, 180.0, 27.3205080756, 190.0, 44.6410161512, 180.0, 61.961524226799995, 160.0, 61.961524226799995, 150.0, 44.6410161512 ),
                new CustomHexagon( "13", 220.0, 27.3205080756, 240.0, 27.3205080756, 250.0, 44.6410161512, 240.0, 61.961524226799995, 220.0, 61.961524226799995, 210.0, 44.6410161512 ),
                new CustomHexagon( "14", 280.0, 27.3205080756, 300.0, 27.3205080756, 310.0, 44.6410161512, 300.0, 61.961524226799995, 280.0, 61.961524226799995, 270.0, 44.6410161512 ),
                new CustomHexagon( "20", 10.0, 44.6410161512, 30.0, 44.6410161512, 40.0, 61.961524226799995, 30.0, 79.2820323024, 10.0, 79.2820323024, 0.0, 61.961524226799995 ),
                new CustomHexagon( "21", 70.0, 44.6410161512, 90.0, 44.6410161512, 100.0, 61.961524226799995, 90.0, 79.2820323024, 70.0, 79.2820323024, 60.0, 61.961524226799995 ),
                new CustomHexagon( "22", 130.0, 44.6410161512, 150.0, 44.6410161512, 160.0, 61.961524226799995, 150.0, 79.2820323024, 130.0, 79.2820323024, 120.0, 61.961524226799995 ),
                new CustomHexagon( "23", 190.0, 44.6410161512, 210.0, 44.6410161512, 220.0, 61.961524226799995, 210.0, 79.2820323024, 190.0, 79.2820323024, 180.0, 61.961524226799995 ),
                new CustomHexagon( "24", 250.0, 44.6410161512, 270.0, 44.6410161512, 280.0, 61.961524226799995, 270.0, 79.2820323024, 250.0, 79.2820323024, 240.0, 61.961524226799995 ),
                new CustomHexagon( "30", 40.0, 61.961524226799995, 60.0, 61.961524226799995, 70.0, 79.2820323024, 60.0, 96.602540378, 40.0, 96.602540378, 30.0, 79.2820323024 ),
                new CustomHexagon( "31", 100.0, 61.961524226799995, 120.0, 61.961524226799995, 130.0, 79.2820323024, 120.0, 96.602540378, 100.0, 96.602540378, 90.0, 79.2820323024 ),
                new CustomHexagon( "32", 160.0, 61.961524226799995, 180.0, 61.961524226799995, 190.0, 79.2820323024, 180.0, 96.602540378, 160.0, 96.602540378, 150.0, 79.2820323024 ),
                new CustomHexagon( "33", 220.0, 61.961524226799995, 240.0, 61.961524226799995, 250.0, 79.2820323024, 240.0, 96.602540378, 220.0, 96.602540378, 210.0, 79.2820323024 ),
                new CustomHexagon( "34", 280.0, 61.961524226799995, 300.0, 61.961524226799995, 310.0, 79.2820323024, 300.0, 96.602540378, 280.0, 96.602540378, 270.0, 79.2820323024 ),
                new CustomHexagon( "40", 10.0, 79.2820323024, 30.0, 79.2820323024, 40.0, 96.602540378, 30.0, 113.9230484536, 10.0, 113.9230484536, 0.0, 96.602540378 ),
                new CustomHexagon( "41", 70.0, 79.2820323024, 90.0, 79.2820323024, 100.0, 96.602540378, 90.0, 113.9230484536, 70.0, 113.9230484536, 60.0, 96.602540378 ),
                new CustomHexagon( "42", 130.0, 79.2820323024, 150.0, 79.2820323024, 160.0, 96.602540378, 150.0, 113.9230484536, 130.0, 113.9230484536, 120.0, 96.602540378 ),
                new CustomHexagon( "43", 190.0, 79.2820323024, 210.0, 79.2820323024, 220.0, 96.602540378, 210.0, 113.9230484536, 190.0, 113.9230484536, 180.0, 96.602540378 ),
                new CustomHexagon( "44", 250.0, 79.2820323024, 270.0, 79.2820323024, 280.0, 96.602540378, 270.0, 113.9230484536, 250.0, 113.9230484536, 240.0, 96.602540378 )
            EventHandler<MouseEvent> mouseClickedHandler = new EventHandler<MouseEvent>() {
                @Override
                public void handle(MouseEvent t) {
                    CustomHexagon h = (CustomHexagon) t.getSource();
                    System.out.println( h.getOverlayText() );
            for ( CustomHexagon hexagon : hexagons ) {
                hexagon.setOnMouseClicked( mouseClickedHandler );
            root.getChildren().addAll( hexagons );
            Scene scene = new Scene(root, 400, 400);
            primaryStage.setTitle("Example");
            primaryStage.setScene(scene);
            primaryStage.show();
        public static void main(String[] args) {
            launch(args);
    After running this program, when one clicks within the intersection of two StackPanes (borders shown by dashed lines), the target of the mouse click event will be the StackPane on top as determined by the order in which they were added to their parent.
    This is a problem because there is only a small "T" shaped area within each hexagon that when clicked will target that hexagon with an event, rather than adjacent nodes.
    I would appreciate any reccomendations to solve this problem.
    Thanks,
    James Giller

    Hello, this is an evergreen. Just call setPickOnBounds(false) on the CustomHexagon.
    An issue tracking this problem is open here: https://javafx-jira.kenai.com/browse/RT-17024

  • Sorting sequence of custom nodes

    How can one sort a sequence of custom nodes based on an arbitrary value?
    For example:
    Say you create a custom node of a person with their favorite number:
    var myNode : CustomNode = CustomNode{
        var personName: "John Smith"
        var personFavoriteNumber: 15
    //Create a sequence of CustomNode with different names and favorite numbers
    var customNodeSequence : CustomNode[] = .....My question is, how can you sort the sequence based off 'personName' (Alphabetically) or by their favorite number 'personFavoriteNumber' sequentially?
    I was reading [this article|http://blogs.sun.com/michaelheinrichs/entry/creating_javafx_sequences_in_java] and I'm curious to know more about this when he mentions the following:
    sort - Creates a new sequence by sorting the elements of a given sequence. The order can be induced either by the natural order of the elements, if they implement java.util.Comparable, or by providing a java.util.Comparator of the elements.+
    I believe it's related to [this thread|http://forums.sun.com/thread.jspa?threadID=5330227&tstart=31] , but I'm trying to figure out how to actually compare a custom node's variable with that of another. I'm not entirely sure how the comparator illustrated in this thread works.

    Found a solution.
    Here's a reference page: click
    var sortSeq = Sequences.sort(customNodeSequence , Comparator{
            public override function compare(o1 : Object, o2 : Object) : Integer{
                (o1 as CustomNode).personName.toLowerCase().compareTo((o2 as CustomNode).toLowerCase().personName);
    var customNodeSequenceSorted = (sortSeq as CustomNode[]); //sortSeq returns as object[], so you may have to type cast if you explicitly casted the destination sequence somewhere else

  • OnMouseClicked event with overlapping custom nodes

    I'm having a bit of an issue with overlapping nodes.
    Essentially what I have are rectangular shaped custom nodes which, when an onMouseEntered event occurs, has an extended set of icons that fade in that are located on the above top right portion of the node. If I may use ASCII to illustrate :)
    X
    [ MyCustomNode ]
    +(Blank spaces don't work too well so let's pretend the X is sitting on top of the node on the upper left corner)+
    The X is an icon that simply deletes the node.
    The problem occurs when the nodes are overlapping (i.e. one above the other, where the X icon is overlapping with the node above it). When I click on the X, the onMouseClicked event fires for the node above.
    I've tried mucking around with disabling the node and using toFront() and toBack() as well, but no luck.
    Now that I think about it (I'm sure this is related), I've noticed issues with text/labels interfering with the "click-ability" of an object that it is overlapping. Since the text generally occupies little pixels in terms of the width of the actual text, it just seems to only sometimes interfere with onMouseClicked events - if you click on the right spot that is. If you disable the node, do the pixels the text/label occupy become "dead"? as in that space cannot be used to initiate the onMouseClicked event of an object behind the text? Make sense?
    Any ideas?

    I've put up a picture for your reference: [http://imagebin.ca/view/Lj9C7q.html]
    How it works is that each node can be clicked on, thus increasing its opacity to 1.0. Once "selected" there is a mouse enter/exit event for that particular node which allows the X icon to fade in/out to delete the node.
    What's happening is that if you click on the X of the selected node, the node directly above (1432-1481) is being selected, although the deletion of the original node works fine.
    Also the onMouseEnter event is firing for the "1432-1481" node if you hover over the X. As you can tell in the screenshot, the opacity is increased if you hover over an unselected node. You can see that the "1432-1481" is slightly brighter than the other nodes above it. Obviously the cursor is missing from the screenshot but it should make sense.

  • Custom node not appearing in hbox

    I can insert this custom node into an hbox (I scanned the hbox and verified their existence), but the contents of the frame from the fxz file do not show up.
    My objective:
    -I have a series of fxz files (frames) that I wish to put into an hbox
    -Each frame, when clicked on, will animate, when off screen, the animation will be toggled off (i.e. myCustomNode.action.play();)
    -If I simply insert the contents of an fxz file (which I can) I don't see a universal way to turn animations on/off as I don't want frames eating up cpu cycles if they are off the viewing area
    Custom node is as follows:
    public class frameNode extends CustomNode{
        public var frameNumber;
        public var fxdContent;
        public var actualFrame;
        public var action;
        ///Get image content from fxz file
        public function configureFrame() : Void{
            fxdContent = FXDLoader.loadContent("{__DIR__}testFrame{frameNumber}.fxz");
            actualFrame = fxdContent.getRoot();
            action = fxdContent.getObject("move") as Timeline;
        override function create(): Node {
            def frameNodeGroup : Group = Group {
                content: [ actualFrame  //content from frame ]
            return frameNodeGroup;
    }Using the custom node class I've defined, I can't seem to insert the node itself but only the node's pubic variable 'actualFrame'
            var newFrame : frameNode = frameNode{
                frameNumber: frameNumber
            newFrame.configureFrame(); //fetches the content of the fxz file and assigns it to variable 'actualFrame'
            insert newFrame.actualFrame into myHbox.content; //works
            //insert newFrame into myHbox.content;  //this will NOT workEdit:
    -It turns out that invoking the .configureFrame() method as how I did above was the problem. Instead, I invoked it within the node class itself. As soon as the custom node receives a frame number (i.e. which file to point to) it fetches the FXZ content.

    Hi Ada,
    Please find below a very useful blog on configuring & working with SUS user defined fields.
    Ordering Unit vs Order Pricing Unit in SRM-SUS
    Hope this should solve your problem.
    Regards
    Kathirvel

  • Adding custom nodes in SAP reference IMG and accessing them using SM30

    I was able to successfully add an IMG node and few activities under the node (for our custom configuration table data entry) in SAP reference IMG. (using transaction SIMGH).
    However, when I execute transaction SM30, enter the name of the custom table and hit the button customizing, it does not take me to the appropriate node in IMG. It simply doesn't do anything.
    For any SAP table or view, this works like a charm (wherever SAP has configured the nodes). But when we create custom nodes for custom tables, it does not work.
    What steps am I missing?
    I will really appreciate any help you can provide.
    Jitendra Mehta

    Hi Sree:
    I assume you have either created your view maintenance for Z tables or you have created transaction attaching calling SM30 for view maintenance of your Z table.
    You may go in transaction SIMGH and in SAP reference IMG, create a main node (wherever your end client wants you to put it) and under this node, you can create sub-node for each view maintenance with a suitable description of sub-node.
    Once you save and activate, you are done.
    Then you can execute transaction SPRO and you should see your custom nodes wherever you attached them in the tree.
    I hope I understood your problem and have answered it.
    If not, please let me know and we can discuss it further.
    Thanks.
    Jitendra Mehta

  • Fundamentals: Custom Nodes vs Methods and Controller in MVC

    I have a couple quick questions that I'd consider somewhat fundamental that I should have a better grasp this far along in development...
    - First of all, what do you guys/gals consider the best way to structure your JavaFX classes. I almost always create custom nodes (XCustomNodes usually... from JFXtras) representing certain "panels" filled with content (buttons, labels, text, etc). I realize you could also create a separate class/method to simply return HBoxes, VBoxes, Groups, etc. So... thoughts?
    - Second, I see all these articles/posts saying ghat JavaFX is a perfect MVC language. I agree for the most part, but what would you consider the Controller? Aren't the View and Controller pretty well married together in JFX? Separating the Controller into its own entity seems like it'd be more work than help.
    Just trying to extend my knowledge reach... Thanks in advance!

    evnafets
    Thank you!!!
    While I do not understand how to do this:(though I understand principle of it... the misunderstanding is the whole problem)
    To make this example work all in one file, you have to make RemindTask2 an
    inner class of Reminder (which is already an inner class)
    I do not always understand packages....and doing what you suggested, in forming the packages, and sorting the classes, will help me understand the structure better...plus get me in the norm of always creating packages !
    So what I'm going to do right now is go tear my code down into various packages
    and source files.....however...if you or anyone else could explain/show example
    of how to do what you said(for inner classes, not packages...understand packages) , it would be appreciated.
    This fundamental inner class creation is obviously a major bump right now...and creating the packages and linking the classes will be easy, because I understand how to do it when I already have functional classes created.
    I do not always understand class/method creation/implementation..such as here.
    (IE: can create network apps/gui apps of simple nature....but this easy ol' thing has been driving me nuts.)
    Creating those classes however,,,,even if not the most efficient way is something
    needed for my basic Java knowledge.
    Thank you,,,,VERY GOOD project/training is going to come from this !!
    Really, thank you in any case...if you do not have the time(100% understand) please lmk, will just give you your duke award.
    AEWSOME

  • Custom nodes are deleted for IMG after upgrade

    Gurus,
    We are in processes of upgrading form ECC5 to ECCC6.
    In ECC5 we have custom node in IMG , which were created using SIMGH.
    After the upgrade all the custom nodes are deleted , is there a  way to retrieve the custom node or is there a way custom node are not touched during upgrade .
    Thanks for the help in advance.
    KJ

    Hi Ketan,
    You have used transaction SIMGH for modifying the SAP reference IMG in the old release. Those modifications gets lost
    while upgrading your system. Right?
    Even these custom node disappeared from IMG structure, but the customerspecific IMG structures or IMG-activities should be
    still available within the upgraded system. That means, you only need to reassign your IMG structures or IMG-activities with transaction S_IMG_EXTENSION .
    Those enhancements do not get lost with the next upgrade in future.
    With Best Regards
    Julia Song

  • Create new / add Custom Node in Component Pallete - Workflow Editor

    is there anyway to Create new / add Custom Node in Component Pallete - Workflow Editor in SQL Developer - Oracle Data Miner?
    Now i'm in progress create data cleansing engine in database package, and I have an idea to create new node in workflow editor, the node will call my procedure data cleansing.
    Anybody help?

    Hi,
    Not currently.
    We are working on a SQL Query node that would process data on connected input nodes and allow the user to create any sql query specification they would like.
    So as long as your implementation is compatible with being included as part of a sql query, then you may be able to take advantage of this new node.
    Since you describe your implementation as a data cleansing implementation, I could see it taking in what ever input is provided in the flow, and then returning a cleansed result set.
    Thanks, Mark

  • Remove background in JTree's node

    How to remove colored background in JTree's node?
    http://www.builder.cz/images/client-tree.gif - here is example how it looks like...

    from reading understand white would be best...
    You may have misunderstood.
    In the image you posted there seems to be a problem with a part that strongly reflects the background for example.
    The »ideal« color for efficient clipping depends on the object being photographed, even a green screen would be problematic with an object of a similar green.
    What is the file format you need anyway? psd with transparency or eps with Clipping Path or …?
    Like Silkrooster pointed out Actions and Image Processor, but also Scripts, can help with automising the task with Photoshop – but quite frankly I expect results so bad that each image would likely have to be checked and improved manually.

  • JTree delete node

    Have a problem with JTree
    A node I call folderNode will normally contain sub-nodes with names lik subnode1,subnode2,subnode3 etc. (Just examples)
    The folder node will then represent the range, so for one with the mentioned subnodes, name would be "subnode1- subnode3".
    To update this foldername after I have deleted say nr 3, I use "theFolderNode.setUserObject("new name here")), and then treeModel.nodeChanged(theFolderNode); I would then expect "subnode1- subnode2". (Don't mind the method of finding the correct label..)
    If I then try to get the new userObject and checking by typing:
    System.out.println(theFolderNode.getUserObject().toString()); - I actually get out what I want, but the label of the FolderNode is still not updated..
    What am I missing here??

    Here is an excert from an article from javaworld
    "The Java programmer must keep in mind that it is the garbage collector that runs finalizers on objects. Because it is not generally possible to predict exactly when unreferenced objects will be garbage collected, it is not possible to predict when object finalizers will be run. Java programmers, therefore, should avoid writing code for which program correctness depends upon the timely finalization of objects. For example, if a finalizer of an unreferenced object releases a resource that is needed again later by the program, the resource will not be made available until after the garbage collector has run the object finalizer. If the program needs the resource before the garbage collector has gotten around to finalizing the unreferenced object, the program is out of luck."
    http://www.javaworld.com/javaworld/jw-08-1996/jw-08-gc.html
    Generally without any tweaking the GC only runs when it has to, so your memory with be recycled then.
    You can call System.gc() but that doesn't cause garbage recycling, but rather tells the JVM that you would like to do it, and then it will do it sometime after that.

  • JTREE: Custom TreeModel does not update non-root nodes

    I have a JTree that uses a custom TreeModel that wraps over (delegates to) a data class X which keeps track of all its children. The class X maintains its own data structure internally (references to other data objects). It also implements 'equals' and 'hashcode' methods. When the data changes in X, it invokes fireTreeStructureChanged on the TreeModel. (There is a TreeModelListener registered with the TreeModel). This works very well for the root node but not for the other non-root nodes. The JTree correctly calls 'equals' and I can see that equals returns 'false' but for non-root nodes the JTree does not refresh though I can see the underlying data structure has changed.
    I am wondering if I may not have fully & correctly implemented fireTreeStructureChanged as it doesn't seem to do much. Or I may be looking at the wrong place. Any pointers would be appreciated.
    BTW, this question is very similar to one asked years earlier http://forums.sun.com/thread.jspa?threadID=153854 but it didn't help me :(
    Thanks.
    ps: working with jdk1.6.0_06 on WinXP.

    I have a same problem. I got an error "Cannot Update Libray".

  • Rename custom nodes in a JTree

    Hi all,
    Our problem is that we don't find a way to rename our custom objects that we show in our JTree. We have defined a complete Tree data structure which works fine already ... now we want to be able to rename the nodes in the Tree.
    Our JTree displays concrete instances of our self defined interface INode which has a toString method to display in the Tree. Adding and removing INodes dynamically to the tree works fine already, now we are looking for a way to rename those nodes. Those changes should be noticed finally in the 'name' field of each INode. (INode.setName, INode.getName are present).
    We read from javadoc that a DefaultTreeCellEditor along with an according DefaultTreeCellRenderer are the starting point, but we can't get these 2 integrated to perform correctly. Now the question. Does anyone have an example or an idea of how to write such a CustomTreeCellEditor ??? It is especially important that a possibly provided solution DOES NOT depend on the use of DefaultTreeModel or DefaultMutableTreeNode. Since we use our own Tree Data Structure to be presented in the JTree, we don't have access to possible gimmicks one can expect from the DefaultXXX implementations ...
    Any help very much appreciated!!!

    was able to fix it over here:
    http://forum.java.sun.com/thread.jspa?messageID=4089777

Maybe you are looking for