注册 登录
编程论坛 J2EE论坛

用过这个编程序工具(Sun ONE Studio 4 CE)的请进来一下(没有用过也来一下)

wxhwjsw 发布于 2006-08-08 10:48, 1575 次点击
只想问一个问题 就是怎么让他从命令行接收参数。。

我都快烦死了 每次都要用String = JOptionPane.showInputDialog( “” )

还请那位帮个忙   

没有用过的话也请告诉我你们用的工具和从命令行接收参数的方法

[此贴子已经被作者于2006-8-8 10:49:45编辑过]

13 回复
#2
可可℃乐2006-08-08 11:22

没用过

#3
无理取闹2006-08-08 12:57

这个问题应该在j2se里问吧 而且和编译工具也没什么关系吧
import java.util.*;
public class MyScanner
{
public static void main(String []args)
{
String num=null;
Scanner reader=new Scanner(System.in);
while(reader.hasNextLine())
{
num=reader.nextLine();
System.out.println(num);
}

}
}

#4
wxhwjsw2006-08-08 13:57
...我的意思是我用工具   编译的时候是不是按一个按纽啊   那么这样他就执行了啊  可是我的参数还没传呢
#5
无理取闹2006-08-08 18:40
不明白说什么
我还是不瞎说了
等高人吧
#6
程序BUG2006-08-08 22:25
import javax.swing.*;
class InputTest{
public static void main( String[] args){
String name = JOptionPane.showInputDialog("What is your name?");

String input JOptionPane.showInputDialog("how old are you?");
int age =Integer.parseInt(input);
System.out.println("hello,"+ name+".next year,you'll be"+(age+1));
System.exit(0);}}


还有这个
import java.io.*;
class tinyEdit{
public static void main(String[] args)throws IOEzception{

BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String str[]=new String[100];
System.out.println("Enter lines of test.");
System.out.println("Enter "stop" to quit");
for(int i=0;i<100;i++){
str[i]=br.readLine();
if(str[i].equals("stop")) break;
}
System.out.println("disp");
for (int i=0; i<100; i++){
if(str[i].equals("stop")) break;
System.out.println(str[i]);}}}
我是菜鸟不对的地方难免

[此贴子已经被作者于2006-8-8 22:29:00编辑过]

#7
程序BUG2006-08-08 22:29
是不是要搞这个啊
#8
无理取闹2006-08-08 22:29
红的地方怎么修饰??
修饰是什么意思啊
#9
无理取闹2006-08-08 22:30
怎么没了?
#10
程序BUG2006-08-08 22:30
我瞎说的别太信那个
#11
程序BUG2006-08-08 22:31
他是不是想弄那个啊   我写的那些是不是他想要的啊
#12
程序BUG2006-08-08 22:36
9楼的说句话
#13
wxhwjsw2006-08-09 13:17

我只是要从命令行接收个参数而已啊  不是一般都 有  int a = IntegerPrase( args[0])
我要的是这个args啊  

#14
wxhwjsw2006-08-10 13:15

UP

1