### Switch between TitledPanes

This example shows how to switch between titledpanes of an Accordion Container (requires the JavaObject library).
Reference: https://docs.oracle.com/javase/8/javafx/api/javafx/scene/control/Accordion.html
Accordion
Defined is an Accordion with two TitledPanes called titledpaneView and titledpaneManage.
Private accordionMain As Node
Private titledpaneView As Node
Private titledpaneManage As Node
Example to switch to a TitledPane and expand
Below are Sub executing an action assigned to a MenuItem.
' View the TitledPane named View = the webview of the description
`Sub menuitemViewView_Action
titledpaneView.RequestFocus
Dim jo As JavaObject = titledpaneView
Dim b As Boolean = True
jo.RunMethod("setExpanded", Array As Object(b))
End Sub`
' View the TitledPane named Manage
`Sub menuitemViewManage_Action
titledpaneManage.RequestFocus
Dim jo As JavaObject = titledpaneManage
Dim b As Boolean = True
jo.RunMethod("setExpanded", Array As Object(b))
End Sub`
Example of a Sub to expand or collapse a TitledPane
' Show an expanded titledpane
' Parameter Pane: The pane to give focus and expand
`Sub showTitledPane(p As Node)
p.RequestFocus
Dim jo As JavaObject = p
Dim b As Boolean = True
jo.RunMethod("setExpanded", Array As Object(b))
End Sub`
' Examples calling
showTitledPane(titledpaneView)
showTitledPane(titledpaneManage)

Changed: 2018-03-26 13:01, Category: Accordion, File: T6C158M1140.htm, ID: 1140