📄 javaquestion.java
字号:
import java.util.*;
import javax.swing.*;
public class JavaQuestion {
protected static ResourceBundle resources =
ResourceBundle.getBundle("MyResources");
public static void main(String[] args) {
ImageIcon flagIcon = (ImageIcon)(resources.getObject(
"FlagIcon"));
String[] options =
{resources.getString("LabelYes"), resources.getString("LabelNo")};
JOptionPane pane = new JOptionPane(
resources.getString("JavaIsLang"),
JOptionPane.QUESTION_MESSAGE,
0, flagIcon, options);
JDialog dlg = pane.createDialog(null,
resources.getString("WhatIsJava"));
dlg.setModal(true);
dlg.setVisible(true);
String selection = (String)(pane.getValue());
boolean selectedYes = (selection == options[0]);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -