-
Bug
-
Resolution: Unresolved
-
P4
-
None
-
1.4.0, 5.0
-
generic, x86
-
generic, solaris_2.6, windows_2000
Name: gm110360 Date: 10/23/2001
java version "1.4.0-beta3"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta3-b83)
Java HotSpot(TM) Client VM (build 1.4.0-beta3-b83, mixed mode)
When there are more JMenuItems in a JMenu than fit on the screen, the display
behavior is strange. Swing should then display the JMenuItems in more than one
column (like Windows does). Another bug is that the menu is not centered in the
screen if it does not fit on the screen.
import java.awt.*;
import javax.swing.*;
public class Menu {
public static void main (String args[]) {try{
final JFrame frame = new JFrame("Test");
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(200,200);
JMenuBar jmb=new JMenuBar();
JMenu jm=new JMenu("Test Menu");
for(int i=0; i<100; i++)
jm.add(new JMenuItem("Test menu item " + i));
jmb.add(jm);
frame.getContentPane().add(jmb, BorderLayout.NORTH);
frame.getContentPane().add(new JLabel("content"), BorderLayout.CENTER);
frame.setVisible(true);}
catch(Exception e)
{e.printStackTrace();}
}
}
(Review ID: 134251)
======================================================================
###@###.### 10/18/04 14:45 GMT
java version "1.4.0-beta3"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta3-b83)
Java HotSpot(TM) Client VM (build 1.4.0-beta3-b83, mixed mode)
When there are more JMenuItems in a JMenu than fit on the screen, the display
behavior is strange. Swing should then display the JMenuItems in more than one
column (like Windows does). Another bug is that the menu is not centered in the
screen if it does not fit on the screen.
import java.awt.*;
import javax.swing.*;
public class Menu {
public static void main (String args[]) {try{
final JFrame frame = new JFrame("Test");
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(200,200);
JMenuBar jmb=new JMenuBar();
JMenu jm=new JMenu("Test Menu");
for(int i=0; i<100; i++)
jm.add(new JMenuItem("Test menu item " + i));
jmb.add(jm);
frame.getContentPane().add(jmb, BorderLayout.NORTH);
frame.getContentPane().add(new JLabel("content"), BorderLayout.CENTER);
frame.setVisible(true);}
catch(Exception e)
{e.printStackTrace();}
}
}
(Review ID: 134251)
======================================================================
###@###.### 10/18/04 14:45 GMT
- duplicates
-
JDK-4519787 JMenu should handle long menus more gracefully
-
- Closed
-
- relates to
-
JDK-7072653 JComboBox popup mispositioned if its height exceeds the screen height
-
- Resolved
-