import javax.swing.*;
import java.awt.*;
class Menu extends JFrame {
JMenuBar menuBar;
JMenu file, prodi;
JMenuItem exit, about,ka, mi;
JLabel teks;
JCheckBox cbomi, cboka;
JPanel panel;
public Menu () {
setTitle ("Menu");
setSize (200,200) ;
file = new JMenu("File");
file.setMnemonic ( 'F' ) ;
prodi = new JMenu("Prodi") ;
prodi.setMnemonic ('P' ) ;
exit = new JMenuItem("Exit") ;
exit.setAccelerator (KeyStroke.getKeyStroke(KeyEvent.VK_X, ActionEvent.CTRL_MASK) ) ;
about = new JMenuItem("About");
about.setAccelerator (KeyStroke.getKeyStroke(KeyEvent.VK_F, ActionEvent.CTRL_MASK) ) ;
mi = new JMenuItem("MI") ;
mi.setAccelerator (KeyStroke.getKeyStroke(KeyEvent.VK_D, ActionEvent.CTRL_MASK) ) ;
ka = new JMenuItem("KA") ;
ka.setAccelerator (KeyStroke.getKeyStroke(KeyEvent.VK_P, ActionEvent.CTRL_MASK) ) ;
teks = new JLabel ("Prodi Yang Anda Pilih...");
panel = new JPanel (new FlowLayout());
cbomi = new JCheckBox("Manajemen Informatika");
cboka = new JCheckBox("Komputerisasi Akutansi");
ButtonGroup group = new ButtonGroup();
group.add(cbomi);
group.add(cboka);
setLayout(new BorderLayout());
add(teks,"North");
add(panel,"West");
panel.add(cbomi);
panel.add(cboka);
menuBar = new JMenuBar ();
setJMenuBar (menuBar ) ;
menuBar.add(file) ;
file.add(about);
file.add(exit);
menuBar.add (prodi) ;
prodi.add (mi ) ;
prodi.add (ka) ;
add(teks,"North");
add(cbomi,"West");
add(cboka,"East");
exit.addActionListener (new ActionListener ( ) {
public void actionPerformed(ActionEvent e) {
System.exit (0) ;
}
}
);
about.addActionListener (new ActionListener () {
public void actionPerformed(ActionEvent e) {
new Fbiodata() ;
}
}
);
mi.addActionListener (new ActionListener () {
public void actionPerformed(ActionEvent e) {
new FFrame1 () ;
}
}
);
ka.addActionListener (new ActionListener () {
public void actionPerformed(ActionEvent e) {
new Fka () ;
}
}
);
cbomi.addActionListener (new ActionListener () {
public void actionPerformed(ActionEvent e) {
new FFrame1 () ;
}
}
);
cboka.addActionListener (new ActionListener () {
public void actionPerformed(ActionEvent e) {
new Fka () ;
}
}
);
pack();
setLocation(200,200);
setDefaultCloseOperation (EXIT_ON_CLOSE) ;
setVisible (true) ;
}}
public class mainmenuprodi {
public static void main(String [] neno) {
new Menu();
}
}
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
class FFrame1 extends JFrame implements ActionListener{
JLabel tex1 = new JLabel(" Manajemen Informatika dan jurusan ini ada pada AMIK TUNAS BANGSA PEMATANGSIANTAR");
public FFrame1 () {
super ("MANAJEMEN INFORMATIKA");
setSize (200,100) ;
setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE) ;
setLayout(new FlowLayout());
add(tex1);
pack();
setVisible (true);
}
public void actionPerformed (ActionEvent e) {
if (e.getSource()==tex1){
dispose();
}
}
}
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
class Fka extends JFrame implements ActionListener{
JLabel tex3 = new JLabel("KA adalah jurusan khusus memperdalam ilmu akuntansi secara komputer");
public Fka () {
super ("KOMPUTERISASI AKUNTANSI");
setSize (200,100) ;
setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE) ;
setLayout(new FlowLayout());
add(tex3);
pack();
setVisible (true);
}
public void actionPerformed (ActionEvent e) {
if (e.getSource()==tex3){
dispose();
}
}
}