문제

Is it possible to remove the dots border for DefaultMutableTreenNode in JTree?

For JButton I use:

JButton btn;
btn.setFocusPainted(false);

But I cannot find an equivalent for DefaultMutableTreenNode.

도움이 되었습니까?

해결책

I'm not sure if that is exactly what you are trying to achieve, but try this before you instantiate any swing components:

// For the border around the icon
UIManager.put("Tree.drawsFocusBorderAroundIcon", false);
// Dashed border
UIManager.put("Tree.drawDashedFocusIndicator", false);
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top