United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-4924243 : Tooltip issue when using dual monitor (dual head) configuration.

Details
Type:
Bug
Submit Date:
2003-09-17
Status:
Closed
Updated Date:
2006-07-21
Project Name:
JDK
Resolved Date:
2006-07-13
Component:
client-libs
OS:
windows_xp
Sub-Component:
javax.swing
CPU:
x86
Priority:
P4
Resolution:
Duplicate
Affected Versions:
1.4.0,1.4.2
Fixed Versions:

Related Reports
Duplicate:

Sub Tasks

Description
Name: jk109818			Date: 09/17/2003


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

FULL OS VERSION :
Version 5.1 (Build 2600 xpsp 1.020828-1920 : Service Pack 1)

EXTRA RELEVANT SYSTEM CONFIGURATION :
Multiple monitors Each with a resolution of 1280x1024, ATI RADEON 7500 Series.

A DESCRIPTION OF THE PROBLEM :
If a window is initiated on a second monitor, (with setLocation(); setVisible()), tool tips will appear on the right edge of the first monitor rather than under the component they are associated with.

If the window is moved to the first monitor and back again it works fine. The error only occurs if the window is originally positioned on the second monitor.

Another interesting thing if the code is compiled with 1.3 compiler or earlier. Then activating the File menu causes the drop down menu to be right justified. Again moving to the first monitor and back removes the problem.

This is a twist on bug 4647105.

Also, in earlier versions of dual monitor problems combo boxes were poping up rather than down. This behavior seems to have been properly fixed.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run the sample code and hover over the File menu.

Compile the code with 1.3 or earlier and select the file menu to produce the right justified drop down menu.

Sample code asumes you have dual monitors with the first monitor on the left, second on the right. The call to setLocaton() may need to be adjusted based on the resolution of your monitors.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
  Tooltips should appear relative to the component they are associated with. Drop down menus should be left justified.
ACTUAL -
  Tool tips are on wrong monitor, drop down menus are right justified.

REPRODUCIBILITY :
This bug can be reproduced always.

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

public class MenuBugFrame extends JFrame {
    JMenuBar menuBar1 = new JMenuBar();
    JMenu menuFile = new JMenu();
    JMenuItem menuFileExit = new JMenuItem();
    BorderLayout borderLayout1 = new BorderLayout();

    //Construct the frame
  public MenuBugFrame() {
        try  {
            jbInit();
        }
        catch(Exception e) {
            e.printStackTrace();
        }
    }

    //Component initialization
  private void jbInit() throws Exception  {
        this.getContentPane().setLayout(borderLayout1);
        this.setSize(new Dimension(400, 300));
        this.setTitle("Menu Bug");
        menuFile.setToolTipText("Tip on wrong monitor.");
        menuFile.setText("File");
        menuFileExit.setText("Exit");
        menuBar1.setToolTipText("Text on wrong monitor.");
        menuFile.add(menuFileExit);
        menuBar1.add(menuFile);
        this.setJMenuBar(menuBar1);
    }

    //Main method
    public static void main(String[] args) {
        MenuBugFrame frame = new MenuBugFrame();
        frame.pack();
        frame.setSize(200, 200);
        frame.setLocation(new Point(1400, 0));
        frame.setVisible(true);
    }
}

---------- END SOURCE ----------
(Incident Review ID: 188612) 
======================================================================

                                    

Comments
EVALUATION

This is a duplicate of 4868278. Refer to 4868278 for more information.
                                     
2006-07-13
EVALUATION

Tooltip placement is Swing's (or possibly AWT) responsibility. 
Reassigning to Swing team.

###@###.### 2003-09-17
                                     
2003-09-17



Hardware and Software, Engineered to Work Together