I am currently a java newbie of sorts writing a program that is, essentially, a board game, almost identical to checkers. Unfortunately, this also means I need one hundred JButtons for the checkerboard. I know there is a way to have automatically generated JButtons, I’ve seen it done. I have no idea how I would go about this, though. Any help would be appreciated!
Share
If you want to generate a board game, you should use a
GridLayoutwhich will help you a lot positioning your buttons with minimal effort. Something like this:Here is a nice article that should help you a lot implementing your needs.