简体   繁体   中英

What is a good layout to render this design in Java?

I'm new to Java. I'm making a multiplayer Tic-Tac-Toe game as a test. For the main menu, I'd love a layout that looked like this: 理想的布局

The problem is, I have no idea how to make that. I have a JFrame with all the content ready (the buttons and such), but everything appears completely out of location. I've tried BoxLayout , GridLayout , FlowLayout , and a few others, with no results. I've had a headache over this all day, and any help would be appreciated.

So, if you have any recommended layouts, or any tips to get this working, that'd be great :)

I would use a nested layout that looked something like this:

http://i.imgur.com/agGqAcW.png

GridBagLayout is useful for a more flexible layout, and BoxLayout for lining up a bunch of stuff.

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