Single character input?

I am trying to accept one character at time from the user, but I am having trouble doing this. I know this is easily done in in C++, but I haven't found anything that seems to do the job in Java. This is for use in an application that will be used on the comand line.
Am I going to have to do some JNI to achieve this?

Do you want 'getchar(); in C++?
If you use command line argument, you can treat
public static void main(String args[]) <- String args.
C:> java classname argument (enter)
command line argument will input args.
you can access args[0], args[1] and so on.
args[0] is String. So, you should change args[0] to char Array or use charAt method. ^^;

Similar Messages

  • Is it possible to horizontally reverse a single character in a text box containing other text?

    I have a client that wants every subhead to begin with a backward character throughout the entire book. 21 chapters, roughly 4 - 5 subheadings per chapter - the reversed character will always be an R in the same font. I don't know if there's a style setting I'm overlooking, but I would very much like to be able to define it as a character style. Much thanks in advance to anyone posting useful information!

    I don't think it's possible to reverse just one character, but here is an interesting work-around. From jongware, (a frequent and helpful poster here), a script demo that you can use to make a single character font.
    Download the One-Character Demo from http://www.jongware.com/binaries/indyfont_demo.zip, unpack and copy it into your User Scripts folder. Run the script once to set up a font template, draw your custom character -- the default is a bullet --, then run the script again to convert it to an OpenType font.
    You would need to flip your letter R and convert it to outlines, then use the script to make it into a one-character font. You cant then set your subhead style to have bulleted (with your reverse R defined as the bullet).

  • In Report output, Missing Plan data with the Seletion option - Single Value input (more than 10 values)

    Hi ,
    I am running the Query (Actual Vs Plan) in the BEx Analyzer, with the input for the characteristic like Fiscal Year, Posting Period and Cost Center(20 Single value) it not comming up with the plan data - Actual data is coming up fine.
    If i gave 10 or less than 10 inputs ( single values input in the selection - option ) for the characteristic COST CENTER it coming up with all the data (Both plan and Actual).  if the COST CENTER input values more than 10, it not coming up plan data (Actual data is coming)
    Cost Center Variable is designed with an Authorization Variable.
    Can any one please help me to know why plan data is getting miss when the input limit more than 10 (single values input in the selection - option) in the Cost Center Variable? 
    An also could you please share that, What is the Max limit for the Single values and Range Value for an Selection - option in the BEx Variable.

    A)    Hi ,
                 In Report, I am having 2 variant.
    1.   For one variant, i have saved the input values for both the Select Single values & Select range for the cost center.
    8 Values in single & 4 Values in Ranges         
    It coming up with data successfully.
    2.    Another variant having input only for select single values for the COST CENTER, it contains 20 records (This variant also have restricted with the same values as above variant for COSTCENTER variable)
    Fiscal year                         : 2012
    Posting period                   : 8
    Cost Center                        : 20 values in Single                                             (Here I have separated the range values into single)
    It’s not coming up with plan data. 
    B)   If I gave only first 10 values in the Single value, Output for both actual and Plan are coming up…………. If I gave the Second 10 value in the Single value and got the Output for both actual and Plan.
    C)    I have also checked the following details of this query, 
    Executed the query in RSECADMIN and checked the Authorization log as below,
    Relevant Characteristics for Detailed Authorization Check  (Characteristics with Full Authorization Are Not Listed!)
      List of Effective Authorization-Relevant Characteristics for InfoProvider ZPCA_M36: 
    List Is Empty:
      There Are No Characteristics That Have to Be Checked in Detail 
              2.  Checked the Single value input by iteration, 1 to 10, it retrieves data.  More than 10 like 11, 12 … is getting failed to pull plan data.
              3. checked the selection Value range by iteration and I gave the range value count up to 25        inputs, its works fine.
    Thanks.
    Regards,
    Subashini.

  • LSMW SEL_DATE filed Single - Character Flag

    Dear gurus
    i created a lsmw for T/code VK12 . I faced problem when the LSMW read till convert data.
    In the VK12 , this Screen Field SEL_DATE will be my valid on date. I created the source filed Valid on date to match the mapping with SEL_DATE.
    Here are my example of data:
    SEL_DATE : 12022009
    VALID_ON : 12022009 ( read from my text file)
    the recording , mappings and source fields are created perfectly. Even read data display , the record able to shows out accordingly. But when comes to convert data , SEL_DATE return to me 1 Field Length.
    Now i feel so puzzled, why this happen?
    After some checking find out that this particular field SEL_DATE is a "SINGLE-CHARACTER FLAG"
    expert out there, do you have any suggestions or guidance? i really need this field as to identify my record.
    Without valid on date i can't call out the specific record and update it using LSMW
    thanks
    Wilson Low

    HI all,
    I recently have the same problem. With the help of other forum post, I was able to solve this problem in this way:
    1. Export the lsmw project (Extras->Export Projects) to a file.
    2. Edit the exported file and search for SEL_DATE field. Edit the last column in the right and change:
    000001000002000001CHARC to 000001000002000010CHARC
    3. Import the project using the modified file (Extras->Import Projects).
    Problem solved.
    Cheers.

  • How to copy a single character on a Q10?

    Hello forum,
    To copy text on my Q10 one needs to select a text and tap on it for a few seconds in order to get the copy icon available. However, when I want to copy a single character it doens't work because the OS thinks I'm hitting the balloon/arrow either in front or behind the selected character.
    Since there are no keyboard shortcuts for copy-pasting in OS10 I wonder how I should get this done (and I mean, just straight forward copying a single character, not a workaround)
    Thanks

    I have big fat fingers, and I didn't tap it, just touch that selected area for a second and release.
    It works.
    1. If any post helps you please click the below the post(s) that helped you.
    2. Please resolve your thread by marking the post "Solution?" which solved it for you!
    3. Install free BlackBerry Protect today for backups of contacts and data.
    4. Guide to Unlocking your BlackBerry & Unlock Codes
    Join our BBM Channels (Beta)
    BlackBerry Support Forums Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • I cannot select a single character

    I'm running Pages 5.2.2 on MacOS 10.9.4 on a 2011 MacBook Pro. The problem is I cannot select a single character with my Magic Mouse. If I try to drag over a single letter to select it, the cursor is positioned either before or after the letter. I can select and format groups of two or more characters, but not just one. It works with the trackpad though. I can select single characters with the mouse in other apps such as Word.

    While we all have MacBooks in this forum most of us don’t run Mountain Lion. There's a Mountain Lion Support Community where everybody has Mountain Lion. You should also post this question there to increase your chances of getting an answer. https://discussions.apple.com/community/mac_os/os_x_mountain_lion

  • How do I delete or edit a captured text layer that contains a single character in Cp 5?

    My captured text layer contains a single character '7'. This renders immediately when I publish the movie, but I don't get any options when I try to edit the layer by right-clicking on it.
    Can anyone help as this is very annoying...

    Hello,
    Welcome on the forum.
    Since you are talking about 'capture', I presume you are pointing to a Typing object? You cannot edit this right away. Depending on what you want to realize, could propose two workarounds:
    If you only want to show something typing (demonstration - but another text than your character), replace the Typing object by a Text Animation (right-click menu), you'll be able to edit it.
    If you want the user to type in a text, delete the Typing object and replace it by a Text Entry Box.
    Lilybiri

  • Curve 9380: Return from character input to QWERTY keyboard

    Hello,
    I own BlackBerry Curve 9380 smartphone (all touch, without physical keyboard).
    I have the following issue:
    Consider you're writing a text message, when you need a question mark you're tapping on the "&% 123"  button in the left-down corner and selecting the question mark. In order to return back to the original QWERTY keyboard you need to tap on the button again, now "ABC".
    Is that possible to automate the return to the QWERTY keyboard from character input keyboard after tapping the "space" button?
    Keyboard is returning automatically back only if you will tap on the "Enter" button.
    Adding the "space" button would be a great enhancement for touch-based devices featuring BlackBerry 7 OS.
    Thank you.
    P.S. I didn't find any better medium for my concern than this forum, if somebody knows how to reach directly to software engineering group, please let me know.

    You still have the constructor declared inside the main method! :-)
    public class TrySimpleVectorWithKeyboardInput
    public static void main(String[] args)
    public TrySimpleVectorWithKeyboardInput()
    {}Move the two lines to outside the main. It should look something like this..
    import java.util.*;
    import java.io.*;
    public class TrySimpleVectorWithKeyboardInput {
        public TrySimpleVectorWithKeyboardInput() {
          // constructor code goes here
        public static void main(String[] args)    {
            Vector names = new Vector();       
            FormattedInput kb = new FormattedInput();       
            for (int i = 0; i < 5; i++) {         
                try {           
                    System.out.print("Enter a  name ");           
                    names.add( kb.readString());         
                } catch (InvalidUserInputException e) {           
                    System.out.println("InvalidUserInputException thrown. \n" + e.getMessage());         
            System.out.println("\nThe names in the vector are:\n ");       
            Iterator j = names.iterator();       
            while (j.hasNext()) {
                System.out.println(j.next());       
    }

  • How to pass a single character to dll (as a parameter)

    How do pass a single character to dll (as a parameter). This is a third party dll that i am unable to change.
    e.g.: int functionName(char* process, char myChar);

    My apoligies, I am trying to pass a char from Teststand. Passing as a char is not one of the Category
     I tried sending (for example) : Locals.myChar[0].  Which is acceptable in C++, but gives me an error via Teststand.

  • GREP to find single character

    I put together a GREP style inside of a paragraph style that is supposed to find all instances in the paragraph where there is one single character inside of parethesis. This is what I typed in:
    (?<=\().(?-\))
    and I assigned a character style that is supposed to change the character inside the parenthesis, but not the parenthesis themselves.
    But it's not working. Can anyone help me with how to fix it?

    For any other readers greppling with same,
    (?<=\().(?=\))
    [Breakdown:
    (?<=x) Lookbehind string x
    \(  .. which is an open parenthesis -- escaped, because it's a GREP special character
    .  Any character. Any at all! Imagine that!
    (?=y) Lookahead string y
    \)  .. which is a closing parenthesis -- see above]

  • Textarea - create String that acts like a single character

    Hi guys,
    I am trying to create a string in a textarea that acts like a single character. By this, I mean that the user cannot edit the contents of that section of text. Here's an example:
    Textarea text:
    [Number of Iterations] * 35 / 200
    I want the [Number of Iterations] to be read-only. In addition, if the user tries to delete the beginning or end of [Number of Iterations], the whole thing is deleted. If possible, I would like cursor operations to treat it like a single character as well (i.e. to go from |[Number of Iterations] to [Number of Iterations]| takes a single right button press).
    Some commercial applications like Microsoft Word do this with Automatically created text in documents (like page numbers and date stamps) and I was wondering if I could do the same thing using a Textarea.
    Any help would be greatly appreciated.
    Thanks in advance,
    Steve

    A JTextPane allows you to add components to the text pane. So you might be able to create a JLabel with your desired text and insert the label into the text pane.

  • Character input disaplay after " " when show up in af:outputFormatted

    When I input text after "<" in text field and save it in database varchar2 column. It is found that all character disappear after "<" when I retrieve it with af:outputFormatted. If I retrieve it with outputText. It can show up properly.
    For example, I input <abc> in the text field. I then the retrieve character from database. All the text <abc> disappear.

    Sorry for typo in title: it should read as "character input disappear after "<" when show up in <af:outputFormatted
    If I input &lt;abc>, then, the text <abc> show up properly
    hence, what can be done to fix it if I just input <abc> instead of &lt;abc>

  • Weird character input in textfield when hitting CTRL+somekeys

    Hi,
    Whenever an input textfield has the focus, some ctrl+something key combinations (for example ctrl+s, ctrl+o) produce some weird character input, that is, these weird characters (certainly non-ascii) appear in the textfield as if you had typed them.
    This is obviously a bug, but is there any workaround? How can I prevent these combinations of keys to produce any text input at all? (without removing the focus from the textfield)?
    This only happens in Flash Player (and Adobe AIR): I've never seen those character appear in any application as a result of ctrl+S, ctrl+O or any key combination (except alt+<numerical character code>)
    Thanks in advance
    m.

    I'm not entirely sure that the issue we're facing is a font issue - I've managed to set a font for the TextField in question that can handle Japanese as well as English characters (in this case I'm using the Bitstream Cyberbit font), following guidelines in an article on the subject:
    http://www.onjava.com/pub/a/onjava/2001/04/12/internationalization.html
    If I enter the Japanese characters in a window of a native application, and then copy & paste into the TextField in my Java applet, they appear when using this font, and it seems like the applet can interpret them OK (in IE at least, still haven't tested in NS as yet) - the problem is that when entering the characters directly into the applet using the Win2k IME facility, they only appear as question marks.
    Damian.

  • Double character input error when entering data in numbers using Bluetooth keyboard.

    Using a bluetooth keyboard (Logitech) sometimes causes a double character input when entering data in numbers.
    For example if wish to enter the number "22" or the word "in" they become "2222" and "iinn". Pressing enter of tab also causes a double jump
    This problem is not always solved by turning keyboard off and on or by closing down and restarting numbers.
    This problem does not occur in any other app.
    I have used 2 different Logitech keyboards (ultra-slim and the recently new folio keyboard) and both caused the same problem.
    The error is sporadic but frequent and has lead to me often having to switch back to touch input.
    Very frustrating considering these excellent keyboards are ideal for using in numbers when working correctly!
    ANy advice would be much appreciated

    Zombie,
    Not much help I'm afraid, but I just saw your post & wanted to let you know that I have the same problem, but for me it manifests itself in many apps, and it happens with the Apple bluetooth keyboard
    . The only thing I've noticed is that it only seems to happen when I first start typing after not using the keyboard for a while (I'm not sure how long a while is, but maybe 30 seconds or so). Then I'll type & the first few letters will be fine, and then one letter double-types, and then it's fine again until I stop using it for whatever the threshold amount of time is. I'm guessing that it has something to do with the iPad's battery management & that it's shutting off the connection to the keyboard or something & once it picks it back up, then it double-types that letter.
    At least in Pages, it isn't as big of a deal because I know it's coming, I can correct it & then type for a long time. In Numbers, my keyboard use is much less consistent, so I need to be more cognisant of it.

  • How to make a filter in a table while giving single character

    hi,
    i have doubt in filter how to make a filter while giving single character in a table during runtime.
       if i give string like(A*) means then how it can retrive the data from the table

    look at:
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/60d5b593-ba83-2910-28a9-a7a7c7f5996f

Maybe you are looking for

  • How to put two ipods on one computer

    how to put two ipods on one computer

  • Trying to retrieve my apps but it tells me "account not in this store"

    I upgraded my ipod touch 4th gen and was then asked to restore my ipod and i did.  I retieved my photos from icloud but i am unable to get my apps, when i try to download it, it tells me "Account not in this store, your account is not valid for use i

  • Initial setup of SAP B-1

    We are in process of setting up SAP B-1 and would like to do it right the first time.  We are a USA based fishing lure manufacturer that has most of the assembly work done overseas.  (Haiti, Mexico, Philippines, China)  Consequently we are subject to

  • Export QT slideshow and only the first song plays.

    I did not have this problem with the previous version. All songs are from a playlist and are not purchased on iTunes. The slide show plays fine in iPhoto and then when exported only the first song plays in the QT version and after it silence. Can any

  • Sync Probelm -- An unknown error has occured (-48).

    Whenever I plug in my ipod i get this error, "The Ipod "My Ipod" cannot be synched. An unknown error has occured (-48)." Im not sure whats causing it, I know im not the only one, and ive realized this site fails at helping people. But if theres anyon