Search code examples
javagrid-layoutacm-java-libraries

java how to create a grid of squares


I'm beginner to java and I'm doing a java project(maze solver) with a GUI. I need to build a grid of squares. I searched over the internet and unable to find any solutions, Someone told me that using java acm packages this can done easily. Please someone help me to do this.


Solution

  • You should use the [GridLayout] [1] and add controls in it.

    [1] http://docs.oracle.com/javase/7/docs/api/java/awt/GridLayout.html