With the following code,
JFrame frame = new JFrame("frame");
frame.add(BorderLayout.CENTER, new JScrollPane(new JTree()));
frame.add(BorderLayout.SOUTH, new JLabel("label"));
frame.setSize(200, 100);
frame.setLocationRelativeTo(null);
frame.setVisible(true);
Reducing the size of the window until a scrollbar is shown, you can see a
tree icon is painted over a label.
|