Java GUI Architecture and Design (Swing)

I spent the last few hours browsing the Internet looking for examples and ideas on how to write a medium-sized GUI in java. I know a little about swing, but thatโ€™s it. I donโ€™t know of any other way to develop a GUI in Java than swing. If you know differently, thatโ€™s good too. I also want to manually write a GUI to simplify integration with our game and future refactoring.

We have compiled all the business logic for the game Tic Tac Toe, which has several functions. For the GUI, you must have several windows that can be moved using simple buttons on the interface. The following is a very rude and restrained version of what I want to do:

Main menuNetwork box

Game board

The heart of my question is this:

How do I create a GUI using Swing and what overall design is used?

and some subsequent questions: Is there a class for each window? Am I just using setvisible to make windows show and disappear after clicking buttons?

`Are there any examples that you all know (github repos would be excellent! Happy forking!) That could show me good gui architecture / design?

+6
source share
2 answers

I think you can create several JPanels (or their extensions), put them in one container using CardLayout and, if necessary, change the cards.

+5
source

Also consider the Model-View-Controller pattern discussed here .

+5
source

Source: https://habr.com/ru/post/902728/


All Articles