So far, all of the variables used have been declared at the start of the main(). However, Java allows variables to be declared within any block. A block is begun with an opening braces and ended by a closing braces. A block defines a scope.
An Input Dialog Box is used to accept data from the user. It appears with a component like TextField, ComboBox or List which lets the user to input the data. It is created by using the static method showInputDialog() of JOptionPane.
The CardLayout manager is used to manage a large number of components. It organizes the components in layers which are arranged like a deck of cards sharing the same display area such only one of them is visible at a time. In order to use card layout, it is required to create an object of type JPanel that will hold the cards.
String is one of the special type of array that is array of characters. The term “String” generally means an ordered sequence of characters. In most programming language such string are enclosed in either single or double quotes.
Switch case is a multi way decision maker, that test whether an expression matches one of the number of values. In switch statement we use case, default, break reserved keywords.
Paint method allows you to draw a text message ,draw an image,draw a rectangle,oval etc. You can set the color of the text and the diagram(oval,rect,fillrect).
We use java.util.Timer for threads.This class provides schedule tasks for future execution in a background thread. We use java.util.TimerTask to set scheduled for one-time or repeated execution by a Timer.
We can define a validation to validate user input for textfields, password fields etc.If the user entered value does not match the validation pattern, a message appears.
By using a calculator we can calculate arithmetic operations(mathmetical computations) on numbers .Arithmetic operations means addition, subtraction,multiplication, divison etc.
Each square(rectangle) in the chessboard is 20 pixels by 20 pixels.The squares are grey and black.If the row and column are either even or odd, then the color is Grey.Otherwise, change color into Black.