Board index » jbuilder » maximise swing application window hides windows taskbar

maximise swing application window hides windows taskbar


2004-10-09 02:32:34 AM
jbuilder21
Hi all
Using a JFrame for an application window - when maximised this hides the M$
taskbar - how do I prevent this?
Any assitance would be helpful.
Thanks
David Bolsover
 
 

Re:maximise swing application window hides windows taskbar

I seem to only have this problem using the default or other Metal-based
PLAFs and using JFrame decorations:
JFrame.setDefaultLookAndFeelDecorated(true);
Not using JFrame decorations or switching to the Windows or Motif look
and feel should prevent the taskbar hiding. Note that setting the look
and feel decorations to false for a particular instance of a JFrame
won't solve the problem.
JFrame.setDefaultLookAndFeelDecorated(true);
JFrame f = new JFrame();
f.setDefaultLookAndFeelDecorated(false);
// maximize still hides taskbar
If you aren't using decorations, then I have no idea what your problem
may be.
For reference, my setup:
Microsoft Windows XP [Version 5.1.2600] (SP2)
java version "1.4.2_05"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_05-b04)
Java HotSpot(TM) Client VM (build 1.4.2_05-b04, mixed mode)
Hope this helps,
David Browne
David Bolsover wrote:
Quote
Hi all

Using a JFrame for an application window - when maximised this hides the M$
taskbar - how do I prevent this?

Any assitance would be helpful.

Thanks

David Bolsover


 

Re:maximise swing application window hides windows taskbar

On 10/8/2004 at 2:32:34 PM, David Bolsover wrote:
Quote
Using a JFrame for an application window - when maximised this hides the
M$ taskbar - how do I prevent this?
Is it filling the display when you use the system maximize button on the
JFrame? Or are you trying to maximize the JFrame programmatically?
If the former, that should never happen. If the latter, it should not
happen either, assuming you are actually maximizing the frame, as opposed
to setting the bounds for the frame to the bounds of the display.
You can maximize the frame with the following line of code:
frame.setExtendedState( Frame.MAXIMIZED_BOTH );
This works on JDK 1.4 and later.
--
Regards,
John McGrath [TeamB]
---------------------------------------------------
Before sending me e-mail, please read:
www.JPMcGrath.net/newsgroups/e-mail.html
 

{smallsort}

Re:maximise swing application window hides windows taskbar

David
Many thanks for the info...
I changed the LandF from:
UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
to:
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
.. this has solved the problem for now -- just means I'm stuck with the naff
M$ LandF until I explore some options.
David
"David C. Browne" < XXXX@XXXXX.COM >wrote in
message news:41671188$ XXXX@XXXXX.COM ...
Quote
I seem to only have this problem using the default or other Metal-based
PLAFs and using JFrame decorations:

JFrame.setDefaultLookAndFeelDecorated(true);

Not using JFrame decorations or switching to the Windows or Motif look and
feel should prevent the taskbar hiding. Note that setting the look and
feel decorations to false for a particular instance of a JFrame won't
solve the problem.

JFrame.setDefaultLookAndFeelDecorated(true);
JFrame f = new JFrame();
f.setDefaultLookAndFeelDecorated(false);
// maximize still hides taskbar


If you aren't using decorations, then I have no idea what your problem may
be.

For reference, my setup:

Microsoft Windows XP [Version 5.1.2600] (SP2)

java version "1.4.2_05"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_05-b04)
Java HotSpot(TM) Client VM (build 1.4.2_05-b04, mixed mode)

Hope this helps,
David Browne


David Bolsover wrote:
>Hi all
>
>Using a JFrame for an application window - when maximised this hides the
>M$ taskbar - how do I prevent this?
>
>Any assitance would be helpful.
>
>Thanks
>
>David Bolsover
 

Re:maximise swing application window hides windows taskbar

John
Thanks for the reply..
Problem is when I use the system maximize button on the JFrame.
David Browne has shown the way in his reply to the original post .. looks
like a bug in UIManager.getCrossPlatformLookAndFeelClassName()
db
"John McGrath [TeamB]" < XXXX@XXXXX.COM >wrote in message
Quote
On 10/8/2004 at 2:32:34 PM, David Bolsover wrote:

>Using a JFrame for an application window - when maximised this hides the
>M$ taskbar - how do I prevent this?

Is it filling the display when you use the system maximize button on the
JFrame? Or are you trying to maximize the JFrame programmatically?

If the former, that should never happen. If the latter, it should not
happen either, assuming you are actually maximizing the frame, as opposed
to setting the bounds for the frame to the bounds of the display.

You can maximize the frame with the following line of code:

frame.setExtendedState( Frame.MAXIMIZED_BOTH );

This works on JDK 1.4 and later.

--
Regards,

John McGrath [TeamB]

---------------------------------------------------
Before sending me e-mail, please read:
www.JPMcGrath.net/newsgroups/e-mail.html
 

Re:maximise swing application window hides windows taskbar

On 10/9/2004 at 7:22:28 AM, David Bolsover wrote:
Quote
looks like a bug in UIManager.getCrossPlatformLookAndFeelClassName()
It does look like a bug, but not in
getCrossPlatformLookAndFeelClassName(). That just returns the name of the
cross-platform look-and-feel class, which is the string
"javax.swing.plaf.metal.MetalLookAndFeel".
The problem is not related to the Metal look-and-feel, or for that matter,
to any look-and-feel. When the Frame is set to Undecorated, the window
takes up the entire screen when it is maximized.
It is affected by calling JFrame.setDefaultLookAndFeelDecorated(true), but
that is just a convenience method that asks the look-and-feel to provide
decorations and also sets the Frame to undecorated(), assuming that the
look-and-feel can provide the decorations.
You can find more information on the problem here, including a workaround
for the problem:
bugs.sun.com/bugdatabase/view_bug.do
--
Regards,
John McGrath [TeamB]
---------------------------------------------------
Before sending me e-mail, please read:
www.JPMcGrath.net/newsgroups/e-mail.html
 

Re:maximise swing application window hides windows taskbar

John
Thanks for the link.. yes it solves the problem - I have not made any checks
on speed - but the decorated frame redraw does seen to be slower.
Thanks again.
db
"John McGrath [TeamB]" < XXXX@XXXXX.COM >wrote in message
Quote
On 10/9/2004 at 7:22:28 AM, David Bolsover wrote:

>looks like a bug in UIManager.getCrossPlatformLookAndFeelClassName()

It does look like a bug, but not in
getCrossPlatformLookAndFeelClassName(). That just returns the name of the
cross-platform look-and-feel class, which is the string
"javax.swing.plaf.metal.MetalLookAndFeel".

The problem is not related to the Metal look-and-feel, or for that matter,
to any look-and-feel. When the Frame is set to Undecorated, the window
takes up the entire screen when it is maximized.

It is affected by calling JFrame.setDefaultLookAndFeelDecorated(true), but
that is just a convenience method that asks the look-and-feel to provide
decorations and also sets the Frame to undecorated(), assuming that the
look-and-feel can provide the decorations.

You can find more information on the problem here, including a workaround
for the problem:

bugs.sun.com/bugdatabase/view_bug.do

--
Regards,

John McGrath [TeamB]

---------------------------------------------------
Before sending me e-mail, please read:
www.JPMcGrath.net/newsgroups/e-mail.html
 

Re:maximise swing application window hides windows taskbar

On 10/13/2004 at 2:49:16 PM, David Bolsover wrote:
Quote
Thanks for the link.. yes it solves the problem - I have not made
any checks on speed - but the decorated frame redraw does seen to
be slower.
I presume you are talking about the PFrame class that was posted there.
It seems rather strange that it would affect repaint speed, since none
of the overridden methods have anything to do with repainting.
--
Regards,
John McGrath [TeamB]
---------------------------------------------------
Before sending me e-mail, please read:
www.JPMcGrath.net/newsgroups/e-mail.html