Asked by Robert
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!
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!
Answers
Answered by
MathMate
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
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
Answered by
jeam
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!
Answered by
jeam
I cannot figure out how to make a border with the gridlayout. Please help!
Answered by
jeam
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
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
Answered by
jeam
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
• 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
Answered by
jeam
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
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
There are no AI answers yet. The ability to request AI answers is coming soon!
Submit Your Answer
We prioritize human answers over AI answers.
If you are human, and you can answer this question, please submit your answer.