JDK-4465518 : mult. probs with Metal PLAF-decorated JFrame (restore, maximize, drag, resize)
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 1.4.0
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic,windows_98,windows_2000
  • CPU: generic,x86
  • Submitted: 2001-06-03
  • Updated: 2001-06-22
  • Resolved: 2001-06-22
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
1.4.0 beta2Fixed
Related Reports
Relates :  
Description

Name: krC82822			Date: 06/03/2001


orig synopsis:  "Problem restoring a JFrame's size with LookAndFeelDecorated=true"

java version "1.4.0-beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta-b65)
Java HotSpot(TM) Client VM (build 1.4.0-beta-b65, mixed mode)

The problem seems to happen when maximizing a JFrame with
the property defaultLookAndFeelDecorated=true. Trying to restore the
JFrame to its original size from the restore button will fail.

The problem seeem to occur only with the Metal L&F on Windows 2000.
[Actually, under Solaris, _maximize_ doesn't work, so one never
gets a chance to try (to) restore.  --eval1127@eng, 3 June 2001]

A sample code that demonstrates this problem:

import javax.swing.JFrame;
import javax.swing.UIManager;

public class LaF_Frame extends JFrame
{
  LaF_Frame()
  {
    setSize(600,400);
  }
	
  public static void main(String args[])
  {
    JFrame.setDefaultLookAndFeelDecorated(true);
    new LaF_Frame().show();
  }
}
(Review ID: 125405) 
======================================================================

Name: krC82822			Date: 06/03/2001


java version "1.4.0-beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta-b65)
Java HotSpot(TM) Client VM (build 1.4.0-beta-b65, mixed mode)

Run this program. Click the maximize button. The frame maximizes and the
maximize icon in the title bar changes to 'de-maximize'.
Note the following bugs:

1) Clicking on the de-maximize button in the title bar has _no_ effect.

2) When you move the mouse to the window borders the cursor changes to a resize
   cursor (though one cannot resize the window).
	[see also bug # 4394457]

3) You _can_ drag the window to another position using the title bar. This
   should not be possible.

I don't think this is platform specific, but maybe part of the problem comes
from my dual monitor configuration:
Windows 2000, SP2, Matrox G450 graphics card in true dual head mode (two graphic
adapters visible in window's settings), latest drivers (v5.52).

import javax.swing.*;
public class MaxFrame extends JFrame {
    public static void main(String[] args) {
        JFrame.setDefaultLookAndFeelDecorated(true);
        
        JFrame f  = new JFrame();
               
        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        f.pack();
        f.setBounds(100, 100, 100, 100);
        f.setVisible(true);
    }
}
(Review ID: 125298)
======================================================================

Name: krC82822			Date: 06/03/2001


java version "1.4.0-beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta-b65)
Java HotSpot(TM) Client VM (build 1.4.0-beta-b65, mixed mode)

The new 1.4 Metalworks demo which uses a PLAF decorated frame demonstrates this
problem.  If you maximize the frame, it covers the entire screen even though it
should not cover the Windows taskbar.

Additionally, the frame is still draggable (maximized windows should be locked
in place under Windows), and when dragged you can see that it does not have a border anymore.  The lack of a border may or may not be a problem depending upon whether the frame is ultimately locked in place or not.

The frame also cannot be restored (un-maximized) - clicking the restore button has no effect.
(Review ID: 125446)
======================================================================

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: merlin-beta2 FIXED IN: merlin-beta2 INTEGRATED IN: merlin-beta2
14-06-2004

WORK AROUND Name: krC82822 Date: 06/03/2001 Double click on the title bar will restore the window to its original size. ======================================================================
11-06-2004

EVALUATION The restore problem was fixed in beta-refresh. The problem was even though the window was maximized you are still allowed to move it. When the window is moved the previous bounds are set and restoring the window looks like it isn't doing anything. Maximization doesn't work under CDE since it isn't supported by the window manager. The cursor does change to indicate resize is possible when the window is maximized and it shouldn't. I need to look into the cause of this problem. The maximization problem probably lies within AWT. Recently new API was added to get the insets of a desktop, but it looks like maybe it's not being used yet. joutwate@eng 2001-06-08 The cursor is changing even though the frame is maximized because there wasn't a check in mouseMoved. I've added a check to make sure that the frame isn't maximized before setting the cursor. joutwate@eng 2001-06-13 See bug 4472411 for tracking the maximization problem under windows 2000. joutwate@eng 2001-06-20
13-06-2001