package 作业;
import javax.swing.JOptionPane;
public class 小写字母转换为大写字母对话框 {
public static void main(String[] args) {
String temp = JOptionPane.showInputDialog(null,"请输入任意小写字母","input",
JOptionPane.QUESTION_MESSAGE );
char b=temp.charAt(0);
char c=(char)(int)(b-32);
JOptionPane.showMessageDialog(null, "转换为大写字母"+c, "output",
JOptionPane.INFORMATION_MESSAGE);
}
}
import javax.swing.JOptionPane;
public class 小写字母转换为大写字母对话框 {
public static void main(String[] args) {
String temp = JOptionPane.showInputDialog(null,"请输入任意小写字母","input",
JOptionPane.QUESTION_MESSAGE );
char b=temp.charAt(0);
char c=(char)(int)(b-32);
JOptionPane.showMessageDialog(null, "转换为大写字母"+c, "output",
JOptionPane.INFORMATION_MESSAGE);
}
}