How can I provide inputs to a java application during run-time, through netbeans window?
How can I provide inputs to a java application during run-time, through netbeans window ? or through any dialog box ??
I know there is an option to add parameters through the project property window, but it does not help to 开发者_StackOverflow社区add run-time inputs.
Define an input stream like this:
BufferedReader b = new BufferedReader(new InputStreamReader(System.in)); //input buffer
and then use it to take command-line input like this:
a=b.readLine();
I don't know why you want to do this in "netbeans" but to java programs you can provide inputs in this ways:
- read file
- read standard input
- use swing components which read input
- to only debugging purpose: use debug mode and breakpoint to stop and change any variables
精彩评论