0% found this document useful (0 votes)
5 views5 pages

Java Coding - 2025

The document contains Java code snippets for creating a simple IDE form with various functionalities. It includes methods to display greetings, print student details, add two numbers, find the maximum of two numbers, and reset input fields. Each functionality is triggered by button actions in a graphical user interface (GUI).
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views5 pages

Java Coding - 2025

The document contains Java code snippets for creating a simple IDE form with various functionalities. It includes methods to display greetings, print student details, add two numbers, find the maximum of two numbers, and reset input fields. Each functionality is triggered by button actions in a graphical user interface (GUI).
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

JAVA CODING TO CREATE IDE FORM IN JAVA

Java coding 1 – To print good morning & good evening

private void jButton3ActionPerformed([Link] evt)


{
[Link](0);
}
private void jButton1ActionPerformed([Link] evt)
{
[Link]("Good Morning "+[Link]());
}
private void jButton2ActionPerformed([Link] evt)
{
[Link]("Good Evening "+[Link]());
}
JAVA CODING 2 - To print HELLO

private void jButton1ActionPerformed([Link] evt)


{
[Link]("HELLO " +[Link]());
}
Java Coding 3 – To print NAME, CLASS, STREAM, SCHOOL AND
CITY

private void jButton1ActionPerformed([Link] evt)


{
String name=[Link]();
String cl=[Link]();
String stream=[Link]();
String school=[Link]();
String city=[Link]();
[Link]("\nNAME OF THE STUDENT "+ name+"\nCLASS OF
STUDENT "+cl+ "\nSTREAM OF THE STUDENT "+stream+"\nSCHOOL
"+school+"\nCITY "+city);
}
JAVA CODING 4 – To add two numbers.

private void jButton1ActionPerformed([Link] evt)


{
double n1,n2,res;
n1=[Link]([Link]());
n2=[Link]([Link]());
res=n1+n2;
[Link]([Link](res));
}
Java coding 5 – To find maximum number.

private void jButton1ActionPerformed([Link] evt)


{
int n1=[Link]([Link]());
int n2=[Link]([Link]());
int MAX;
if(n1>n2)
MAX=n1;
else
MAX=n2;
[Link](this,"Maximum Number is : " +MAX);

RESET CODING FOR EXIT BUTTON

private void jButton2ActionPerformed([Link] evt)


{
[Link](" ");
[Link](" ");
}

You might also like