The logic behind this is as follows:
1) The class you add the JButton to should implement ActionListener. For example:
public class MyPanel extends JPanel implements ActionListener
2) When you create the JButton, you must add an ActionListener to it. You do this like so:
myButton.addActionListener(this);
3)In your actionPerformed method, check to see if the ActionEvent was generated by the JButton:
public void actionPerformed(ActionEvent ae){
if (ae.getSource().equals(myButton){
//......your code here.....
That is how you create a JButton, and get the ActionEvent data from it. What you would need to do in your particular case is create JButtons for Insert, Update, and Delete, and then implement the JDBC code for each situation inside your actionPerformed method. That handles the Swing side of the equation. Is that where you had difficulty, or is the JDBC code giving you problems?