#Swing help
8 messages · Page 1 of 1 (latest)
Hey, @pseudo yoke!
Please remember to /close this post once your question has been answered!
make a list add buttons
Sounds rude, but yes. Make an array list with Jbutton as the type. That is probably not what you wanted though
I would approach this task with onClick listeners and panels for each square. Once the panel is clicked you could put the x or O their in a variety of ways
You could make the panel opaque and show an underlying x or o, you could render the image on click of the x or o . You could get really fancy and have an animation of the x being drawn. I like the JPannel approach because it allows for a great deal of abstraction
You could do it with buttons, but your going to have to override the JButton class and really make your own button from scratch. That sounds like a real pain