Re: Taskbar hides when Swing GUI gets maximized



"Goofball" <yuriytkach@xxxxxxxxx> wrote in news:1176306362.928077.52620
@e65g2000hsc.googlegroups.com:

When I maximize a JFrame that was created in the application, it hides
the Windows taskbar. I am using default Swing Look and Feel decorated
windows. Anybody knows how the problem can be fixed? Thanks.


Try this :
import java.awt.*;
import javax.swing.*;

public class TestMaxJFrame extends JFrame {
public TestMaxJFrame() {
GraphicsEnvironment env =
GraphicsEnvironment.getLocalGraphicsEnvironment();
/*
The next line determines if the taskbar (win) is covered.
*/
this.setMaximizedBounds
(env.getMaximumWindowBounds()); // taskbar not covered
this.setExtendedState(this.getExtendedState() | this.MAXIMIZED_BOTH);
}

public static void main(String[] args) {
JFrame.setDefaultLookAndFeelDecorated(true);
TestMaxJFrame t = new TestMaxJFrame();
t.setVisible(true);
}
}

Bye.
--
Real Gagnon from Quebec, Canada
* Java, Javascript, VBScript and PowerBuilder code snippets
* http://www.rgagnon.com/howto.html
* http://www.rgagnon.com/bigindex.html
.



Relevant Pages

  • Re: Can order of buttons on taskbar be changed?
    ... Taskbar Commander, ... Rearrange the display order of your programs within your Windows taskbar: ...
    (microsoft.public.windowsxp.general)
  • Re: MS-Access ?
    ... but sources tell me that you can find it by hitting the MS Office button and choosing Access Options - it should be somewhere in there. ... Tools, Options, View tab and uncheck 'Windows in Taskbar' ... When I open a Access database is will appear in the Windows Taskbar. ...
    (microsoft.public.access.setupconfig)
  • Re: apps disapper when minimized
    ... When an app is minimized all that would be left visible is ... its icon on the taskbar. ... on the Windows taskbar and choose the cascade choice ...
    (microsoft.public.office.misc)
  • Re: the shortcut bar shouldnt have been dropped after office xp
    ... Taskbar - the bar where you can make shortcuts to other items, folders, apps, documents... ... On the Windows taskbar grab the resizing handle on any toolbar and drag it to any other edge of the screen. ... Roland Schorr & Tower ... Microsoft OneNote FAQ: http://www.factplace.com/onenotefaq.htm ...
    (microsoft.public.office.setup)
  • Re: Re-arranging programs in taskbar
    ... Rearrange the display order of your programs within your Windows taskbar: ... Elias Fotinis TaskArrange:: Arrange the Windows taskbar buttons: ...
    (microsoft.public.windowsxp.customize)