Skip to main content

JXFrame does not honor setExtendedState()

3 replies [Last post]
jacek
Offline
Joined: 2003-08-22
Points: 0

I'm having something weird going...trying to build a simple Swing framework on top of JNDC components.

If I inherit my main app frame from JXFrame and call setExtendedState(JFrame.MAXIMIZED_BOTH) in the main() it still opens in regular, preferred size.

If I inherit my frame directly from the regular JFrame instead then everything works fine.

Any ideas? Am I missing something obvious here or is it a potential bug?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
ronaldtm
Offline
Joined: 2003-07-18
Points: 0

Of course, look at its setVisible() method:

[code]
/**
* Overloaded to pack when visible is true.
*/
public void setVisible(boolean visible) {
if (visible) {
pack();
}
super.setVisible(visible);
}
[/code]

Why is this default?

jacek
Offline
Joined: 2003-08-22
Points: 0

Looks like a bug to me...it shouldn't pack automatically when someone makes it visible, especially since most people run apps maximized....

jacek
Offline
Joined: 2003-08-22
Points: 0

any response from the JNDC team as to why this behaviour was implemented?