0
button[currRow][currCol].setBackground(Color.RED);
button[currRow][currCol].setContentAreaFilled(true);
button[currRow][currCol].setOpaque(true);
これは、私が接続している4つのゲームが赤いプレーヤーの動きを示すために今持っているものです。現時点で Javaの実際のJButtonの色を変更するにはどうすればよいですか?背景ではなく、テキストである
、それだけで色の背景と私はボタン[currRow] [currCol] .setForeground(Color.RED)に自分のコードを変更した場合、その後全体のことだけで変更しないように見えます。どうすればこの問題を解決できますか?
'setContentAreaFilled(false) 'を使ってみてください。 [もう少し高度な例として](http://stackoverflow.com/questions/14635952/java-layout-proportions-creating-a-scalable-square-panel/14636828#14636828) – MadProgrammer