Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4803767

Top level decorated windows don't respect window drag mode on Windows.

XMLWordPrintable

    • Fix Understood
    • x86
    • windows_nt

      Name: rmT116609 Date: 01/15/2003


      FULL PRODUCT VERSION :
      java version "1.4.1_01"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1_01-b01)
      Java HotSpot(TM) Client VM (build 1.4.1_01-b01, mixed mode)

      FULL OPERATING SYSTEM VERSION :Windows NT Version 4.0


      A DESCRIPTION OF THE PROBLEM :
      Top Level frames need to have the ability to set OUTLINE DRAGGING on and off. OUTLINE DRAGGING is currently only available with the Windows L&F.

      If one wants to use their own L&F with JFrame.setDefaultLookAndFeelDecorated(true) then there is no way to set OUTLINE DRAGGING. These can cause performance issues when resizing the JFrame as it is
      continually repainted.

      A good description of the problem with a code example can be found in the Project Swing forum.

      http://forum.java.sun.com/thread.jsp?forum=57&thread=228778

      This posting is unanswered.

      ---------- BEGIN SOURCE ----------
      import java.awt.*;
      import java.awt.event.*;
      import javax.swing.*;

      public class JTestFrame extends JFrame
      {

        public static void main(String args[])
        {
      new JTestFrame().show();
        }
        private JMenuBar menuBar = new JMenuBar();

        public JTestFrame()
        {
            super("Java is cool");
            // Get the pane to add components to
            Container content = getContentPane();
            // Resize the frame
            Toolkit kit = getToolkit();
            Dimension wndSz = kit.getScreenSize();
            setBounds(wndSz.width/4, wndSz.height/4, wndSz.width/2, wndSz.height/2);

            // Make the frame use its look&feel for its border
            setUndecorated(true);
            getRootPane().setWindowDecorationStyle(JRootPane.FRAME);

            // Make a menu for no other purpose than making a menu
            JMenu fileMenu = new JMenu("File");
            fileMenu.setMnemonic(KeyEvent.VK_F);
            JMenuItem fileExitMenuItem = new JMenuItem("Exit");
            fileExitMenuItem.setMnemonic(KeyEvent.VK_X);

            fileExitMenuItem.addActionListener(new ActionListener()
            {
                  public void actionPerformed(ActionEvent e)
                  {
                       System.exit(0);
                  }
            });

            fileMenu.add(fileExitMenuItem);
            menuBar.add(fileMenu);
            JTextArea text = new JTextArea();
            getContentPane().add(new JScrollPane(text), BorderLayout.CENTER);
            setJMenuBar(menuBar);

            // Set the default close operation to exit the application
            setDefaultCloseOperation(EXIT_ON_CLOSE);
        }
      }


      ---------- END SOURCE ----------
      (Review ID: 179851)
      ======================================================================

            Unassigned Unassigned
            rmandalasunw Ranjith Mandala (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Imported:
              Indexed: