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!

6 answers

Have you decided what makes the grid, JButtons, JPanels, etc.?

If you use a JPanel as a container for the grid made up of buttons, or other panels, you can use the BevelBorder to make borders by adding it onto the panel.

and it is not difficult to use. For a JPanel named p, you can do this with a single statement:

p.setBorder(new javax.swing.border.BevelBorder(1));

Read up the API for more details:
javax.swing.border.BevelBorder
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!
I cannot figure out how to make a border with the gridlayout. Please help!
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
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
Write me java code for 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!

Java - MathMate, Tuesday, December 15, 2009 at 2:45pm
Have you decided what makes the grid, JButtons, JPanels, etc.?

If you use a JPanel as a container for the grid made up of buttons, or other panels, you can use the BevelBorder to make borders by adding it onto the panel.

and it is not difficult to use. For a JPanel named p, you can do this with a single statement:

p.setBorder(new javax.swing.border.BevelBorder(1));

Read up the API for more details:
javax.swing.border.BevelBorder

Java - jeam, Tuesday, July 13, 2010 at 3:36pm

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!


Java - jeam, Tuesday, July 13, 2010 at 4:06pm
I cannot figure out how to make a border with the gridlayout. Please help!


Java - jeam, Thursday, July 15, 2010 at 12:45am
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

Java - jeam, Thursday, July 15, 2010 at 12:36pm
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
Similar Questions
    1. answers icon 1 answer
  1. Create the logic for a program that continuously prompts a userfor a numeric value until the user enters 0. The application
    1. answers icon 0 answers
    1. answers icon 1 answer
  2. Pseudocode -Create the logic for a program that continuously prompts a user for a numeric value until the user enters 0. The
    1. answers icon 3 answers
more similar questions