Java Swing Menu Item faqMenuItem()

Here you can find the source of faqMenuItem()

Description

faq Menu Item

License

Open Source License

Declaration

protected static JMenuItem faqMenuItem() 

Method Source Code

//package com.java2s;
/*//from  ww  w.  j  av  a  2 s  .c  o m
 Copyright (C) 2009  Dan Cardin redbeardtechnologies@gmail.com

 This program is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation, either version 3 of the License, or
 (at your option) any later version.

 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.

 You should have received a copy of the GNU General Public License
 along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JMenuItem;
import javax.swing.JOptionPane;

public class Main {
    protected static JMenuItem faqMenuItem() {

        JMenuItem menu_item = new JMenuItem("Frequently Asked Questions");

        /*Action Listener for Displaying the tutorial*/
        menu_item.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent event) {
                JOptionPane
                        .showMessageDialog(
                                null,
                                "Add a gap - hold down the shift key and left mouse button; drag the mouse to the right\n"
                                        + "Remove a gap - hold down the shift key and left mouse button; drag the mouse to the left\n"
                                        + "Zoom in - hold down the right mouse button and drag it to the right\n"
                                        + "Zoom out - hold down the right mouse button and drag it to the left\n"
                                        + "Pan - hold down left mouse button and move mouse\n",
                                "Frequently Asked Questions",
                                JOptionPane.PLAIN_MESSAGE);
            }
        });

        return menu_item;
    }
}

Related

  1. createMenuItem(String strTitle, String strActionCommand, ActionListener alListener)
  2. createMenuItem(String text, boolean visible)
  3. createMenuItem(String text, Icon icon, String toolTip, ActionListener... listeners)
  4. createMenuItem(T source, int mnemonic, String description, E action)
  5. createRadioButtonMenuItem(final String text, final boolean selected)
  6. findMenuItem(Container container, String[] path)
  7. getExitMenuItem()
  8. getMenuItem(Container container, Action action)
  9. getMenuItem(Container owner, String text)