Count Lowest to Highest.

Q18. Design a Java Netbeans 6.5.1 GUI application having interface as shown below :

 The loop for the frame should print numbers from lowest to highest on the basis of given two numbers, upon clicking at “Count” button.

Sol:

Type the following code by double clicking jButton2, button, below the line that says, ‘// TODO add your handling code here’

 

 

int num1,num2;

num1=Integer.parseInt(jTextField1.getText()); Read More …

What method would you use, to simulate button’s click event, without any mouse activity

Q16. What method would you use, in order to simulate a button’s (namely OKBtn) click event, without any mouse activity from user’s side?

Ans. OKBtn.doClick();

What command do you need to write in actionPerformed() event handler of button, in order to make it exit button

Q15. What command do you need to write in actionPerformed() event handler of button, in order to make it exit button?

Ans. System.exit(0);

Component Class Of Panel.

Q12. Name the component class of panel. Also name some properties along with their purpose of this class.

Ans. The component class of a panel is JPanel. Some properties class are:

background: sets the background color of panel,

border: specifies the type of border for the panel,

toolTipText: sets the text for the toolTip.