Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
25 views

Program File Xi

Uploaded by

NIDHI chaudhary
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views

Program File Xi

Uploaded by

NIDHI chaudhary
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 12

private void jButton1ActionPerformed(java.awt.event.

ActionEvent evt) {
// TODO add your handling code here:
int n = Integer.parseInt(t1.getText());
int r,temp,newnumber=0;
temp=n;
while(n !=0)
{
r= n%10;
newnumber= newnumber*10+r;
n= n/10;
}
if(temp==newnumber)
{
System.out.println("Yes it is a Palindrome Number");
}
else
{
System.out.println("No it is not a Palindrome Number");
}

}
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
int a = Integer.parseInt(tf1.getText());
int b = Integer.parseInt(tf2.getText());
int c = Integer.parseInt(tf3.getText());
if(a>b)
if(a>c)
lbl1.setText(""+a);
else
lbl1.setText(""+c);
else
if(b>c)
lbl1.setText(""+b);
else
lbl1.setText(""+c);
}
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
int p = Integer.parseInt(tf1.getText());
int r = Integer.parseInt(tf2.getText());
int t = Integer.parseInt(tf3.getText());
int s = p*r*t/100;
tf4.setText(""+s);
}

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
int n = Integer.parseInt(tf1.getText());
int i;
for(i=1;i<=n;i++)
{
System.out.println(i);
}
}

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
int a = Integer.parseInt(tf1.getText());
int b = Integer.parseInt(tf2.getText());
int c =a+b;
tf3.setText(""+c);
}
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
int i=1;
int a=1;
while(i<=10)
{
System.out.println(a);
a=a+2;
i++;
}
}

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {


String txt=DayNum.getText();
int num=Integer.parseInt(txt);
if (num ==1)
l1.setText("This day is sunday");
else
if(num==2)
l1.setText("This day is Monday");
else
if(num==3)
l1.setText("This day is Tuesday ");
else
if(num==4)
l1.setText("This day is Wednesday ");
else
if(num==5)
l1.setText("This day is thursday ");
else
if(num==6)
l1.setText("This day is friday");
if(num==7)
l1.setText("This day is saturday");
else
l1.setText("Invalid day number");

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
int a = Integer.parseInt(tf1.getText());
int b = Integer.parseInt(tf2.getText());
for(int i=a;i<=b;i++)
{
if((i%2)==0)
{
System.out.println(i);
}
}
}

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
int n = Integer.parseInt(tf1.getText());
int i;
for(i=1;i<=n;i++)
{
System.out.println(i);
}
}
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
int n =Integer.parseInt(tf1.getText());
while(n>0)
{
int r =(n%10);
System.out.print(r);
n= n/10;
}

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
int age = Integer.parseInt(tf1.getText());
if(age>=18)
lbl1.setText("Yes");
else
lbl1.setText("No");
}
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
int n = Integer.parseInt(tf1.getText());
int flag=0;
for(int i=2;i<=n-1;i++)
{
if((n%i)==0)
{ flag=0;
break;
}
else
{
flag=1;
}
}
if(flag==0)
lbl1.setText("Not a Prime No.");
else
lbl1.setText("Yes a Prime No.");
}

private void chk2ActionPerformed(java.awt.event.ActionEvent evt) {


String text = tf1.getText();

// int style=0;
if(chk2.isSelected()==true)
{
// tf1.setText(text);
tf1.setFont(new Font(tf1.getText(),Font.ITALIC,18));
}
else
{
if(chk2.isSelected()==false)
{
tf1.setFont(new Font(tf1.getText(),Font.PLAIN,12));
}
}
// TODO add your handling code here:
}
private void chk1ActionPerformed(java.awt.event.ActionEvent evt) {
String text = tf1.getText();

// int style=0;
if(chk1.isSelected()==true)
{
// tf1.setText(text);
tf1.setFont(new Font(tf1.getText(),Font.BOLD,18));
}

else
{

if(chk1.isSelected()==false)
{
// tf1.setText(text);
tf1.setFont(new Font(tf1.getText(),Font.PLAIN,12));
}
}
// TODO add your handling code here:
}

private void chk3ActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
tf1.setFont(new Font(tf1.getText(),Font.PLAIN,12));
}
private void b1ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
tf1.setEditable(false);
b1.setToolTipText("Click this button to disable the middle button.");

You might also like