Java GUI : Java Frame with Menu ( JMenu)

import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.*;
class  main3 extends JFrame implements  ActionListener 
{

    JButton btn;
	JMenuBar menuBar ;	
	JMenuItem AccOpen;
	JMenuItem AccClose;
	JMenuItem AccDelete	;
	Dimension dim ;
	  public main3()
	  {
		  setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		  setTitle("codeTpoint.com ");
		  setSize(500,400);
		  // Creates a menubar for a JFrame
		  menuBar = new JMenuBar();
	        
	        // Add the menubar to the frame
	        setJMenuBar(menuBar);
	        
	        // Define and add two drop down menu to the menubar
	        JMenu AccountMenu = new JMenu("Account");
	        JMenu TransMenu = new JMenu("Transaction");
	        
	        menuBar.add(AccountMenu);
	        menuBar.add(TransMenu);
	        
	        AccOpen = new JMenuItem("Open");
	        AccClose = new JMenuItem("Close");
	        AccDelete = new JMenuItem("Delete");
	        
	        AccOpen.addActionListener(this);
	        AccClose.addActionListener(this);
	        AccDelete.addActionListener(this);
	        
	        JMenuItem TransDeposit = new JMenuItem("Deposit");
	        JMenuItem TransDraw = new JMenuItem("Draw");
	        JMenuItem TransBalance = new JMenuItem("Balance");
	        
	        AccountMenu.add(AccOpen);
	        AccountMenu.add(AccClose);
	        AccountMenu.add(AccDelete);
	        
	        
	        TransMenu.add(TransDeposit);
	        TransMenu.add(TransDraw);
	        TransMenu.add(TransBalance);
	        
		    setLayout(new FlowLayout());
		    btn= new JButton("Who write  this code!");
		  
		    btn.addActionListener(this);
		    add(btn);
		
 	       // Get the size of the screen
           dim = Toolkit.getDefaultToolkit().getScreenSize();

	        // Determine the new location of the window
	        
	        int w = this.getSize().width;
	        int h = this.getSize().height;
	              
	        int x = (dim.width-w)/2;
	        int y = (dim.height-h)/2;
	        
	        
	       	       
	        this.setLocation(x,y);
	        
	        
	        setVisible(true);
		  
	  }

	@Override
	public void actionPerformed(ActionEvent arg) {
	
		if(arg.getSource()==( JMenuItem) AccOpen)
		{
       JOptionPane.showMessageDialog(null,AccOpen.getText()  ,"codetpoint.com",JOptionPane.INFORMATION_MESSAGE);
     
		}
		if(arg.getSource()==( JMenuItem) AccClose)
		{
       JOptionPane.showMessageDialog(null,AccClose.getText()  ,"codetpoint.com",JOptionPane.INFORMATION_MESSAGE);
     
		}
		if(arg.getSource()==( JMenuItem) AccDelete)
		{
       JOptionPane.showMessageDialog(null,AccDelete.getText()  ,"codetpoint.com",JOptionPane.INFORMATION_MESSAGE);
     
		}
		
		if(arg.getSource()==( JButton) btn)
		{
       JOptionPane.showMessageDialog(null,"Shailesh Dwivedi for codeTpoint.com"  ,"codetpoint.com",JOptionPane.INFORMATION_MESSAGE);
     
		}
	}			 
			     
	
}

class  win3
{
 
	  public  static void main(String args[])
	  {
     new main3();
   		  
	  }

	
}

output

frame3