How can I set a JLabel's background and border the same as a table header?

前端 未结 4 937
无人共我
无人共我 2021-01-15 12:53

I want to recreate a table header looks using JLabel. The look and feel of the JLabel needs to be exactly like the JTableHeader would

4条回答
  •  南方客
    南方客 (楼主)
    2021-01-15 13:48

    Try taking the defaults from UIManager:

    Color color = UIManager.getColor("TableHeader.background");
    Border border = UIManager.getBorder("TableHeader.CellBorder");
    

提交回复
热议问题