Title: Calculator Problem
Course: CPS 261: Advanced Java Concepts ~ DL & MM MASTER

Calculator Problem

Create a Calculator based on JFrame. Use a BorderLayout for the overall layout. In the NORTH, put a JTextField. In the CENTER, create a gridLayout for the buttons.

"Calculator" should show up on the Titlebar.

Make your JTextField read only (user can't enter numbers in directly). This avoids getting garbage in the field. The JTextField method to use for this is: setEditable(boolean b)

The font to use for all text should be SERIF, BOLD, 32 points. The colors used in the image below are red, cyan, yellow and lightGray.

Note the lightGray showing through in the gaps of the GridLayout are the background color of the JFrame. The gaps you see are due to using a GridLayout constructor that takes 4 ints. The third and fourth int specify information related to the GridLayout gap information(I used 4 pixels of gap).

Last Updated: June 15, 2014 2:59 PM