Is there any way to fit an image in a tab component

前端 未结 2 1471
暗喜
暗喜 2021-01-25 09:07

I\'m adding icons to tabs but i want the ImageIcon fits all the tabComponent.

\"enter

2条回答
  •  自闭症患者
    2021-01-25 09:43

    You can try playing with the UIManager. Add the following at the start of your program before you start creating component:

    UIManager.put("TabbedPane.tabInsets", new Insets(0, 0, 0, 0));
    

    Of course not all LAF's may support this option. See UIManager Defaults for more information.

提交回复
热议问题