Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

how to add Jtree object in JInternal frame?  RSS feed

 
krishna balaji
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i tired this following code but the tree is not visible on the internal frame
 
Rob Spoor
Sheriff
Posts: 20893
81
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Try changing this into the following:

The tree already had a parent, the scroll pane's view port (which has the scroll pane as its parent). When you try to add it to a new parent, things go wrong.
Instead of adding the tree itself again, you should add the scroll pane, which contains the tree.

You should also ignore the bounds and visibility. The parent panel (PanelResourceWindow) will take care of the bounds of the scroll pane through its layout manager. The visibility will be set as the parent PanelResourceWindow becomes visible or invisible.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!