2 Replies Latest reply on Dec 22, 2003 7:27 PM by 807587

    JInternalFrame setMaximum() and NullPointerException

    807587
      Does anyone know the cause of this exception when I try to maximise a JInternalFrame?

      java.lang.NullPointerException
           at javax.swing.DefaultDesktopManager.maximizeFrame(Unknown Source)
           at javax.swing.plaf.basic.BasicInternalFrameUI.maximizeFrame(Unknown Source)
           at javax.swing.plaf.basic.BasicInternalFrameUI$InternalFramePropertyChangeListener.propertyChange(Unknown Source)
           at javax.swing.event.SwingPropertyChangeSupport.firePropertyChange(Unknown Source)
           at javax.swing.event.SwingPropertyChangeSupport.firePropertyChange(Unknown Source)
           at javax.swing.JComponent.firePropertyChange(Unknown Source)
           at javax.swing.JInternalFrame.setMaximum(Unknown Source)
           at com.jim.league.view.CreateLeagueFrame.init(CreateLeagueFrame.java:38)
      <snip>

      The code:
           public void init(){
                setLocation(0,0);
                //Dimension desktopSize = parent.getSize();
                //setSize(desktopSize);
                try{
                     this.setMaximizable(true);
                     setMaximum(true);
                } catch(Exception ex){
                     ex.printStackTrace();
                }
      <snip>
      Thanks,

      Jim