title: How to get the maximised size of the Jframe which has the JDesktopPane also maximized.?
body: <p>I have a "Login internal frame" displayed while launching the application.But the problem is it does'nt appear centered in the screen of the application.</p>
  
  <p>My code to get the actual size of the desktop and setting location of the JInternalFrame is as follows</p>
  
  <p>private void new_init() {</p>
  
  <pre><code>  LoginInternal login = new LoginInternal(jMenuBar1); 
    Dimension desktopSize = this.getSize();
    Dimension jInternalFrameSize = login.getSize();
    System.out.println("desktopSize: "+desktopSize+" jInternalFrameSize:" +jInternalFrameSize );
    jMenuBar1.setVisible(false);
    login.setLocation((desktopSize.width - jInternalFrameSize.width)/2,(desktopSize.height- jInternalFrameSize.height)/2);
    jDesktopPane1.add(login); 
    login.show();
  }
  </code></pre>
  
  <p>My screen resolution is 1366x768.
  But according to the print I have put </p>
  
  <p>"desktopSize: java.awt.Dimension[width=1024,height=768] jInternalFrameSize:java.awt.Dimension[width=398,height=286]"</p>
  
  <p>I get the resolution as 1024x768. 
  In pre-init code of JDesktopPane,I have set "setExtendedState (JFrame.MAXIMIZED_BOTH);"</p>
  
  <p>Now I get the both opened in maximised mode but the login frame is not centered as it takes the centering logic with resolution "[width=1024,height=768]".If it takes my current screen resolution I think it will be centered.</p>
  
  <p>I hope i made it clear. Where iam going wrong?</p>