Resize « JTree « Java Swing Q&A





1. How to force an HTML JLabel in a JTree to resize when the font changes    stackoverflow.com

I'm updating a Java Swing application to support the user switching the app's font from normal size to a larger size (so the user can switch between the two sizes at ...

2. How to automatically resize a JTree object?    stackoverflow.com

I'm trying to get a JTree object to dynamically resize when a node is expanded. By default, the object area is constant and when expanded, the bottom section of the tree ...

3. JTree / Resizable question    coderanch.com

4. How to resize the Icon in JTree at my will??    coderanch.com

The newer way to load images is with ImageIO.read which returns a BufferedImage. I had trouble loading the three images used in the app you posted/linkedto with ImageIO so I kept the older ImageIcon code below. It shows a way to create a scaled image onthefly. import java.awt.*; import java.awt.event.*; import java.awt.geom.AffineTransform; import java.awt.image.BufferedImage; import javax.swing.*; import javax.swing.tree.*; public class CustomIconsRx ...

5. Turning JTree into a layout manager, resizing nodes    coderanch.com

import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.plaf.basic.*; import javax.swing.tree.*; public class PanelNodes extends ComponentAdapter { JTree tree; public void componentResized(ComponentEvent e) { if(tree.isVisible()) { registerUI(); } } private JScrollPane getContent() { tree = getTree(); tree.setRowHeight(35); tree.addComponentListener(this); return new JScrollPane(tree); } private JTree getTree() { DefaultMutableTreeNode root = new DefaultMutableTreeNode(getNode("root")); DefaultMutableTreeNode node = new DefaultMutableTreeNode(getNode("Node 1")); root.insert(node, 0); DefaultMutableTreeNode subNode = ...

6. JTree resizing issue    coderanch.com

Hello, I have come to this site for a few years looking for various issues and 99% of the time find my answer here (thank you by the way!) This time however I think I've programmed myself into a corner requiring a bit more of a specialized answer. I am writing an XMPP Client using the smack API for cross platform ...

7. Resizing issues in JTree    coderanch.com

I do understand your question, but like I said this is part of a larger project. This particular panel containing the tree is only one of 6 panels that will be shown at a time (like an installation wizard), so I suppose having scroll bars on all of them is not desirable. Believe me, a scroll bar would have made my ...