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:

Leave a Reply

Your email address will not be published. Required fields are marked *