Exemplo n.º 1
0
  private void createCustomerMenu() {

    // Customer menu
    customerMenu = new JMenu("Customer");
    customerMenu.setMnemonic(KeyEvent.VK_C);
    customerMenu.setToolTipText("Customer");
    add(customerMenu);

    // Customer/View All Customers menu item
    viewAllCustomersMenuItem = new JMenuItem("View All Customers");
    viewAllCustomersMenuItem.setToolTipText("View all customers.");
    viewAllCustomersMenuItem.setActionCommand("MainMenu--View All Customers");
    viewAllCustomersMenuItem.addActionListener(actionListener);
    customerMenu.add(viewAllCustomersMenuItem);
  } // end of MainMenu::createCustomerMenu
Exemplo n.º 2
0
  private void createFileMenu() {

    // File menu
    fileMenu = new JMenu("File");
    fileMenu.setMnemonic(KeyEvent.VK_F);
    fileMenu.setToolTipText("File");
    add(fileMenu);

    // File/Exit menu item
    exitMenuItem = new JMenuItem("Exit");
    exitMenuItem.setMnemonic(KeyEvent.VK_X);
    exitMenuItem.setToolTipText("Exit the program.");
    exitMenuItem.setActionCommand("MainMenu--Exit");
    exitMenuItem.addActionListener(actionListener);
    fileMenu.add(exitMenuItem);
  } // end of MainMenu::createFileMenu
Exemplo n.º 3
0
  private void createHelpMenu() {

    // Help menu
    helpMenu = new JMenu("Help");
    helpMenu.setMnemonic(KeyEvent.VK_H);
    helpMenu.setToolTipText("Help");
    add(helpMenu);

    // Help/About menu item
    aboutMenuItem = new JMenuItem("About");
    aboutMenuItem.setMnemonic(KeyEvent.VK_A);
    aboutMenuItem.setToolTipText("Display the About window.");
    aboutMenuItem.setActionCommand("MainMenu--Display About");
    aboutMenuItem.addActionListener(actionListener);
    helpMenu.add(aboutMenuItem);

    // Help/Help menu item
    helpMenuItem = new JMenuItem("Help");
    helpMenuItem.setMnemonic(KeyEvent.VK_H);
    helpMenuItem.setToolTipText("Display the Help window.");
    helpMenuItem.setActionCommand("MainMenu--Display Help");
    helpMenuItem.addActionListener(actionListener);
    helpMenu.add(helpMenuItem);
  } // end of MainMenu::createHelpMenu
Exemplo n.º 4
0
  /** The graphic handling and deployment. */
  private void initComponents() {
    jDesktopPane1 = new javax.swing.JDesktopPane();
    jInternalFrame1 = new javax.swing.JInternalFrame();
    tf = new javax.swing.JTextField();
    b1 = new javax.swing.JButton();
    jInternalFrame3 = new javax.swing.JInternalFrame();
    ta = new javax.swing.JTextArea();
    jsp_ta = new javax.swing.JScrollPane(ta);
    jMenuBar1 = new javax.swing.JMenuBar();
    jMenu1 = new javax.swing.JMenu();
    jMenuItem3 = new javax.swing.JMenuItem();
    jSeparator1 = new javax.swing.JSeparator();
    jMenuItem4 = new javax.swing.JMenuItem();

    jInternalFrame1
        .getContentPane()
        .setLayout(
            new javax.swing.BoxLayout(
                jInternalFrame1.getContentPane(), javax.swing.BoxLayout.X_AXIS));

    jInternalFrame1.setIconifiable(true);
    jInternalFrame1.setMaximizable(true);
    jInternalFrame1.setResizable(true);
    jInternalFrame1.setTitle("Message editor");
    jInternalFrame1.setToolTipText(
        "Move and resize all of these to make the chat room appearance match your preferences.");
    jInternalFrame1.setVisible(true);
    tf.setFont(new java.awt.Font("Lucida Sans", 0, 12));
    jInternalFrame1.getContentPane().add(tf);

    b1.setText("Send Message");
    jInternalFrame1.getContentPane().add(b1);

    jInternalFrame1.setBounds(10, 10, 440, 60);
    jDesktopPane1.add(jInternalFrame1, javax.swing.JLayeredPane.DEFAULT_LAYER);

    jInternalFrame3.setIconifiable(true);
    jInternalFrame3.setMaximizable(true);
    jInternalFrame3.setResizable(true);
    jInternalFrame3.setTitle("Messages");
    jInternalFrame3.setToolTipText(
        "Move and resize all of these to make the chat room appearance match your preferences.");
    jInternalFrame3.setVisible(true);
    ta.setBackground(new Color(255, 255, 255));
    ta.setEditable(false);
    ta.setFont(new java.awt.Font("Lucida Sans", 0, 12));
    // jsp_ta.setAutoscrolls(true);
    jsp_ta.setDoubleBuffered(true);

    jInternalFrame3.getContentPane().add(jsp_ta, java.awt.BorderLayout.CENTER);

    jInternalFrame3.setBounds(10, 80, 420, 240);

    jDesktopPane1.add(jInternalFrame3, javax.swing.JLayeredPane.DEFAULT_LAYER);

    getContentPane().add(jDesktopPane1, java.awt.BorderLayout.CENTER);

    jMenu1.setText("Private room options");
    jMenu1.setMnemonic(KeyEvent.VK_O);
    jMenu1.setToolTipText("Choose some options.");
    jMenuItem3.setText("Save conversation");
    jMenuItem3.setMnemonic(KeyEvent.VK_S);
    jMenuItem3.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S, ActionEvent.CTRL_MASK));
    jMenu1.add(jMenuItem3);
    jMenu1.add(jSeparator1);
    jMenuItem4.setText("Exit");
    jMenuItem4.setMnemonic(KeyEvent.VK_E);
    jMenuItem4.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_E, ActionEvent.CTRL_MASK));
    jMenu1.add(jMenuItem4);
    jMenuBar1.add(jMenu1);
    setJMenuBar(jMenuBar1);

    this.pack();

    b1.addActionListener(this);
    tf.addActionListener(this);
    jMenuItem3.addActionListener(this);
    jMenuItem4.addActionListener(this);

    posx = (int) Math.random() * 640;
    posy = (int) Math.random() * 480;

    this.pack();
    this.setSize(dimx, dimy);
    this.setLocation(posx, posy);
    this.show();
  }