Don't think you can do this directly tvia the Java API, as there is no
implementation for JFrame.setState(JFrame.MAXIMIZED).  If you look at Suns
bug parade you'll see quite a few references to this (Bug Id 4071554,
4198845, ...).  I noticed somewhere else on Sun's site that they were to
implement this within 1.3 but that doesn't seem to be the case.

As mentioned within 4198845 you could write yourself a JNI method to do this
in Win32:

HWND hWnd = FindWindow("SunAwtFrame", "MyWindow");
ShowWindow(hWnd, SW_MAXIMIZED);

Hope that helps.

Cheers,

        Jonathan
--

Jonathan Oddy
SERVICEPower Business Solutions Ltd
Petersgate House - St Petersgate - Stockport - SK1 1HE
Tel  : +44 (0)161 476 2277
Email: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>  



> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: 02 May 2001 07:42
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: Maximizing a JFrame in a Win32 environment.
> 
> 
> Hi
> 
> Our application is running under JDK 1.1.8 / Swing 1.1.1 in various
> environments.
> 
> The topframe is a JFrame which is being 'maximized' using this code:
> 
> this.move(0,0);
> resize(Toolkit.getDefaultToolkit().getScreenSize());
> 
> This works fine for all other environments than Win32. Under Win32 it
> doesn't respect the toolbar.
> 
> If the user either selects the maximize button or selects 
> maximize from
> system menu, it works as it is supposed to.
> 
> anybode knows how to send the 'maximize me' message to the 
> JFrame, or a
> hack that wil work the same way?
> 
> (i have tried by guessing the size of  the toolbar and 
> subtracting that
> from the toolkit screensize, but that it not always correct 
> or maybe the
> user has a doublesize toolbar).
> 
> thanks in advance and kind regards
> 
> Peter Tilsted
> Projekt Storkundel�nsomhed, 5094
> tlf: +45 3333 4982
> Email: [EMAIL PROTECTED]
> 
> _______________________________________________
> Swing mailing list
> [EMAIL PROTECTED]
> http://eos.dk/mailman/listinfo/swing
> 
_______________________________________________
Swing mailing list
[EMAIL PROTECTED]
http://eos.dk/mailman/listinfo/swing

Reply via email to