Scope and Lifetime of Variables in Java

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.

Input Dialog Box in Java Swing

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.

How to Use CardLayout in Java

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.

C ++ Program to count vowels in a String

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 Statement in C++

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 in Java

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).

Timer and TimerTask in Java Swing

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.

How to Validate TextField in Java Swing

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.

Java Swing Calculator

By using a calculator we can calculate arithmetic operations(mathmetical computations) on numbers .Arithmetic operations means addition, subtraction,multiplication, divison etc.

Chess Board in Java Applet

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.

Page 9 of 29

About Us

Rekha SetiaRekha Setia is a passionate blogger of Extra Computer Notes. if you have any ideas or any request me @