In CreateGridRx
xInc and
yInc are the size of each grid cell. So each one would become 100. After you get the user input you can figure the size of the grid: number of cols/rows times 100 plus twice the pad for both width and height. You can call setPreferredSize on the panel and call pack on the JFrame or make sure that the size of the frame is big enough to allow for proper display if you want to use
setSize. Or you could put the child panel in a JScrollPane - setting the panels prefSize will allow the scrollPane to properly set its scrollBars.
CreateGridRx test = new CreateGridRx(gridSquares);
test.setPreferredSize(new Dimension(calculatedWidth, calculatedHeight));
JFrame f = new JFrame();
f.pack(); // instead of setSize