简体   繁体   中英

Game Board with Java GUI Swing

I try to do a game like scrabble with Java GUI. The game board should show like在此处输入图像描述 . The user enters xy inputs and the width of the board field is NxN. The user enters the number of colored squares and the colored squares are randomly distributed to the board. User should select squares and give entry on squares. Do you have any advice on which class to use for board?

Yes, I have advice: Don't start with the GUI first. Build a game model that has all of the Scrabble logic: putting pieces down, add points to scores etc. Do this first, test it, make sure it works, then build a GUI around it.

... But to answer your question: If I was doing this, I'd just use a JPanel and draw the board / handle UI in one place.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM