Toolkit.getScreenInsets() returns incorrect insets on secondary monitor.

XMLWordPrintable

    • Type: Bug
    • Resolution: Duplicate
    • Priority: P4
    • None
    • Affects Version/s: 1.4.1
    • Component/s: client-libs
    • x86
    • windows_2000



      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();
          }
      }
      --------------
      ======================================================================

            Assignee:
            Brent Christian
            Reporter:
            Alexander Zuev
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: