Java Swing #2 “Grid Layout & Action Listener” Tutorial


Video is ready, Click Here to View ×

In this tutorial I’ll be showing you how to make a basic tictactoe game using gridlayout and actionlisteners

Source Code

24 thoughts on “Java Swing #2 “Grid Layout & Action Listener” Tutorial

  1. First of all Thank's a lot. You have great tutorials and have helped me ton's. My only suggestion? Any future ones please take the time to heavily comment the source code. You go so fast in the video it would really help people to follow along and understand what is happening. But again Thank You So Much.

  2. Please help

    Exception in thread "main" java.lang.NullPointerException
    at javax.swing.ImageIcon.<init>(Unknown Source)
    at tictactoe.XOButton.<init>(
    at tictactoe.TicTacToe.<init>(
    at tictactoe.TicTacToe.main(

  3. Peter, I'm trying to write the code to solve a ken-ken puzzle. On clicking the button,I want it to take the integer input from me. I'm not able to create the puzzle interface. After that, I can think about the logic,like you said.Any suggestion would be a great help. Thanks!

  4. Nothing showed up except a Frame
    Can someone help me (It showed this)

    Exception in thread "main" java.lang.NullPointerException
    at javax.swing.ImageIcon.<init>(
    at mediumTesting.XObutton.<init>(
    at mediumTesting.ImagesGUI.<init>(
    at mediumTesting.ImagesGUI.main(

  5. Can you quickly explain to me how it would go about detecting who wins? I'd imagine multidimesional arrays, but I'd just like some specific clarification if possible?

Leave a Reply

Your email address will not be published. Required fields are marked *