Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.FlowLayout;
- import java.awt.GridLayout;
- import java.awt.event.ActionEvent;
- import java.awt.event.ActionListener;
- import java.awt.event.KeyEvent;
- import java.awt.event.KeyListener;
- import java.util.ArrayList;
- import javax.swing.JButton;
- import javax.swing.JFrame;
- import javax.swing.JOptionPane;
- public class EarthQuake_Trigger extends JFrame {
- private JButton btnInsert1, btnInsert2, btnInsert3;
- public EarthQuake_Trigger() {
- this.setSize(400,400);
- this.setLocationRelativeTo(null);
- this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- this.setLayout(new GridLayout(3, 2, 1,1 ));
- this.AddComponent();
- }
- public void AddComponent() {
- ButtonHandler rh = new ButtonHandler();
- btnInsert1=new JButton("BANGLADESH");
- btnInsert1.addActionListener(rh);
- add(btnInsert1);
- btnInsert2=new JButton("NEW_ZEALAND");
- btnInsert2.addActionListener(rh);
- add(btnInsert2);
- btnInsert3=new JButton("INDIA");
- btnInsert3.addActionListener(rh);
- add(btnInsert3);
- }
- public class ButtonHandler implements ActionListener
- {
- @Override
- public void actionPerformed(ActionEvent e) {
- if(e.getSource()==btnInsert1)
- {
- callInsert1();
- }
- }
- private void callInsert1() {
- boolean result= KernelDB.Insertdata1("EarthQuake");
- if(result)
- JOptionPane.showMessageDialog(null, "Message Triggered");
- else
- JOptionPane.showMessageDialog(null, "SEND AGAIN");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement