You are on page 1of 2

Lab Cat-2

Regno:20MIS0282
Name:Harishkumar.s

Code
import javax.swing.*;
import java.awt.AWTEvent;
import java.awt.*;
import java.io.IOException;

public class palindrome extends ActionListener {


JFrame f;
JButton b;
JTextField t1;
public static void main(){
JFrame f=new JFrame();

JTextField t1=new JTextField();


t1.setBounds(50,50,100,50);

JButton b=new JButton();


b.setBounds(100,50,50,50);

t1.add(f);
b.add(f);
f.setVisible(true);
f.setLayout(null);
f.setSize(600,700);

b.addActionListener(new ActionListener(){
public void action performed(ActionEvent e){
String s=t1.getText();

if(s.isEmpty()){
throws{
Ioexception(exception ex);
system.out.println("strig not entered");
}
}
while(s.length()/2==0){

}
}
});

}
}

You might also like