If you make the assumption that TreeUI that you are using is an instance of
BasicTreeUI
, you can do the following:
TreeUI tui = treeInstance.getUI();
if (tui instanceof BasicTreeUI) {
((BasicTreeUI)tui).setCollapsedIcon(myIcon);
}
More Related Contents:
- Change JTree node icons according to the depth level
- Add a complex image in the panel, with buttons around it in one customized user interface
- Sizes of frame icons used in Swing
- Setting the Default Font of Swing Program
- How do I add an image to a JButton
- Resizing icon to fit on JButton in Java?
- How to set Icon to JFrame
- How to Insert Image into JTable Cell
- How to change JFrame icon [duplicate]
- Java JTree directory structure from file paths
- How to search a particular node in jtree and make that node expanded.?
- List of Java Swing UI properties? [closed]
- How does JTree display file name?
- How to add an image to a JFrame title bar?
- Put JTable in the JTree
- Java Swing: Need a good quality developed JTree with checkboxes
- Filtering on a JTree [closed]
- how to create own file with icon that inherit from JFrame icon, that I set it, in java and my own file use FileOutputStream and ObjectOutputStream
- How to change the background color for JPanels with Nimbus Look and Feel?
- EventListenerList firing order
- Get Selected Rows in JTable using AbstractTableModel
- SwingWorker, Thread.sleep(), or javax.swing.timer? I need to “insert a pause”
- Get a Swing component by name
- Closing A JOptionPane Programmatically
- invokeAndWait method in SwingUtilities
- Rotate an image in java
- Convert a RGB Color Value to a Hexadecimal String
- how to set JFrame background transparent but JPanel or JLabel Background opaque?
- Using addMouseListener() and paintComponent() for JPanel
- Secure Desktop Mode effect for java application