Hi,

I am using a ULCTableTree. The problem is that the structure-changed
event from a model causes the table tree to remove its contents, but it
does not load it back again!
I am attaching a sample application demonstrating the problem.

Environment:
- ULC Version: 6.1.1
- Java: 1.4.2 on both client and server.

To reproduce the problem:
1. Please run the following application and double-click the table tree.
2. The content of the table tree vanishes!

Am I doing something wrong or is it a bug with a work around?

Thanks and Regards
Indukumar

X----------------------------------

public class ULCTestCase extends ULCFrame implements IApplication {

        public static void main(String[] args) {

                DevelopmentRunner.main(args);
        }

        /**
         * @see com.ulcjava.base.application.IApplication#start()
         */
        public void start() {

                ULCTestCase testCase = new ULCTestCase();

                DefaultMutableTableTreeNode root = new
DefaultMutableTableTreeNode(new Object[] {"root", "root", "root"},
                        new boolean[] {false, false, true}, false);
                DefaultMutableTableTreeNode row1 = new
DefaultMutableTableTreeNode(new Object[] {"AAA", "BBB", "CCC"},
                        new boolean[] {false, false, true}, false);
                DefaultMutableTableTreeNode row1a = new
DefaultMutableTableTreeNode(new Object[] {"aaa", "bbb", "ccc"},
                        new boolean[] {false, false, true}, true);
                DefaultMutableTableTreeNode row2 = new
DefaultMutableTableTreeNode(new Object[] {"DDD", "EEE", "FFF"},
                        new boolean[] {false, false, true}, false);
                DefaultMutableTableTreeNode row2a = new
DefaultMutableTableTreeNode(new Object[] {"ddd", "eee", "fff"},
                        new boolean[] {false, false, true}, true);

                row1.add(row1a);
                row2.add(row2a);

                root.add(row1);
                root.add(row2);

                final DefaultTableTreeModel model = new
DefaultTableTreeModel(root, new String[] {"As", "Bs", "Cs"});

                model.setRoot(root);

                ULCTableTree tree = new ULCTableTree(model);
                tree.setRootVisible(false);
                tree.setShowsRootHandles(true);

                tree.addActionListener(new IActionListener() {

                        public void actionPerformed(ActionEvent arg0) {

                                model.structureChanged();
                        }
                });

                testCase.add(new ULCScrollPane(tree));

                testCase.setVisible(true);
        }

        /**
         * @see com.ulcjava.base.application.IApplication#stop()
         */
        public void stop() {

        }

        /**
         * @see com.ulcjava.base.application.IApplication#activate()
         */
        public void activate() {

        }

        /**
         * @see com.ulcjava.base.application.IApplication#passivate()
         */
        public void passivate() {

        }

        /**
         * @see
com.ulcjava.base.application.IApplication#handleMessage(java.lang.String
)
         */
        public void handleMessage(String arg0) {

        }

        /**
         * @see com.ulcjava.base.application.IApplication#pause()
         */
        public void pause() {

        }

        /**
         * @see com.ulcjava.base.application.IApplication#resume()
         */
        public void resume() {

        }

}

X----------------------------------
_______________________________________________
ULC-developer mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/ulc-developer

Reply via email to