Text input in text components in swing?

Hi,
is there any UML diagram, or any site on how text input is carried out in text components? Is it just a simple matter of JTextComponent adding itself as a KeyListener to itself, and then updating the document with each key press? or is there a little more too it?
thanks,
J

justinlawler wrote:
or is there a little more too it?There's a lot more to it. I think good beginning reading is the summary at the top of the [Javadoc for JTextComponent|http://java.sun.com/javase/6/docs/api/javax/swing/text/JTextComponent.html] . It is a convoluted API that has many "kludges" that can't be completely removed because of the need for backwards compatibility.
I'd also recommend reading up on the classes EditorKit, InputMap, ActionMap, Keymap, and (Basic)TextUI. Good luck!

Similar Messages

  • MouseChildren = False + Text Input = no text selection cursor

    I need to be able to set mouseChildren to false and still see
    the text selection cursor when rolling over the field. Everything
    is currently working correctly except the text selection cursor has
    changed to the regular pointer. Any ideas?

    Hello,
    Could you please open a new bug report on this over at bugbase.adobe.com? Please include sample media. Once the bug has been added would you mind posting back with the URL so that others affected can add their votes and comments?
    Thanks,
    Nimit

  • Text Input Autocomplete

    How do you make a text input control behave like a normal web
    form control that displays suggestion as you type in the control.
    I'm sure Flex can do this I am apparently looking in the wrong
    places. Any help would be greatly appreciated. Thanks so much!
    curtkauf

    The Adobe site has an Exchange section where there are many
    flex components, some are free, some are not.
    Here's one that does what you need
    http://www.adobe.com/cfusion/exchange/index.cfm?event=extensionDetail&loc=en_us&extid=1340 018

  • Text input?

    How can i make text input in the red rentangles?
    Picture
    Edited by: ImuN on Aug 3, 2009 12:42 AM

    Hi,
    You can use a JTextfield as following :
    import java.awt.Color;
    import java.awt.Dimension;
    import javax.swing.BorderFactory;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JTextField;
    public class Test {
         public static void main(String [] args){
              JFrame jf = new JFrame();
              jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              jf.setLocationRelativeTo(null);
              JPanel jp = new JPanel(null);
              jp.setBackground(Color.green);
              JTextField jtf = new JTextField();
              jtf.setBounds(10, 10, 100, 20);
              jtf.setOpaque(false);
              jtf.setBorder(BorderFactory.createLineBorder(Color.red));
              jp.add(jtf);
              jf.setMinimumSize(new Dimension(300,300));
              jf.setContentPane(jp);
              jf.setVisible(true);
    }

  • Text input popup

    I am writing a simple RSS reader app in Flex (for AIR).
    I have a "change feed" button in my app. I want this to
    launch a popup with text input, to take the URL as a string and
    return it to my main app. This seems like something that should be
    incredibly, and I'm missing something. Any help would be
    apreciated.

    You can create such a popup with a TitleWindow and
    PopupManager:
    ------------ MyPopup.mxml ----------------
    <?xml version="1.0"?>
    <mx:TitleWindow xmlns:mx="
    http://www.adobe.com/2006/mxml">
    <mx:Script>
    <![CDATA[
    import mx.managers.PopUpManager;
    ]]>
    </mx:Script>
    <mx:TextInput width="200" />
    <mx:Button label="Done"
    click="PopUpManager.removePopUp(this);"/>
    </mx:TitleWindow>
    --------------------- Test.mxml ----------------------
    <?xml version="1.0"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml">
    <mx:Script>
    <![CDATA[
    import mx.managers.PopUpManager;
    import mx.core.IFlexDisplayObject;
    import components.MyPopup;
    private function showMyPopup():void {
    var helpWindow:IFlexDisplayObject =
    PopUpManager.createPopUp(this, MyPopup, false);
    ]]>
    </mx:Script>
    <mx:Button click="showMyPopup();" label="Show My
    Popup"/>
    </mx:Application>

  • Text-input component with auto-complete functionality for mobile

    Hey guys,
    I wonder if there is a text-input component with auto-complete functionality optimized for mobile development with AIR like the one that Android provides natively as you can see here http://developer.android.com/reference/android/widget/AutoCompleteTextView.html and here http://developer.android.com/resources/tutorials/views/hello-autocomplete.html.
    At least I didn't find it in the latest SDK and I think such a component is pretty standard nowadays. Or did I simply overlook it?
    Thank you guys for any advice.
    Regards,
    Thilo

    Hi relaxtraja,
    thanks for your reply!
    I knew that there are a lot of auto-complete scripts on the web. What I was hoping was, that Adobe provides an officially supported auto-complete component optimized for mobile as part of the SDK (like in the Android SDK as I pointed out), but that doesn't seem to be the case. It's sad, because it's an essential part of modern UIs in mobile applications.
    I've already created an auto-complete component by myself based on Spark components and I will end up using it. But I will have to optimize it for mobile applications beforehands. I just think something this essential should be provided by the SDK.
    However, thanks for posting!
    Regards,
    Thilo

  • Make use of text input to submit text

    Hello,
    thanks for a lot of wonderful features in the second beta release. I particularly like the improved ability to do editing in catalyst (instead of always going back to illustrator to modify the slightest things, in the previous beta) and the improved performance.
    My question is:
    How can I submit text in a text input? (Say, the user keys in something into a text input, and clicks submit, is there a way for me to "receive" the things he keyed in and maybe even validate it?)
    Thanks in advance!
    By the way, I would like it if the performance can be improved further and i also vote for allowing us to reorder states in catalyst (I don't seem to be able to promote that idea in the Labs IDeas section)!
    Regards,
    Colin

    Hey Colin,
    Thanks for the feedback, we appreciate it!
    So, to 'receive' the user's input text and validate it, you're going to have to bring your fxp project into Flash Builder and do a little bit of coding.
    The TextInput documentation gives some really good detail on how you can work with this control in more advanced ways: http://help.adobe.com/en_US/FlashPlatform/beta/reference/actionscript/3/spark/components/T extInput.html
    I think you're going to want to listen to a textInput, or change event, and then validate there.
    You can also add a Validator to validate your text input, where this flex quick start to validation guide might help you: http://www.adobe.com/devnet/flex/quickstart/validating_data/
    In the meantime, if you have any ideas on how a feature like this may work in Catalyst, please post to the ideas site.
    http://ideas.adobe.com/ct/s.bix?c=DA4859AD-8934-4F93-983A-4219E2DD9275
    Thanks,
    Tara

  • Disabling a Text Input created through the TEXT TOOL?

    Hi There,
    I have created a text input area. I havent used the flash
    text components. I used the TEXT TOOL. In the properties I set it
    to "input" type so that i could input data. All the features works
    fine except one. I have to disable the text area when user clicks a
    button. I dint get any help from the flash help.
    The main objective is that the text input area shouldnt take
    input from the user when the button is ON, once the button is off,
    the cursor should be at the point where the user left and he can
    type thru.
    Is this possible? I have achieved this functionality using
    the textarea component of Flash, but not using the input text area
    created using the TEXT TOOL.
    Can anyone help me.

    use the type property of textfields to change your textfield
    to "dynamic "when you want to disable input and assign it to
    "input" when you want to enable input.

  • Text input options missing

    Hi,
    After running some updates yesterday, the "show text input options" is no longer available in the options. Neither can I select suretype when writing a message. Would appreciate some help.
    Thanks
    Solved!
    Go to Solution.

    Had to re-boot after removing an application and everything back to normal! What bugs me is that my service provider tech never brought up a re-boot but rather wanted me to delete all my data and start all over!

  • How to make numbers in message text input  fields left aligned?

    Hi Friends
    I have completed one of my task .but getting result right side of the field.
    how to make numbers in message text input  fields left aligned?
    Thanks
    Aravinda

    Hi ,
    Sorry for late replay i am trying this alos not set that page....
    pageContext.forwardImmediatelyToCurrentPage(null, true, null);
    and one more that kff field working is fine for ex display any text pled displayed properly and only problem is not set the value and HrSitKeyFlex6 and HrSitKeyFlex7 fields are perfectly get the values but not pront HrSitKeyFlex8 that only my issue....
    Regards,
    Srini

  • Conditional for a text input box NOT being null? Sorry for asking so many questions!

    Okay, here's the situation. I'm creating a simulation of a form on which there are several text input boxes, 7 of which are mandatory fields. I know I can use a conditional to check whether the box has nothing in it by creating a null variable with no value and doing "if [box variable] is equal to [null variable] then", but the problem is that the validation captions I need to show need to be shown in order, that is to say that the caption for entering a value for the first box will always be shown if that box is null regardless of the contents of other boxes, the second will be shown if that one is null and the first one isn't etc.
    When I was investigating this I noticed a post by Lilybiri saying that comparison with a null variable doesn't work for "not equal to" so I'm having a hard time figuring out how to show the captions based on priority. For example, to show the second caption I need to not only check whether the second box variable is null, but also whether the first one isn't.
    It gets pretty crazy further along the line where I get to the 7th mandatory field and need to check whether the first, second, third, fourth, fifth and sixth boxes are NOT null and whether the 7th one IS. Help!
    I did come up with one potential solution to this prior to posting: if I set a different advanced action for each input box losing focus which checks whether the variable is null and if so sets a "flag" variable to 0, and in the else set it to 1, I imagine I can then replace the "not equal to" with a check to that flag variable being equal to 1 (which means there is text in the box). I think this will work but I thought I'd check to see if there's an easier way first.

    No it DOESN'T require everything to be on one slide.  It just has to LOOK as if that's what it is.
    I would suggest that it doesn't really matter how many Captivate slides are involved in the final solution, as long as it works the same way (or as close as possible) to the original software that you are simulating.  Your users don't frankly know or care how you achieved the simulation.  I guarantee they won't be thinking of you or Captivate.
    In my experience, you can make creating elearning a lot more difficult than it needs to be in Captivate by trying to rebuild the app, rather than just simulating how it works. For example, thinking that if everything happened on one web page or screen in the app then it must also happen on a single slide in Captivate.  The fact of the matter is IT DOESN'T need to work this way.  And in some cases it might even be impossible to reproduce in Captivate this way.
    So the quickest path to a solution is often to use multiple slides, which has the advantage of allowing you to "fix" certain things on screen (e.g. the contents of fields already visited) by using READ ONLY variable output in transparent captions, focusing only on one element of the interface that the user can interact with on that slide.  It doesn't necessarily prevent you from moving back and forth between elements, just as you can in the original app.  But it is far easier to create and maintain.
    I'm not saying you wouldn't be able to pull this off on one slide in Captivate, but it is going to require a LOT of variables and Advanced Actions to build and debug.  So the term Rapid Elearning becomes something of a misnomer if it takes you a long time to complete one slide.

  • Text input box for displaying notes

    How can I use a text input box so delegates can write notes in which then appear on other pages as they work through the course.
    Ken

    It seems you would be able to do this with user variables, in which you store the content retrieved from the Text Entry Box. Later on (other slides) you can use this content by adding it to a Text Caption. Beware: I'm not sure about the amount of characters that can be stored.

  • 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

  • Text input field

    How can I create a text input field?

    Ok, I found the solution by a lot of searching and trial and error:
    sym.$('#nickname').val("XXX");
    ..., where "nickname" is the id of the input field.

  • Text input variable

    How do i make a text input element have a variable ?.....I
    don't mean instance name ....i mean variable!

    I'd say you just don't do it that way, but to give more
    advice I'd need more info on what and why ...
    There should be a lot of solutions to your problen once it's
    nature is clearer.

Maybe you are looking for

  • Install Oracle 8.1.7 on redhat 9

    Hi all, I have installed oracle 8i on rh 9. installation was finished without warnings, but when I try to do ". oratab" before run the db, I have this error:"bash : ora8:/home/oracle/OraHOme:Y no such file or directory. Where is the problem? I have s

  • Lost most of my music after installing and using iTunes Match.  Help!

    I hope somebody can help me.  I purchased a MacBook Air off of a previous owner, and heard that iTunes Match was a good way to access all your music without having to use up hard disk space to actually store it locally. So, I subsribed to iTunes Matc

  • New mac 21.5, tried to upgrade to Yosemite get error, what's up

    Just bought an iMac, tried to download Yosemite upgrade, get error, what to do.

  • IPhone Pages lost character styles in reimport

    OK, this is really bad. I was editing a Pages document on the iPhone. A 200,000 word novel. Upon reimport, i have lost all my character styles. (paragraphs styles are still there). The text is still formatted, but has no associated style This is a co

  • Can't open ical preferences

    Hello! I recently had the harddrive problems where I got the gray screen of death.  Went in to the Apple store, got it fixed.  Now, my ical is empty.  I tried to go to iCal preferences to set up all my google calendars but the iCal preferences will n