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 …

Students Result in JAVA NETBEANS IDE 6.5.1

Q15. Design an application in JAVA NETBEANS IDE 6.5.1 to prepare students result on the basis of marks entered.

Sol:

Create a GUI application as per following screenshot.

 

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

jTextField1.setText(“”);

jTextField2.setText(“”);

jTextField3.setText(“”);

jTextField4.setText(“”);

jTextField5.setText(“”);

jTextField6.setText(“”);

jTextField7.setText(“”); Read More …

Boiling Point Of Water(if…else)

Q14. Program to obtain boiling point of water from user and report whether the user has entered the correct answer or not. Make use of if…else statement.

(Hint. Boiling point of water is 100C.)

Sol:

Create a GUI application as per following screenshot.

 

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

String t1=txt1.getText();

double temp=Double.parseDouble(t1);

if(temp==100)

lbl1.setText(“You are right. It is 100C”);

else

lbl1.setText(“No. It is 100C”);

}

 

OUTPUT:

Calculate Mobile Bill Amount.

Q12. Design a Java Netbeans 6.5.1 GUI application to calculate mobile bill amount?

Criteria Table:

Calls Call Rate
1-100 1 Rs per call
101-200 1.20 Rs per call
201-300 1.50 Rs per call
Above 300 1.80 Rs per call

 Sol:

Create a GUI application as per following screenshot.

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

double amt;

int call;

call=Integer.parseInt(txt1.getText());

if(call>=1&& call<=100)

amt=call*1;

else if(call<=200)

amt=100+(call-100)*1.20;

else if(call<=300)

amt=100+120+(call-200)*1.50;

else

amt=100+120+150+(call-300)*1.80;

lbl1.setText(amt+””);

}

OUTPUT:

Design a Java Netbeans 6.5.1 GUI application to find the maximum number between the two numbers.

Q8. Design a Java Netbeans 6.5.1 GUI application to find the maximum number between the two numbers.

Sol:

Create a GUI application as per following screenshot.

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

 

int x,y;

x=Integer.parseInt(txt1.getText());

y=Integer.parseInt(txt2.getText());

if(x>y)

lblmax.setText(x+””);

else

lblmax.setText(y+””);

}

OUTPUT:

Design Java Netbeans 6.5.1 GUI application to find out that entered number is EVEN or ODD.

Q7. Design Java Netbeans 6.5.1 GUI application to find out that entered number is EVEN or ODD.

Sol:

Create a GUI application as per following screenshot.

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

int num;

num=Integer.parseInt(txt1.getText());

if(num%2==0)

lblmsg.setText(“Number is EVEN.”); Read More …

Java Netbeans Application To Find Out Total, Percentage Of Any Three Subjects.

Q5. Design a GUI application to find out Total, Percentage of any three subjects (Subject marks not more than 100).

Sol:

Create a GUI application as per following screenshot.

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

Display Information of Student in I-Card Format in Java Netbeans 6.5.1.

Q4. Design a Java Netbeans 6.5.1 GUI application that asks for some information about a student and display it in I-card format.

Sol:

Create a GUI application as per following screenshot.

 

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

String t1=txtTitle.getText();    //text of txtTitle stored in t1.

String t2=txtName.getText();    //text of txtTitle stored in t2.

String t3=txtLname.getText();    //text of txtTitle stored in t3.

String t4=txtClass.getText();   //text of txtTitle stored in t4.

String t5=txtSec.getText();    //text of txtTitle stored in t5.

 

repArea.append(“Student Details:” + “\n”);    //text will be added to textarea

repArea.append(“Name:” + t1 + ” ” + t2 + ” ” + t3 + “\n”);

repArea.append(“Class:” + t4 + ” ” + t5);

 

Output of the above program will be: