How to change text color of a JButton

后端 未结 1 581
猫巷女王i
猫巷女王i 2020-12-10 03:53

I am writing a simple minesweeper game and it works now, but I am working on the pretty details like making each number a different color.

I keep running into errors

相关标签:
1条回答
  • 2020-12-10 04:45

    setTextColor is undefined for JButton. To set the JButton text color, you can use setForeground.

    button.setForeground(Color.RED);
    
    0 讨论(0)
提交回复
热议问题