-
Bug
-
Resolution: Unresolved
-
P3
-
8, 12, 16, 17, 18
-
x86_64
-
os_x
ADDITIONAL SYSTEM INFORMATION :
Mac OS X 10.12.6 + JDK16.0.1
A DESCRIPTION OF THE PROBLEM :
I develop SWING application on JDK1.6.0 and Mac OS X, and JMenuItem shows under fullscreen, but the application build on JDK16.0.1 and Mac OS X don't show JMenuItem under fullscreen.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Please run under programs.
step 1. push full screen button
step 2. select file menu
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
At the step 2, displays quit submenu.
ACTUAL -
At the step 2, displays none.
---------- BEGIN SOURCE ----------
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.GraphicsEnvironment;
import java.awt.Rectangle;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
@SuppressWarnings("serial")
public class MenuTest extends JFrame {
private static MenuTest menuTest;
public static void main(String[] args) {
javax.swing.SwingUtilities.invokeLater(new Runnable() {
public void run() {
createAndShowGUI();
}
});
}
private static void createAndShowGUI() {
menuTest = new MenuTest();
menuTest.setSize(640, 480);
menuTest.setVisible(true);
}
public MenuTest() {
super(GraphicsEnvironment.getLocalGraphicsEnvironment()
.getDefaultScreenDevice().getDefaultConfiguration());
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JMenuBar menuBar = new JMenuBar();
// faile menu
JMenu menu = new JMenu("File");
JMenuItem menuItem = new JMenuItem("Quit");
menuItem.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent arg0) {
System.exit(0);
}
});
menu.add(menuItem);
menuBar.add(menu);
// view menu
JButton button = new JButton("Full Screen");
button.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent arg0) {
menuTest.setVisible(false);
menuTest.dispose();
menuTest.setUndecorated(true);
Rectangle rect = GraphicsEnvironment
.getLocalGraphicsEnvironment().getDefaultScreenDevice()
.getDefaultConfiguration().getBounds();
menuTest.setPreferredSize(new Dimension(rect.width, rect.height));
GraphicsEnvironment.getLocalGraphicsEnvironment()
.getDefaultScreenDevice().setFullScreenWindow(menuTest);
menuTest.setVisible(true);
}
});
this.add(button, BorderLayout.WEST);
button = new JButton("Window");
button.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent arg0) {
menuTest.setVisible(false);
menuTest.dispose();
menuTest.setUndecorated(false);
menuTest.setPreferredSize(new Dimension(640, 480));
menuTest.setVisible(true);
}
});
this.add(button, BorderLayout.EAST);
this.setJMenuBar(menuBar);
}
}
---------- END SOURCE ----------
FREQUENCY : always
Mac OS X 10.12.6 + JDK16.0.1
A DESCRIPTION OF THE PROBLEM :
I develop SWING application on JDK1.6.0 and Mac OS X, and JMenuItem shows under fullscreen, but the application build on JDK16.0.1 and Mac OS X don't show JMenuItem under fullscreen.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Please run under programs.
step 1. push full screen button
step 2. select file menu
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
At the step 2, displays quit submenu.
ACTUAL -
At the step 2, displays none.
---------- BEGIN SOURCE ----------
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.GraphicsEnvironment;
import java.awt.Rectangle;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
@SuppressWarnings("serial")
public class MenuTest extends JFrame {
private static MenuTest menuTest;
public static void main(String[] args) {
javax.swing.SwingUtilities.invokeLater(new Runnable() {
public void run() {
createAndShowGUI();
}
});
}
private static void createAndShowGUI() {
menuTest = new MenuTest();
menuTest.setSize(640, 480);
menuTest.setVisible(true);
}
public MenuTest() {
super(GraphicsEnvironment.getLocalGraphicsEnvironment()
.getDefaultScreenDevice().getDefaultConfiguration());
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JMenuBar menuBar = new JMenuBar();
// faile menu
JMenu menu = new JMenu("File");
JMenuItem menuItem = new JMenuItem("Quit");
menuItem.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent arg0) {
System.exit(0);
}
});
menu.add(menuItem);
menuBar.add(menu);
// view menu
JButton button = new JButton("Full Screen");
button.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent arg0) {
menuTest.setVisible(false);
menuTest.dispose();
menuTest.setUndecorated(true);
Rectangle rect = GraphicsEnvironment
.getLocalGraphicsEnvironment().getDefaultScreenDevice()
.getDefaultConfiguration().getBounds();
menuTest.setPreferredSize(new Dimension(rect.width, rect.height));
GraphicsEnvironment.getLocalGraphicsEnvironment()
.getDefaultScreenDevice().setFullScreenWindow(menuTest);
menuTest.setVisible(true);
}
});
this.add(button, BorderLayout.WEST);
button = new JButton("Window");
button.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent arg0) {
menuTest.setVisible(false);
menuTest.dispose();
menuTest.setUndecorated(false);
menuTest.setPreferredSize(new Dimension(640, 480));
menuTest.setVisible(true);
}
});
this.add(button, BorderLayout.EAST);
this.setJMenuBar(menuBar);
}
}
---------- END SOURCE ----------
FREQUENCY : always