This is the game TicTacToe programmed in Java Swing
As soon as the game starts you can choose who starts to play. Either Player 1 (P1), Player 2 (P2) or random. You can now click on any button to place your mark, either red or green depending on who made his turn. As soon as someone won or no buttons can be clicked anymore you can start a new game in a pop-up-window.