October 21, 2016

Homework Help: Java

Posted by Robert on Tuesday, December 15, 2009 at 11:04am.

Write a GUI application that prompts the user for a number between 1 and 5. Be sure to include error checking so that the program continues to prompt the user for a number until the user's entry is between 1 and 5, inclusive.

Once a valid number is entered, the program should display a grid of horizontal and vertical lines inside the frame.
These lines should be drawn such that:

The lines create x number of horizontal and x number of vertical boxes, where x is the number entered by the user.

Each box should be 100 pixels by 100 pixels.

The grid is spaced inside the frame such that it is perfectly centered both horizontally and vertically, with a 10-pixel border between the edge of the frame and the grid.

I cannot figure out how to make a border with the gridlayout. Please help!

Answer This Question

First Name:
School Subject:

Related Questions

More Related Questions