//package mojpaket; import javax.swing.*; import java.awt.*; /** * @author Ivan */ public class Meni extends javax.swing.JFrame { /** * Creates new form Meni */ public Meni() { initComponents(); } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ private void initComponents() { jMenuBar1 = new javax.swing.JMenuBar(); jMenuForme = new javax.swing.JMenu(); jMenuKupci = new javax.swing.JMenuItem(); jMenuProizvodi = new javax.swing.JMenuItem(); jMenuTipProizvoda = new javax.swing.JMenuItem(); jMenuPorudzbine = new javax.swing.JMenuItem(); jMenuIzadji = new javax.swing.JMenuItem(); jMenuPomoc = new javax.swing.JMenu(); jMenuInformacija = new javax.swing.JMenuItem(); getContentPane().setLayout(null); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setTitle("Navigacija na forme"); //dimenzije java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize(); setBounds((screenSize.width-250)/2, (screenSize.height-200)/2, 250, 200); //prvi meni Forme jMenuForme.setText("Forme"); //Kupci jMenuKupci.setText("Kupci"); jMenuKupci.addActionListener(new java.awt.event.ActionListener(){ public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuKupciActionPerformed(evt); } }); jMenuForme.add(jMenuKupci); //Proizvodi jMenuProizvodi.setText("Proizvodi"); jMenuProizvodi.addActionListener(new java.awt.event.ActionListener(){ public void actionPerformed(java.awt.event.ActionEvent evt){ jMenuProizvodiActionPerformed(evt); } }); jMenuForme.add(jMenuProizvodi); //Tip Proizvoda jMenuTipProizvoda.setText("Tipovi proizvoda"); jMenuTipProizvoda.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt){ jMenuTipProizvodaActionPerformed(evt); } }); jMenuForme.add(jMenuTipProizvoda); //Porudzbine jMenuPorudzbine.setText("Porudžbine"); jMenuPorudzbine.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt){ jMenuPorudzbineActionPerformed(evt); } }); jMenuForme.add(jMenuPorudzbine); jMenuForme.addSeparator(); //Izadji jMenuIzadji.setText("Izadi"); jMenuIzadji.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt){ jMenuIzadjiActionPerformed(evt); } }); jMenuForme.add(jMenuIzadji); jMenuBar1.add(jMenuForme); //Drugi meni Pomoc jMenuPomoc.setText("Pomoc"); //Informacija jMenuInformacija.setText("O programu"); jMenuInformacija.addActionListener(new java.awt.event.ActionListener(){ public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuOprogramuActionPerformed(evt); } }); jMenuPomoc.add(jMenuInformacija); setJMenuBar(jMenuBar1); jMenuBar1.add(jMenuPomoc); } private void jMenuKupciActionPerformed(java.awt.event.ActionEvent evt){ // TODO add your handling code here: } private void jMenuProizvodiActionPerformed(java.awt.event.ActionEvent evt){ // TODO add your handling code here: } private void jMenuTipProizvodaActionPerformed(java.awt.event.ActionEvent evt){ // TODO add your handling code here: } private void jMenuPorudzbineActionPerformed(java.awt.event.ActionEvent evt){ // TODO add your handling code here: } private void jMenuIzadjiActionPerformed(java.awt.event.ActionEvent evt){ // TODO add your handling code here: System.exit(0); } private void jMenuOprogramuActionPerformed(java.awt.event.ActionEvent evt) { // TODO add your handling code here: JOptionPane.showMessageDialog( null,"Seminarski rad na temu: Integracija MySQL baze i Java aplikacija","O programu",JOptionPane.INFORMATION_MESSAGE); } /** * @param args the command line arguments */ public static void main(String args[]) { JFrame.setDefaultLookAndFeelDecorated(true); java.awt.EventQueue.invokeLater(new Runnable(){ public void run() { new Meni().setVisible(true); } }); } // Variables declaration - do not modify private javax.swing.JMenuBar jMenuBar1; private javax.swing.JMenu jMenuForme; private javax.swing.JMenuItem jMenuProizvodi; private javax.swing.JMenuItem jMenuIzadji; private javax.swing.JMenu jMenuPomoc; private javax.swing.JMenuItem jMenuInformacija; private javax.swing.JMenuItem jMenuTipProizvoda; private javax.swing.JMenuItem jMenuKupci; private javax.swing.JMenuItem jMenuPorudzbine; // End of variables declaration }