Name: azR10139 Date: 03/19/2002
Run testcase below. Drag window to secondary monitor. Put taskbar on the bottom of the secondary monitor. Turn autohide option of taskbar off. Press button. Move taskbar to the left. Press button again. Note, that in the debug output insets not changed. On primary monitor everything works fine.
--- 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();
}
}
----------------
======================================================================