-
Bug
-
Resolution: Duplicate
-
P3
-
None
-
1.3.0
-
x86
-
windows_2000
Name: rmT116609 Date: 11/28/2000
java version "1.3.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)
A JComboBox pops up rather than down on any monitor other than the primary
monitor on Windows 2000. If the frame with the JComboBox is moved to the
primary monitor it will pop down, if it is placed on any other monitor it will
pop up, regardless of where it is positioned on that monitor.
We were using a Matrox G200 card with three monitors.
There were also problems with menus off of a menu bar being displayed to the
left rather than the right.
File
--------
Open
close
Rather than:
File
----------
Open
Close
Here is the sample code for the combo box problem. Start it up and try the
combo box. Move the window to a different monitor and the combobox pops up not
down.
package demos.combo;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class ComboFrame extends JFrame {
private String[] items = {"Item 1", "Item 2", "Item 3",
"Item 4", "Item 5", "Item 6"};
GridBagLayout gridBagLayout1 = new GridBagLayout();
JComboBox testCB = new JComboBox();
//Construct the frame
public ComboFrame() {
enableEvents(AWTEvent.WINDOW_EVENT_MASK);
try {
jbInit();
testCB.setModel(new DefaultComboBoxModel(items));
}
catch(Exception e) {
e.printStackTrace();
}
}
//Component initialization
private void jbInit() throws Exception {
this.getContentPane().setLayout(gridBagLayout1);
this.setSize(new Dimension(400, 300));
this.setTitle("Pops up not down.");
this.getContentPane().add(testCB, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0 ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
}
//Overridden so we can exit on System Close
protected void processWindowEvent(WindowEvent e) {
super.processWindowEvent(e);
if(e.getID() == WindowEvent.WINDOW_CLOSING) {
System.exit(0);
}
}
public static void main(String[] args) {
ComboFrame frame = new ComboFrame();
frame.setVisible(true);
}
}
(Review ID: 112314)
======================================================================
- duplicates
-
JDK-4312261 JComboBox wrongly "drops up" in multiscreen applications
-
- Closed
-