1. JTextarea as nodes of JTree stackoverflow.comI want to create a JTree, and each node of the JTree has a name, and when you click on the node, a textarea will be expanded, I did some research ... |
2. hard! how to use a compound node (JTextAreas + JButtons) in a JTree? coderanch.com//================== class MyCellRenderer extends DefaultTreeCellRenderer{ public Component getTreeCellRendererComponent (JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus){ // COMPILE ERROR! how to get the user object? VisualNode vn = getUserObject(); return vn.box; } } //=========sanitised======== public class VisualNode { public VisualNode(String name) { super(); displayLabel.setText(name); titleBox.add(displayLabel); titleBox.add(title); nodeBox.add(titleBox); detailsPanel.add(details); nodeBox.add(detailsPanel); topButton.setAlignmentX(Component.CENTER_ALIGNMENT); box.add(topButton); box.add(nodeBox); box.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, ... |
3. To set the data from JTree to JTextArea coderanch.comI'm also looking for an answer to this question... what is the easiest way to get all the data from a JTree to any kind of text format. I want to save it as XML or TXT, but that is not important... There just doesn't seem to be a great way to get that info out of there quickly. Also, instead ... |