JFrame example
Would you like to make this site your homepage? It's fast and easy...
Yes, Please make this my home page!
/*
Athor: ZT
Date :Aug 08,2017
*/
package a.b.c;
import static java.lang.System.out;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
class ApplA extends JFrame implements ActionListener {
ApplA(){
super("Welcome to Dubai");
setSize(600,600);
// setResizable(false);
setDefaultCloseOperation(EXIT_ON_CLOSE);
setLayout(new FlowLayout());
JButton b1=new JButton("Submit");
b1.addActionListener(this);
add(b1);
//
JButton b2=new JButton("go");
b2.addActionListener(this);
add(b2);
}
public static void main(String []args){
new ApplA().setVisible(true);
} // end of method main()
public void actionPerformed(ActionEvent e){
String str1=e.getActionCommand();
if(str1.equals("Submit")){
JOptionPane.showMessageDialog(null,"Submitted successfully");
}
if(str1.equals("go")){
JOptionPane.showMessageDialog(null,"go for journey");
}
}
} // end of class ApplA