🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.jbuilder.java.swing
1 messages
1 total messages Started by mb2b Thu, 17 Aug 2006 16:54
Java Swing on Windows: Weird JTree Behavior
#182
Author: mb2b
Date: Thu, 17 Aug 2006 16:54
16 lines
1745 bytes
So I have a weird behavior for anyone who would like to solve this
knundrum.  I have JTREE code, that when adding a child node to the root
node, works great on *nix and Mac OS X, however, fails on Windows.  The
code is:(in pseudo)
...
((DefaultMutableTreeNode)((JTree)comp).getModel().getRoot()).setAllowsChildren(true);
DefaultMutableTreeNode child = new DefaultMutableTreeNode("new");
((DefaultMutableTreeNode)((JTree)comp).getModel().getRoot()).add(child);
...
Now, if I run this on Windows it will return: an IllegalStateException:
node does not allow children...

Why is this?

Thanks in advance,
m2
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads