Jtable Look and feel of editing cell

后端 未结 1 1196
长情又很酷
长情又很酷 2021-01-17 00:55

There is a JTable with DefaultTableModel. There is table\'s setforeground, setbackground and setselectioncolor

1条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-17 01:22

    You can use any of the following keys in UIManager.put() to affect the corresponding Border:

    • Table.focusCellHighlightBorder
    • Table.scrollPaneBorder
    • TableHeader.cellBorder

    For example:

    UIManager.put("Table.focusCellHighlightBorder",
        new BorderUIResource(BorderFactory.createLineBorder(Color.red)));
    

    You can also change the color in your custom renderer/editor; PositiveIntegerCellEditor is an example. See also Concepts: Editors and Renderers.

    0 讨论(0)
提交回复
热议问题