public static void main(String[] args) {
try {
String fileName;
if (args == null || args.length == 0) {
System.out.println("请输入要统计的文件或目录:\n");
byte[] buff = new byte[255];
System.in.read(buff);
fileName = new String(buff).trim();
} else {
fileName = args[0];
} 这是程序的一部分,当执行程序时,会执行System.out.println("请输入要统计的文件或目录:\n"); 是在ECLIPSE下运行的,程序是在ECLIPSE下的CONSOLE下运行,我的意思是想让程序弹出对话框,然后输入内容,怎么实现,谢谢
try {
String fileName;
if (args == null || args.length == 0) {
System.out.println("请输入要统计的文件或目录:\n");
byte[] buff = new byte[255];
System.in.read(buff);
fileName = new String(buff).trim();
} else {
fileName = args[0];
} 这是程序的一部分,当执行程序时,会执行System.out.println("请输入要统计的文件或目录:\n"); 是在ECLIPSE下运行的,程序是在ECLIPSE下的CONSOLE下运行,我的意思是想让程序弹出对话框,然后输入内容,怎么实现,谢谢
String str=javax.swing.JOptionPane.showInputDialog(null,"输入信息:");
呃 控制台下运行你还想弹个框。
String str=javax.swing.JOptionPane.showInputDialog(null,"输入信息:");呵呵,我只是试下,知道实用性为0