java.net.URL url; JButton b;
    public void resetButtons(boolean enableBackButton,                             boolean enableForwardButton) {        java.net.URL url;        JButton b;        if (backIcon == null) {            url = getClass().getResource(backName);            backIcon = new ImageIcon(url);        }        if (dimBackIcon == null) {            url = getClass().getResource(dimBackName);            dimBackIcon = new ImageIcon(url);        }        if (forwardIcon == null) {            url = getClass().getResource(forwardName);            forwardIcon = new ImageIcon(url);        }        if (dimForwardIcon == null) {            url = getClass().getResource(dimForwardName);            dimForwardIcon = new ImageIcon(url);        }        ImageIcon active;        String toolTip;        String disabled = " ("                + i18n.get(ProjectionStackTool.class, "disabled", "disabled")                + ")";        int size;        toolTip = i18n.get(ProjectionStackTool.class,                "backTip",                "Go back to previous projection");        if (enableBackButton) {            active = backIcon;        } else {            active = dimBackIcon;            toolTip += " " + disabled;        }        if (backButton == null) {            backButton = new JButton(active);            backButton.setMargin(new Insets(0, 0, 0, 0));            backButton.setBorderPainted(false);            backButton.setActionCommand(ProjectionStack.BackProjCmd);            if (listeners != null) {                size = listeners.size();                for (int i = 0; i < size; i++) {                    backButton.addActionListener((ActionListener) listeners.elementAt(i));                }            }        } else {            backButton.setIcon(active);        }        backButton.setToolTipText(toolTip);        toolTip = i18n.get(ProjectionStackTool.class,                "forwardTip",                "Go forward to next projection");        if (enableForwardButton) {            active = forwardIcon;        } else {            active = dimForwardIcon;            toolTip += " " + disabled;        }        if (forwardButton == null) {            forwardButton = new JButton(active);            forwardButton.setMargin(new Insets(0, 0, 0, 0));            forwardButton.setBorderPainted(false);            forwardButton.setActionCommand(ProjectionStack.ForwardProjCmd);            if (listeners != null) {                size = listeners.size();                for (int i = 0; i < size; i++) {                    forwardButton.addActionListener((ActionListener) listeners.elementAt(i));                }            }        } else {            forwardButton.setIcon(active);        }        forwardButton.setToolTipText(toolTip);        // if (clearButton == null) {        // clearButton = new JButton("Clear Stack");        // clearButton.setMargin(new Insets(0,0,0,0));        // clearButton.setBorderPainted(false);        // clearButton.setActionCommand(ProjectionStack.ClearStacksCmd);        // if (listeners != null) {        // size = listeners.size();        // for (int i = 0; i < size; i++) {        // clearButton.addActionListener((ActionListener)listeners.elementAt(i));        // }        // }        // }    }