JOptionPane.showConfirmDialog()提示按钮显示英文,如何改为中文
答案:2 悬赏:40 手机版
解决时间 2021-02-15 21:40
- 提问者网友:抽煙菂渘情少年
- 2021-02-15 02:41
按钮显示为"yes” or "no",而不是 ”是“或”否“
最佳答案
- 五星知识达人网友:山君与见山
- 2021-02-15 03:15
本来中文操作系统一般就会显示中文吧。如果是英文,可以这样改:
UIManager.put("OptionPane.yesButtonText", "是");
UIManager.put("OptionPane.noButtonText", "否");
UIManager.put("OptionPane.yesButtonText", "是");
UIManager.put("OptionPane.noButtonText", "否");
全部回答
- 1楼网友:刀戟声无边
- 2021-02-15 04:28
package zhidao;
import java.awt.headlessexception;
import javax.swing.joptionpane;
public class number
{
public static void main ( string[] args )
{
int max = integer.min_value;
int num2;
string num1 = null;
int count = 0;
try
{
while (null != ( num1 =
joptionpane.showinputdialog (null, "please input the number,the program will ends with number 0") ))
{
num2 = integer.parseint (num1);
if (num2 == 0)
{
system.exit (0);
break;
}
if (num2 >= max)
{
max = num2;
count++;
}
}
}
catch (exception e)
{}
joptionpane.showmessagedialog (null, "the largest number is " + max);
joptionpane.showmessagedialog (null, "the number the largest number appeared " + count);
joptionpane.showmessagedialog (null, "thank you for your cooperation!goodbye!:)");
}
}
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯