当我单击按钮时,设置为全屏的应用程序将转到任务栏/最小化,因此我需要先在任务栏中单击它,然后才能看到JOptionPane
我触发的。你认为这有什么问题?我希望它能够顺利运行,而不会被最小化或进入任务栏。
public static void main(String[] args) {
final JFrame frame = new JFrame();
frame.setTitle("Sample");
GraphicsDevice device = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
device.setFullScreenWindow(frame);
device.setDisplayMode(new DisplayMode(800, 600, 32, 60));
frame.setVisible(true);
JButton btn = new JButton();
btn.setText("Btn");
JPanel panel = new JPanel();
panel.add(btn);
frame.add(panel);
btn.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
JOptionPane.showMessageDialog(frame, "Sample");
throw new UnsupportedOperationException("Not supported yet.");
}
});
}