JDK-4654715 : Toolkit.getScreenInsets() returns incorrect insets on secondary monitor.
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 1.4.1
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_2000
  • CPU: x86
  • Submitted: 2002-03-19
  • Updated: 2002-05-13
  • Resolved: 2002-05-13
Related Reports
Duplicate :  
Description

Name: azR10139			Date: 03/19/2002


Place secondary monitor on the left side of the main monitor. Put the taskbar to the left side of the secondary monitor. Turn 'autohide' option of the taskbar off. Run the testcase below. Drag test frame to the secondary monitor. Click the button. Note that left inset is negative.
--- Bug.java ---
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;

public class Bug extends JFrame{
    public Bug(){
        JButton jButton = new JButton();
        jButton.setText("click me");
        jButton.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                Toolkit tk = Toolkit.getDefaultToolkit();
                GraphicsConfiguration gc = getGraphicsConfiguration();
                System.out.println("Insets is: " + 
                    tk.getScreenInsets(gc));
                System.out.println("");
            }
        });
        this.getContentPane().add(jButton, BorderLayout.SOUTH);
        this.setSize(new Dimension(200, 200));
        this.setVisible(true);
    }

    public static void main(String[] args) throws Exception	{
        Bug bug = new Bug();
    }
}
--------------
======================================================================

Comments
WORK AROUND Name: azR10139 Date: 03/19/2002 Insets insets = toolkit.getScreenInsets(gc); ======================================================================
11-06-2004

EVALUATION Possibly a duplicate of 4654713. ###@###.### 2002-03-19
19-03-2002