This discussion is archived
1 2 Previous Next 22 Replies Latest reply: Feb 21, 2007 6:52 AM by 807599 RSS

Not sure how to write this, but I might need parent class instance

807599 Newbie
Currently Being Moderated
public class SimpleBrowser extends BrowserBean { // BrowserBean extends JFrame

  class LayoutManager {

      /**
         * Handle {@link #urlLabelText} to change color if {@link java.net.URL} displayed is not {@link #homeURL}
         */
        private void handleURLLabelText() {
            l = new JLabel(urlLabelText);
            if (getURL() != null && getHomeURL() != null && !getURL().equals(getHomeURL())) {
                l.setForeground(Color.RED);
                JOptionPane.showConfirmDialog(this.getClass().getSuperclass(),
                        "Do you wish to set \"" + getURLPath() + "\" as your default homepage?",
                        "Set as new homepage",
                        JOptionPane.OK_CANCEL_OPTION);
            }
        }
    }
}
I am trying to correctly use JOptionPane.showConfirmDialog() in order to set up an confirm option pane embedded internally into the instance of the class SimpleBrowser. However, upon doing so I get the following compiler error:

>
Cannot find symbol
symbol: method showConfirmDialog(java.lang.Class< capture of ? super capture of ? extends com.ppowell.tools.ObjectTools.SimpleBrowser.LayoutManager >,java.lang.String,java.lang.String,int)
location: class javax.swing.JOptionPane


Not sure exactly what I need to put into showConfirmDialog() to make it work, based on the architecture above, what do you recommend?

Thanks
Phil
1 2 Previous Next