I m trying to create a simple Border layout template and I m using frame.pack() to determine frame size. I have an invisible label in the centre region and the pack method doesn t seem to be taking the label into account so it doesn t show. I know it does work initially because the frame is initially the right size for the other components. So how can I get the frame to take the invisible label into account? The label is only visible when the button in the centre region is selected. Everything works, apart from you have to manually increase the frame size to see the label.
I want write custom TreeCellRenderer to have Root, nodes and leafs in different color. This is my code: tree.setCellRenderer(new DefaultTreeCellRenderer() { @Override public Component ...