import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
class Aplikasi_Event_Menu
{
JMenuBar mb=new JMenuBar();
JMenu data=new JMenu("Data");
JMenu help=new JMenu("Help");
JMenuItem input=new JMenuItem("Input Data");
JMenuItem edit=new JMenuItem("Edit Data");
JMenuItem quit=new JMenuItem("Keluar");
JMenuItem about=new JMenuItem("About");
Aplikasi_Event_CheckBox isidata=new Aplikasi_Event_CheckBox();
Aplikasi_About tengtangku = new Aplikasi_About();
Aplikasi_Event_Menu()
{
setTitle("Menu Utama");
setLocation(320,160);
setSize(300,200);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
void KomponenVisual()
{
setJMenuBar(mb);
mb.add(data);
mb.add(help);
data.add(input);
data.add(edit);
data.addSeparator();
data.add(quit);
help.add(about);
setVisible(true);
}
void AksiReaksi()
{
input.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
}
String nama;
nama==JOptionPane.showInputDialog(null."Masukkan nama anda", "Data Personalia",JOptionPane.INFORMATION_MESSAGE);
JOptionPane.showMessageDialog(null,"Hallo"+nama);
}});
edit.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e);
{
isidata.KomponenVisual();
isidata.AksiReaksi();
}});
quit.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e);
{
System.exit(0);
}});
about.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e);
{
tentangku.KomponenVisual();
}});}
public static void main(String args[])
{
Aplikasi_Event_Menu AEM=new Aplikasi_Event_Menu();
AEM.KomponenVisual();
AEM.AksiReaksi();
}}
No comments:
Write comments