import javax.swing.*
frame = JFrame()
tree = JTree()
frame.contentPane.add(tree)
function namedMap(name, map){
new java.util.HashMap(map){
toString() {name}
}
}
nodeAccess(true)
function createNode(node) {
attr = node.attributes
namedMap(attr.title, attr)
}
nodeAccess(false)
tree.model = dom2treeModel(opmlURL, function (n) n.tagName == "outline", createNode)
frame.pack()
frame.visible = true
traverseTreeNodes() traverses nodes from the specified TreeNode in depth-first order.
expandTree() expands all TreeNode.
collapseTree() collapses all TreeNode.
Key Value Remark parentComponent Parent component message Message title Title String messageType JOptionPane.ERROR_MESSAGEJOptionPane.INFORMATION_MESSAGEJOptionPane.WARNING_MESSAGEJOptionPane.QUESTION_MESSAGEJOptionPane.PLAIN_MESSAGEicon Icon object optionType JOptionPane.YES_NO_OPTIONJOptionPane.YES_NO_CANCEL_OPTIONshowConfirmDialog only selectionValues showInputDialog only initialSelectionValue showInputDialog only
![]() showMessageDialog("Message")
|
![]() showInputDialog("Message")
|
![]() showConfirmDialog("Message")
|
Moves componentOrWindow to the center of frame.
Changes the font style of the specified Font or Component.
Changes the font size of the specified Font or Component.
Customizes cell rendering of JTree, JList, and JTable.
component is a Component object that represents the cell. The map parameter is a Map object of the following contents:
Key Value Remark value the value associated with the cell selected selected or not hasFocus has focus or not expanded node is expanded or not treeCellRenderer only leaf node is a leaf or not treeCellRenderer only row the row number treeCellRenderer or tableCellRenderer column the column number tableCellRenderer only index the row number listCellRenderer only
If doubleClick is false, when selection is updated, func() is called.
If doubleClick is true, when a part of the specified component is double-clicked, func() is called.
Specifies the system's look&feel.