Accepting input from user
Can anyone tell me that once a program has prompted a user for input (causing the program to pause), is there a way for the user to enter input and hence restart that program. I know that it can be done in JBuilder simply enough. cheers
p.s. other than from the command line
Hi Joe,
Before you start running (or debugging, profiling, or code-coaching), you need to check a box in the project settings dialog. In the Project Settings dialog, select Runner - Options on the left and then check the "Allow Program Input" check box (at the bottom of the panel).
When you start running (etc), the log window will contain a text field labeled "Input:" where you can enter program input (it's at the bottom of the log window).
-Liz
Similar Messages
-
How can i get input from user in Workflows
Hello professionals,
I'm new to SAP B1 Workflow, i have created some workflows and they all worked fine.
But, I am wondering, How can i get input from user?. For example, i want to display list of options to choose between them and route the workflow based on the selected option. I don't want to use the exclusive gateway and check for some conditions, i want to get input from user.
How can i do that?
Thanks in advance,
Kareem NaguibHi,
Please refer SAP help file:
http://help.sap.com/saphelp_sbo900/helpdata/en/b8/1f9a1197214254b79bcf8f93f9fff9/content.htm?frameset=/en/44/c4c1cd7ca22…
Thanks & Regards,
Nagarajan -
How to Get input from User and Display it's Value
Hi ,
I need to get 2 inputs from user and to display it's Mutilple Value.
The Below Code is working fine to get 2 Input's from user,but it display a Junk value as a Result .How to
overcome this Problem. I need to display it's Mutilple(a*b) value of "a " and " b".
import java.io.*;
class Mul{
static int a=0;
static int b=0;
static int Count=0;
public static void main(String args[])throws IOException{
BufferedReader br =new BufferedReader(new InputStreamReader(System.in));
do{
a=(char)br.read();
Count++;
b=(char)br.read();
if(Count==2)
System.out.println("The Multiplied Value is "+a*b);
}while(Count<2);
}Changed to Integer but still the problem persists.
import java.io.*;
class Mul{
static int a=0;
static int b=0;
static int Count=0;
public static void main(String args[])throws IOException{
BufferedReader br =new BufferedReader(new InputStreamReader(System.in));
do{
a=(int)br.read();
Count++;
b=(int)br.read();
if(Count==2)
System.out.println("The Multiplied Value is "+a*b);
}while(Count<2);
} -
How to Get Input From User and Display Result
Hi ,
I need to get 2 inputs from user and to display it's Mutilple Value.
The Below Code is working fine to get 2 Input's from user,but it display a Junk value as a Result .How to
overcome this Problem. I need to display it's Mutilple(a*b) value of "a " and " b".
import java.io.*;
class Mul{
static int a=0;
static int b=0;
static int Count=0;
public static void main(String args[])throws IOException{
BufferedReader br =new BufferedReader(new InputStreamReader(System.in));
do{
a=(char)br.read();
Count++;
b=(char)br.read();
if(Count==2)
System.out.println("The Multiplied Value is "+a*b);
}while(Count<2);
}Hi ,
I need to get 2 inputs from user and to display it's
Mutilple Value.
The Below Code is working fine to get 2 Input's from
user,but it display a Junk value as a Result .How
to
overcome this Problem. I need to display it's
Mutilple(a*b) value of "a " and " b".
import java.io.*;
class Mul{
static int a=0;
static int b=0;
static int Count=0;
public static void main(String args[])throws
IOException{
BufferedReader br =new BufferedReader(new
InputStreamReader(System.in));
do{
a=(char)br.read();This line will get you the ascii-value of the typed character.
This line will not get you the value typed in.
Try looking for Integer.parseInt()...
Count++;
b=(char)br.read();
if(Count==2)
System.out.println("The Multiplied Value is "+a*b);
}while(Count<2); -
PC as a bluetooth Device and accept input from other devices
I need to set my PC up as a bluetooth device by use of a bluetooth dongle connected to my PC. I need to have a program running on my PC that will detect other bluetooth devices and connect with them, accept input from them. Please help me do this. anyone got code for this? Thank you a gazillion in advance !! :)
There's no way to do is with standard Java as far as i know. You'll have to use JNI to use native libraries.
-
Get input from user and create a file and run a script in command line.
Hi all,
i'm trying to get a input from user and write it into a file named alpe.jacl
To get multiple userinputs like address and jobtitle etc etc in the same single window.
and the code will save the inputs in alpe.jacl one by one in a new line like
nameis name
address russia
jobtitle dev
So i coded like below.
Though GUI for user input looks dull Its working fine.
Now I want this code to perform one more task which is the GUI will contain one more button INSTALL with OK and CALCEL .
and when after putting all inputs and creating the alpe.jacl file if someone clicks INSTALL it should start ./install.sh script present at the same folder which contains some unix shell commands.
Here am not able to figure out how to go further...
One more thing after all the inputs given when I am clicking on the OK button its closing the window instantly which i dont want. I want it like it should wait till someone press CANCEL to exit.
Please some one help me.
import javax.swing.*;
import java.io.*;
public class file
public static void main(String []args)throws IOException
FileWriter ryt=new FileWriter("alpe.jacl");
BufferedWriter out=new BufferedWriter(ryt);
JTextField wsName = new JTextField();
JTextField sName = new JTextField();
JTextField cName = new JTextField();
Object[] message = { "Web Server Name:", wsName,"Server Name:", sName,"Cluster Name:", cName};
int answer = JOptionPane.showConfirmDialog( null, message, "Enter values", JOptionPane.OK_CANCEL_OPTION);
if (answer == JOptionPane.OK_OPTION){ String webserver = wsName.getText();
String server = sName.getText();
String cluster = cName.getText();
out.write("set webservername " +wsName.getText()+"\n");
out.write("set ClusterName " +cName.getText()+"\n");
out.write("set ServerName " +sName.getText()+"\n");
out.close();
}}Thanks,
RickyThanks a lot.
Is there any way through which i can assign a scroll bar to my panel.
As when the number of user inputs grows the GUI becomes more bulky and some of the fields are not showing up.
Cheers
_Ricky -
SAP BPC - Intercompany reconciliation - IC accounts - Input from user?
Dear All,
When doing consolidation(of investments), we need to reconcile IC transactions prior to consolidation process. I believe, there are specific accounts which are specific to IC transactions. These IC related accounts must be identified and used in the business rules during reconciliation process.
My question is:
During requirements gathering, even if I(SAP BPC Consultant) know those IC specific accounts on seeing the chart of accounts, this info./data MUST come from the users as these accounts may vary from company to company. When it is a legal consolidation, it is safer that these inputs are coming from the user and not from the SAP BPC Consultant. This is my understanding.
Is my above understanding is correct? IC related accounts must be an input from users and not expected from SAP CONS. specialist?
Correct me if I am wrong.
Thank you!
Regards,
PeriHi Peri,
Different companies use different charts of accounts and the intercompany group of accounts have to be confirmed by customers finance.
Vadim -
Need help with ouput of a list or array of numbers input from user
I'm only a few weeks into learning java, so this may seem simple to some, but...
I am trying to write a program that will receive numbers from a user,
and then list, add, average those numbers. I've got the program to
work except for listing the numbers that were input.
Can someone help guide me????
i've left the code I've tried in as comments.
Enter an integer value, the program exits if the input is 0:
20
Enter an integer value, the program exits if the input is 0:
40
Enter an integer value, the program exits if the input is 0:
60
Enter an integer value, the program exits if the input is 0:
80
Enter an integer value, the program exits if the input is 0:
0
Total numbers entered: 4
The array of numbers is: 0 0 0 0
The sum is 200
The average is 50
The maximum number is 0
The minimum is 0
Here is my code:
* Title: Reads integers and finds the total, average, maximum of the input values
* Description:
* Copyright: Copyright (c) 2002
* Company: Duke Court.
* @author Mary Davenport
* @version 1.0
public class part3page6
public static void main(String[] args)
int data = 0;
int sum = 0;
int countnum = -1;
int maximum = 0;
int minimum = 0;
int average = (countnum - 1);
do
System.out.println("Enter an integer value, " +
" the program exits if the input is 0: ");
data = MyInput.readInt();
sum += data;
countnum++;
} while (data != 0);
//in order to figure the max & the min it appears that the
//program will need to utilize arrays to store the individual numbers
//that are input from the user.
//create an array of the input data
int[] number = new int[countnum];
//creat a list of the input data
int []myList = {data};
//lists how many numbers entered
System.out.println("Total numbers entered: " + number.length);
//list array of numbers -- this is giving me [I@3179c3,
//instead of 20, 40, 60, 80 when I use "new int[countnum]"
// System.out.print("The array of numbers is: "
// + new int[countnum]);
//list array of numbers: this is giving me " 0 0 0 0 "
//instead of 20, 40, 60, 80 with the following for statement
// (number[i] + " ")
System.out.print("The array of numbers is: ");
for(int i=0; i<number.length; i++)
System.out.print(number[i] + " ");
//list mylist of numbers from input, 20, 40, 60, 80
//output is The list of numbers is: [I@3179c3
// System.out.print("The list of numbers is: " + myList);
System.out.println();
System.out.println("The sum is " + sum);
average = sum/countnum;
System.out.println("The average is " + average);
System.out.println("The maximum number is " + maximum);
System.out.println("The minimum is " + minimum);When you input the data you need to save it to the array. Currently you are not saving the value you are just adding it
ArrayList nums = new ArrayList();
do
System.out.println("Enter an integer value, " +
" the program exits if the input is 0: ");
data = MyInput.readInt();
nums.add(new Integer(data));
sum += data;
countnum++;
} while (data != 0); -
Apex_Collection Adding member via input from user
Good day to all, I have this code how do I add member based on an input from a user via a textfield? I can just add one member only because when i select the collection it retrieves only one data, I want it to add more data based on the user if he enters 5 values I must retrieve 5 values also when I select it. How will I do that? thanks in advance.
DECLARE
v_arr apex_application_global.vc_arr2;
BEGIN
v_arr := apex_util.string_to_table(:P1_DEPTNO);
apex_collection.create_or_truncate_collection(p_collection_name => 'PCOL');
FOR i IN 1 .. v_arr.count
LOOP
apex_collection.add_member(p_collection_name => 'PCOL', p_c001 => v_arr(i));
END LOOP;
END;Edited by: mang jose on Jan 12, 2011 6:21 PMHi Jose,
There are only two steps needed. On my page, my page item is P4_DEPTNO (so adjust this for your page):
1 - Create a process on your page that runs "On Load - Before Header". The process code should be:
BEGIN
IF NOT APEX_COLLECTION.COLLECTION_EXISTS('PCOL') THEN
APEX_COLLECTION.CREATE_COLLECTION('PCOL');
END IF;
END;This creates the PCOL collection if it does not exist, otherwise does nothing if it does exist
2 - Create another process on your page that runs "On Submit - After Computations and Validations". The code for this should be:
BEGIN
APEX_COLLECTION.ADD_MEMBER('PCOL', :P4_DEPTNO);
END;I have set this process to be triggered by my button (P4_ADD_BUTTON in this example) but I have also set it to be conditional on P4_DEPTNO being NOT NULL - so, I have selected "Value of Item in Expression 1 is NOT NULL" and have entered P4_DEPTNO into Expression 1.
And that is all you should need to do!
Andy -
How can i take input from user?
class input{
public static void main(String args[]){
int i,j,result;
//i want to take input here from user.
result=i+j;
System.out.println(result);
}here's the code which takes input of i , j from user and adds it
<code>
public static void main(String[] args)
int i=0;
int j=0;
String s = null;
System.out.println("Enter value of 'i'");
InputStreamReader isr = new InputStreamReader ( System.in );
BufferedReader br = new BufferedReader ( isr );
try
s = br.readLine ();
i=Integer.parseInt(s);
System.out.println("Enter value of 'j'");
isr = new InputStreamReader ( System.in );
br = new BufferedReader ( isr );
s = br.readLine ();
j=Integer.parseInt(s);
System.out.println("Enter value of 'i+j ='"+(i+j));
catch(Exception e){}
</code> -
How do i get input from user?
For example if i wanted to ask "Whats your favorite number" and then get the input from the user and assign it to a variable how would i go about doing that?
Any help would appreciatedhope this helps
import java.io.*;
public static void main(String[] args)
//this is the important part
BufferedReader in = new BufferedReader( new InputStreamReader(System.in) );
String response = "";
System.out.println("What is your favorite color?");
try{
//now read the line
response = in.readLine();
}catch(Exception e){
//enter error code here
System.out.println("I like " +response+ " as well!");
} -
How to create a dialog that takes inputs from user!!!!!!
hi there
anyone has any idea about creating a dialog that takes user input? some thing like login GUI. thank you. it would be better if you can provide some sample codes.The Java Swing tutorial has a section on creating dialogs. There is a demo on how to get user input from a dialog:
http://java.sun.com/docs/books/tutorial/uiswing/components/dialog.html#input
The entire tutorial can be downloaded from:
http://java.sun.com/docs/books/tutorial/ -
Read input from user and strore in ztable
Hai,
could you please give some examples of How to read the input data from user and store in Ztable.
ThanksHi Prasanna,
If i understood your requirement correctly,
The below code will insert record in DB table as soon as you enter the value in two fields and press enter button .
Go through the below code,
<b>In Layout</b>
<%@page language="abap"%>
<%@extension name="htmlb" prefix="htmlb"%>
<htmlb:content design="design2003">
<htmlb:page title = "first page ">
<htmlb:form>
<htmlb:inputField id="field1"/>
<htmlb:inputField id="field2"/>
<htmlb:button id="submitButton" text = "Press Me"
onClick = "myClickHandler" />
</htmlb:form>
</htmlb:page>
</htmlb:content>
<b>In Oninputprocessing event</b>
CLASS CL_HTMLB_MANAGER DEFINITION LOAD.
DATA: event TYPE REF TO CL_HTMLB_EVENT.
data : begin of wa,
matnr type mara-matnr,
ersda type mara-ersda,
end of wa.
event ?= CL_HTMLB_MANAGER=>GET_EVENT( runtime->server->request ).
IF event->id = 'submitButton' AND event->event_type = 'click'.
DATA: data TYPE REF TO CL_HTMLB_INPUTFIELD.
DATA: data1 TYPE REF TO CL_HTMLB_INPUTFIELD.
data ?= CL_HTMLB_MANAGER=>GET_DATA( request = runtime->server->request
name = 'inputField'
id = 'field1'
IF data IS NOT INITIAL.
value = data->value.
wa-matnr = data->value.
ENDIF.
data1 ?= CL_HTMLB_MANAGER=>GET_DATA( request = runtime->server->request
name = 'inputField'
id = 'field2'
IF data1 IS NOT INITIAL.
value = data->value.
wa-ersda = data1->value.
ENDIF.
insert into ZAZAZ_BSP CLIENT SPECIFIED values wa.
ENDIF.
Regards,
Azaz Ali.
Don't forget to reward points. -
RMI that ask input from user..
i've been trying to understand the programming for 2weeks!!but still i cant figure out how to get input from client and server process the input and return it to the client.
can somebody PLEASEEEEE give me a complete simple program that got all the interfaces,client,server and implementation RMI code.Please give me a complete code that i can run that does this:-
1st-server ask client for input of two numbers.
2nd-the client give 2 input
3rd-server compute the number and return it to the client
i am so lost on how to implement the io in RMI.The program that im supposed to build is much more complicated than this,but right now,i just need to know how the heck to use the input output thing in RMI.1st-server ask client for input of two numbers.No. Incorrect design. The client should do that. The server has no interface with the user at the client.
2nd-the client give 2 inputIf the client does (1) this is unnecessary.
3rd-server compute the number and return it to the client1. Design the remote interface.
2. Implement the remote class, extending UnicastRemoteObject, implementing the remote interface, and providing a method that implements the remote method(s).
3. Write a main() that instantiates the remote object and binds it to the local Registry.
4. Write a client that does (1) above. Then have it get an instance of the remote interface by looking up the Registry on the server machine, and then have it call the remote method. -
Hi,
I have an sql file with multiple accept statements.
I would like to run this script from the DOS commandline, and supply the script with values for the accept statements.
How can I do this? (I do not want to alter the sql-file for this)
Regards,
HJHI have an sql file with multiple accept statements.
I would like to run this script from the DOS commandline, and supply the script with values for the accept statements.
How can I do this? (I do not want to alter the sql-file for this)Create text file and put one value per line in proper order. For example, you have the following script script.sql :
accept V1 char prompt 'Enter value for V1:'
accept V2 char prompt 'Enter value for V2:'
prompt Your input : &V1 &V2
exitText file values.txt can be the following:
ABC
DEFThen use the following syntax:
sqlplus.exe /nolog @script.sql < values.txt
Maybe you are looking for
-
Hi All, I am from a Informatica background and new to ODI. Its overwhelming for a newbie like me grasp this ELT concept. ODI version - 11g. We are in process of loading data from MySQL to Oracle. We are using LKM SQL to Oracle and IKM Oracle incremen
-
I accidentaly hit a feature that allowed me to hide everything on the top of my browser. Now All i have are the options of "most visited, Getting Started and Latest Headlines." I have no place to type in a website address, no options such as "file" o
-
The bottom rubber case of my macbook 13" late 2009 has expanded and has detached from the main body..As i'm not presently under warranty i wanted to know will the repair be free of charge for me. I had once got it replaced for free but in warranty. A
-
Iphone apps - where can I find them in iTunes?
Hi, I downloaded some apps onto iTunes and never synced them to my iPhone because I kept getting errors when trying to sync. I have downloaded iTunes on a different PC and was wondering if anyone knows how i can move those apps onto the itunes on my
-
I Have an iPhone 4s and it won't come on. What do you suggest?
The product name of my device is Apple inc. My storage was a total of 20GB. The number of my phone system is iOS 8.1.2. The problems I've had with this iPhone is, it blanked out then cut back on. Blanked out again, and it wouldn't come back on. I've