Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
黒と白のJButtonが交互に並んだチェッカーボードを作成する必要があります。グラフィッククラスを使用してボタンを追加できますか?これは宿題なので、答えないで助けていただければ幸いです。
ここで使用方法の例を見つけることができるGridLayoutを見てください。最後に、チェッカーボードを作成する場合は、JPanelsを使用すると、JButtonを使用するよりも良い仕上がりになると思いますが、それは完全にあなた次第です。