class PrintDpiMenuItem extends JRadioButtonMenuItem
    {
        private static final long serialVersionUID = -475209538362541000L;
        private final int dpi;

        PrintDpiMenuItem(String text, int dpi)
        {
            super(text);
            this.dpi = dpi;
        }
    }

    private static final int[] DPIS = { 0, 100, 200, 300, 600, 1200 };

    private static PrintDpiMenu instance;
    private final JMenu menu;

    /**
     * Constructor.
     */
    private PrintDpiMenu()
    {
        menu = new JMenu("Print dpi");
        ButtonGroup bg = new ButtonGroup();
        for (int dpi : DPIS)
        {
            PrintDpiMenuItem printDpiMenuItem = new PrintDpiMenuItem(dpi == 0 ? "auto" : "" + dpi, dpi);
            bg.add(printDpiMenuItem);
            menu.add(printDpiMenuItem);
        }
        changeDpiSelection(0);
        setMenu(menu);
    }

    /**
     * Provides the DpiMenu instance.
     *
     * @return DpiMenu instance.
     */
    public static PrintDpiMenu getInstance()
    {<FILL_FUNCTION_BODY>

        if (instance == null)
        {
            instance = new PrintDpiMenu();
        }
        return instance;
    
<methods>public void addMenuListeners(java.awt.event.ActionListener) ,public javax.swing.JMenu getMenu() ,public void setEnableMenu(boolean) <variables>private javax.swing.JMenu menu