Forum Discussion

c_hemant's avatar
c_hemant
New Contributor
14 years ago

How to check the tree view is expanded in Java

Hi All,


            Need help verifying whether tree view item isExpanded



Code:

function Test5()


{


Sys["Process"]("javaw")["SwingObject"]("scc_Frame", "Console", 0)["SwingObject"]("JRootPane", "", 0)["SwingObject"]("null.layeredPane")["SwingObject"]("null.contentPane")["SwingObject"]("MasterComponent", "", 0)["SwingObject"]("LHR_ScrollPane", "", 0)["SwingObject"]("JViewport", "", 0)["SwingObject"]("TreeViewPanel", "", 0)["ClickItem"]("|[0]|MyNew|cluster");


}


Thanks in Advance


Hemant

1 Reply

  • Hi,



    You can obtain tree items by using the wItems property of your tree (see the "JTree Object" help topic) and check their Expanded property value.

    ...

    if(tree.wItems.Item(0).Expanded) // The node is expanded

    ...




    To check child nodes, you can iterate through them (each item provides access to its subitems via the Items property).