Extra input prompt

Help!
I am trying to resolve a problem with a rather simple code. Whenever I run the code below I am prompted for input twice. Although I have programmed with Java before (very simple programs), I am just now experimenting with the more advanced topics of Java. I didn't have this problem last time I programmed, so its a surprise to me why its come up now. Also, I do not get the expected output. I get garbage instead.
import java.awt.*;
import java.io.*;
public class EchoName
public static void main (String[] args)throws IOException
int name;
InputStreamReader stdin = new InputStreamReader(System.in);
System.out.println("Please type your name:");
name = stdin.readInt();
System.out.println("name" + name);
} // main method
Any help anyone can give me would be excellent.
Thanks
Elise

Unfortunately getting console input in Java is fairly complicated: The language was designed at a time when everyone was already using a graphical user interface. There's hardly any support for creating text-mode user interfaces.
The easiest way to get a line of input is using the readLine method of the BufferedReader class:String name;
BufferedReader stdin = new BufferedReader(InputStreamReader(System.in));
System.out.println("Please type your name:");
name = stdin.readLine();
System.out.println("name" + name);Alternatively you could pop up a dialog that asks the user's name; a much simpler task:import javax.swing.JOptionPane;
String name = JOptionPane.showInputDialog("Please enter your name");http://java.sun.com/docs/books/tutorial/uiswing/components/dialog.html

Similar Messages

  • Crystal report input prompt..for sub report

    Hi All,
    I developed crystal report and retreived the fields from the exsiting Query.Now for  enhancing the report i must creat a sub report for th eexisting one.In this case iam getting 2 input prompts one for the old report and the other one is for the enhanced sub report .But the requirement is tha t, the report must get only one input prompt for both the reports. Is this can be possible from the Query end or the crystal report end?
    YVL

    Hi Vijayalakshmi
    You can apply just one input parameter for the main report and then link your subreport with this parameter.
    Once you link the subreport, you would get only one prompt for inputting parameter values.
    This way you can optimize the performance of the report as well.
    For more information about linking subreports you can refer to the user guide for the respective crystal reports version you are using.
    Hope this helps!!!
    Regards
    Sourashree

  • Any way to automate input for input prompts

    Hi all,
    For times when there is a input prompt, is there any method/way we can direct pass it in via unix scripting or sql script? Specially for password change in this scenario, which is database's default prompting.
    Eg. I wanna change a user password. however there will be an input prompt. any way I can automate the input passing in? I understand that we can use "alter user" , but I am trying to stick to using password [username] to perform the change.
    SQL> password [username];
    password:
    Thanks in advance.
    Eugene

    yea, I was planning to the thing as you mentioned
    pass the username, old_password and new_password as parameters, and change the password without stopping for any manual input.
    Reason being my current environment is using password [username] to change password, and I try to my very best to minimise changes. I am trying to come up with the script which is capable of minimising manual entry, by issuing prompts from my script and execute any sql activity from there automatically. I have idea on how to get it work if I apply the alter user convention, just wanna check whether is there any way to do it the password [username] approach.
    Eugene

  • Text Input Prompt

    Does anyone tried to build some text input field that can do prompt? Something like auto-complete in source code edit. It would mean that:
    - we have to make the rest of the prompt text gray
    - the cursor blinks right after the user input characters
    - if user click space bar, the first word in prompt become solid and cursor moves to next word.
    Is this something that's possible to do for iPhone?

    - How do I programmatically place the cursor in the middle of a word
    - How do I font/color part of word in text input control
    - How do I select the text up to or from where the cursor is...
    You can't. You can't. You can't. At least not with a UITextField.
    I've done more or less of what you are looking for in PocketMoney for auto completing transaction. You need to do a lot of rolling of your own code to pretend you have UITextField.
    What I ended up doing is drawing the uncompleted text at the end of the current text input of the UITextField that I subclassed.
    - Hardy

  • WEB Application / Dynamic variable input / Prompts

    I've defined a variable on characteristic Currency with the following definition:
    Processing by              : User Entry/ Default Value
    Variable represents        : Single Value
    Variable entry is          : Optional
    Ready for input            : yes
    Can be changed in query nav: yes
    Default Value              : EUR
    This variable ist used in "Currency Translation" as "Target currency" (variables entry: yes)
    The query is used in a Web-Report that performs the following command by selecting currencies from a checkbox:
    url=SAP_BW_URL_Get() +"&CMD=PROCESS_VARIABLES&SUBCMD=VAR_SUBMIT&VAR_NAME_1=SL_CURR&VAR_VALUE_EXT_1=";
    url=url+value;
    (value is the code of the selected currency)
    Everything works pretty good, but opening the web-report I get a prompt window for the variable. How can I avoid this ?
    Changing the variable property <Ready for input : no> causes the effect that the dynamically changing of the variable doesn't work anymore. It seems that in this case always the default value of the variable is taken.
    The application should use the default value while opening the report, afterwards it should be possible to set the variable dynamically.
    Thank you very much for your ideas !!

    Hi Stefan,
    you can activate/deactivate the variable screen with parameter "Force Variable Screen" in your web template.
    bye

  • User input prompt in CASE statement

    I would like to obtain user input via a prompt and use what the user selects in my OBIEE Report case statement.
    For example &START_DATE AND &END_DATE are user inputs:
    CASE when SHIP_DATE BETWEEN &START_DATE AND &END_DATE THEN 1
    Thanks

    Use presentation variables for start and end_dates
    In the criteria tab->SHIP_DATE->click on fx
    on Edit Column Formula->Bin Tab->
    Add Bin->Add button->Variable->Presentation
    Use the presenation variables with with required condition
    Okay then set 1 at Edit Bin Name
    Mark if helps
    Srini VEERAVALLI on Feb 7, 2013 5:23 PM
    Any updates on this?
    Edited by: Srini VEERAVALLI on Feb 20, 2013 4:10 PM

  • How to change date format of user input prompt in infoview.

    Hi All,
    Every report webi or deski having date field as prompt when viewed in view mode in infoview shows date format as M/d/yyyy h:mm:ss a.
    Where this format is stored and how can we change it to dd/mm/yyyy.
    Any ideas.
    Regards,
    Gaurav

    Not sure id this helps...
    I was up against a similar issue of placing the user input dates, Starting & Ending, into one cell for a reference on each report header. After a few hours of diligence, I came up with a working model that finally worked:
    u_StartDateAsTXT=FormatDate(ToDate(UserResponse("Enter Date/Time Shipped (Start):");"MM/dd/yyyy hh:mm:ss a");"MM/dd/yyyy")
    and
    u_EndDateAsTXT=FormatDate(ToDate(UserResponse("Enter Date/Time Shipped (END):");"MM/dd/yyyy hh:mm:ss a");"MM/dd/yyyy")
    The report header has the following function:
    =u_StartDateAsTXT + u201C u2013 u201C + u_EndDateAsTXT

  • Problems with entries into input prompt on browser

    The browser -- be it safari or firefox – doesn't allow me to make input entries at all. This is entirely new to me. Until now I never had problems (OS X 10.8.2). On another partition with 10.6.8 there are no problems. So I actually have to change the partition and the OS version in order to use online banking.
    Whar could be the reason?
    Thanks for useful hints.

    Thanks for the hint. Id didn't solve my problem, though.
    In the meantime I found out that the numeric field was blocked. Although I don't know how I managed to block it, it was blocked in fact and now that I got it unblocked "all is well that ends well".
    Kindest regards WR

  • Customer wants to record and input prompts into UCCX 8.0 based on various conditions

    hello guys I have a question that requires an answer as wel as an example if possible. I have a customer that wants to be able to do an self initiated prompt change in the script. Such as something like "we are closed today due to weather conditions, please call back or leave a voicemail and we will get back to you as soon as weather permits"  Is there way fact to perform this in a script? (Have them record a prompt based on a number they could call, and then store it somewhere and have the script play it?) I hope i am putting this question in a way that can be understood. I am relativley new to this type of function any assist would be greatly appreciated.

    This is relatively easy and requires only a few steps to implement something basic.  See if this gets you going in the right direction:
    Prompt Manager Script
    startacceptrepo_user = authenticate user /* you will hard code the username/password here */  successful    recording = record prompt()      successful        upload prompt(recording, repo_user, filename, overwrite = true)          successful            play prompt(prompt uploaded successfully)            terminate            end
    Customer Service Script
    startacceptstart_time = t[now]play prompt(filename)if (t[now].getTime() - start_time.getTime() > 3000) /* if the message is greater than 3 seconds, it probably exists */  true    goto emergency_routing  false    goto normal_routinglabel emergency_routingterminateendlabel normal_routing...end
    To turn on the emergency, you call into the Prompt Manager, created your recording, and press # when finished.  The Customer Service script will attempt to play what's in the recording, and if the recording duration is greater than 3 seconds, it assumes a recording was played out to the caller and initiates the emergency routing logic.
    To turn off the emergency, you call into the Prompt Manager, press mute on the phone, and press # within 3 seconds.  The Customer Service script will attempt to play what's in the recording, and if the recording duration is less than 3 seconds, it assumes no recording was played out to the caller and initiates the normal routing logic.
    You can take this small example and add so many more features, such as:
    Authentication
    Authorization
    Multiple Recordings
    Review, Re-record, Delete, for the prompt
    A message that informs you if the current status is on or off
    Multi script support (not just Customer Service, but Help Desk, and Sales too)
    Etc.
    Anthony

  • Intermittent lock screen PIN input on Yoga 13

    About 1/3 of the time when I swipe the lock screen on the Yoga 13 to enter a PIN, I get a large touch screen PIN pad that pops up to touch the digits, which is the desired outcome.  Why is it that the other 2/3 of the time there is no pop up and I must enter the digits from the keyboard rather than being presented with the touch screen input option?

    Any update on this? I think there is a major bug in their software. I find that if you lock your screen and wake while in laptop mode, the virtual pin pad will automatically appear and stay there until you finish typing your pin. If you lock your screen and attempt to wake while in stand, tent, or tablet moden, the virtual pin pad does not automatically appear. In addition, while in these modes, when you press the input prompt to make the virtual pin/keyboard appear, it only appears for brief moment and then disappears-sometimes even while you are still typing. This is definitely a bug. I bought this laptop yesterday and found this issue within 30 minutes of playing with it at home. I submitted a help ticket yesterday regarding this issue. The tech eventually had me restore to factory conditions. After installing all the latest updates, I cam CONFIRM that this issue STILL persists! This is not me accidentally tapping outside of the pin/keyboard and causing it to minimize. This does it all on its own, and the tech was supposedly able to see this issue when he remotely took over my laptop. I have Yoga 2 2-in-1 11 inch.

  • Data Selection for report based upon a 'Prompt Value'

    I want to report information in my report based upon a 'user input prompt value'
    for example:
    'Enter Shareholder Selection - A-Active, I-Inactive, B-Both Active and Inactive'
    if the user enters 'A', the report selects only active shareholders
    if the user enters 'I', the report selects only inactive shareholders
    if the user enters 'B' the report selects all shareholders, active and inactive
    the field in the database that this based upon is their total share value.
    if this field is greater than zero (>0) they are considerd 'active'
    if this field is equal to zero (=0) they are considered 'inactive'.
    I have tried creating some type of filter,  but am not having any luck. 
    I saw a few examples within the forums that I have tried without any luck....unfortunately most of the examples I've seen are base one only two choices.
    I'm sure I need to create some type of 'independant varible' but am not sure how to do that either.
    Any suggestions would be appreciated.
    Thanks.

    Hi Daryl,
    I Tried this unsuccessfully in DESKI . We can't Eliminate Rows having Empty Measure Values or Measure with 0 as values using Table Level Filter as FIlter can't FIlter rows based on Prompt value selection dynamically. Filters filter rows at a time and not based on 3 condition as Active, Inactive and Both. thus filters are of no use.
    I Tried this in WEBI, and it is working perfectly you donu2019t have to create any Object in Universe, you can do it using function UserResponse() at report level.
    Hence if you are comfortable using WEBI for Generating this report then Follow the steps.
    1. Create Report With Name and Shares Object. It will display all Shareholder Names and No.of shares they hold.
    2. Use Status Object in Query filter, use condition as u201CEqual Tou201D and Select prompt. It  contains Active, Inactive and Both as values.
    3. Report will Display all Shareholder names and No. of  shares  like 45, 789, 0, 4562 where 0 is inactive Shareholder and all other are active shareholder.
    4. Create Variable using Formula.
    =If(UserResponse("Enter Status:")="Active" And [Shares]>0;[Shares];If(UserResponse("Enter Status:")="Inactive" And [Shares]<=0;[Shares];If(UserResponse("Enter Status:")="Both";[Shares])))
    5. Remove Shares Object from the report and Put Variable created with Names of Shareholders.
    6. Select Table-> Properties-> Display-> Uncheck the Option u201CShow Rows with Empty Measure Valuesu201D
    7. Report will display Value correctly as per your Prompt value selection.
    I Hope this Helpsu2026
    Thanksu2026
    Pratik

  • How can i validate current row input text field like required.

    Hi All,
    jdev 11.1.2.1.0
    in my use case i have drag drop one viewobject as a adf table. and in table i have also add one extra input text field which is not based on
    vo.
    now i want to validate current row input text field not null when i commit row.
    but when i using required property true. it worked for all row in table. problem is that i want only current row input text field validate not all
    thanks,
    Manish

    When the user tries commit the data by clicking on the button -- For that button, have the logic in the actionlistener method to check if the additional input field is NULL or NOT.
    If it is NULL, show an error message using FacesContext.addMessage() API.
    Thanks,
    Navaneeth

  • Error when using Analytic view with Input Parameters

    Hi,
    I am trying to create an info space based on my Analytic view which has input parameters. The infospace is validated and indexed without any issue. However when I ran the view, I get an error (50011) as it is unable to fetch any results. I tried using an infospace based on Calculation view with input parameters and the explorer view works without any issue.
    Has anyone faced similar issues?
    We are using HANA SP 6 rev 67 and BI 4.0 SP 4.
    Also is there a way to enable input prompts for the users when they refresh the BO Explorer view? If not currently available is there any work around ?
    Thanks

    Hello George,
    I don't have any personalization set on the info space. Also I am using mapped Account in BI to connect to HANA. The confusing part is that it is able to validate the infospace with the input parameters and index it. However query does not return any results. I even tried running the same query which explorer sends to HANA in the SQL editor and there too the same results,the query does not return anything. The model does return data when I do a data preview and if accessed from other tools like AAO.
    Also when I use SSO connection to HANA, indexing of the infospace fails. Where can I see the error log?
    Thanks,

  • How to create a Mapping with Input Parameter?

    Hi,
    I have a target table where the primary key column should be loaded with an Input parameter value. How can we implement this? Let me know if any examples are available?
    Regards
    Kishan

    Use a map input operator in your mapping. In the outgroup add an attribute, mapp the attribute with the column and then you can start the mapping with an extra input parameter.
    Bye
    Detlef

  • How to combine  two user prompts into 1 single prompt from two Webi Queries

    Hi All,
    I developed a single webi report from two different queries on top of 2 BW OLAP universe .
    Here I have one user input prompt for each query so I want to combine them into one single user input promt which  should pass the user input value to both the Webi queries feeding data to the  single webi report.
    I found that the webi doc has auto checked merge dimensions enabled but it is not providing combined resluts from both the queries .
    Any inputs are greatlt appreciated.
    Thanks

    Stratos
    Firstly ,I appreciate your responses for my two questions.
    Both the prompts I am using are from the masterdata and they are similar.data types.I think the transactional data is not available in BW for one of the prompt ,hence I am not getting consistent data.
    Anyway will do further investigation in finding similarities and let you know.
    Thanks a lot

Maybe you are looking for

  • How can I find/sync my old iPhone camera roll photos?

    I've searched about 5 different ways here on the forums and can't find an answer to this question. I recently upgraded my iPhone 3Gs to an iPhone 4. I backed up the old phone and just sold it a couple of days ago. Here's my problem: I can't find the

  • Run MS Windows executable on client machine

    Hi All, I am using Dev9i. My client machines will be MS Windows. My Forms will execute over the web. I need to have a Form read the client machine MAC Address and display it in the Form. There is an executable on the client machines, getmac.exe that

  • Digital Signature

    Here's the issue... I just upgraded from Windows XP at work to Windows 7. I have Adobe Acrobat 8. I know that there are some issues with printing and stuff since CS3 doesn't quite work with Windows 7. The patches, etc, help some. I used to be able to

  • Adobe after effect problem

    I have a big problem with adobe after effect, I wanted to install the trial version, But after waiting all the download is complete, nothing happened, nothing moved, and I have not been able to found what I download I have no other software from Adob

  • Doing an update in form

    hi all, I am working on oracle forms. I need to do an update of a field in the database, but that update should not commit the form. How can I do an independent / part commit in a form. I'll be thankful to you all for any help. Thanks and Rgds, Amles