Aligning icon to the left in JTabbedPane in Nimbus Look and Feel

前端 未结 2 476
鱼传尺愫
鱼传尺愫 2020-12-21 03:06

I was creating an application with JTabbedPane using Nimbus look and feel

I have used this code to place tabs:

pane.addTab(\"Welcome\",n         


        
2条回答
  •  抹茶落季
    2020-12-21 03:35

    There is a simpler solution using HTML formatting. This is an example using html code to format text, but you can also format other elements within the tab:

    final String PRE_HTML = "

    "; final String POST_HTML = "

    "; tabbedpane.setTitleAt(0, PRE_HTML + "your title" + POST_HTML); tabbedpane.setTitleAt(2, PRE_HTML + "your title 2" + POST_HTML);

提交回复
热议问题