How to moniter and Replace every character typed into a JTextArea!

I have a JTextArea!
For every character typed on it in want to change that character to my own character...
For example if user types 'a' on key board, i want 'b' to be displayed on the JTextArea.
It should been seen on the screen...
Any idea?
P.N: I am doing a notepad like editor where in user can type Indic languages in phonetic notation... [Yea, Transliteration....] Does any one have any coding for that, Especially for Tamil... I want to get அம்மா, if i type "amma". I have the table of what should be replace with what! but i don't know how to make it work? any idea?

if user types 'a' on key board, i want 'b' to be displayed on the JTextArea.Add a KeyListener and override the keyTyped method to increment the keyChar field of the KeyEvent.
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import javax.swing.JFrame;
import javax.swing.JTextArea;
import javax.swing.SwingUtilities;
public class KeyShifter {
  public static void main(String[] args) {
   SwingUtilities.invokeLater(new Runnable() {
     public void run() {
       new KeyShifter().makeUI();
  void makeUI() {
    JTextArea textArea = new JTextArea();
    textArea.addKeyListener(new KeyAdapter() {
      public void keyTyped(KeyEvent ke) {
        char c = (char) (ke.getKeyChar() + 1);
        ke.setKeyChar(c);
    JFrame frame = new JFrame("Key Shifter");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.setSize(200, 200);
    frame.add(textArea);
    frame.setLocationRelativeTo(null);
    frame.setVisible(true);
So maybe it'd be better to have two text fields... one what was typed (as per normal) and a JTextArea to display the transliterated text. Just an idea.And a very good idea, Keith... just testing this was creepy! Yup, this could be recoded to append a character other than the one typed, to a second, uneditable, text area. I'd use a Map or some other data structure to get the transliterated character from the one typed.
db

Similar Messages

  • Pause after every character typed into title text

    Typing text into title delays for 3 seconds after each character typed.
    The best work around I found was to type the text into textedit and paste once done.
    Any other suggestions?

    Is 4 the maximum number of characters that can be entered?
    Then the solution is easy:
    - set the maximum lenght property of the item to '4'
    - set the automatic skip property to 'YES'
    I hope this helps...

  • How to find and replace data in form fields in acrobat xi, its not allowing to do so while trying, a

    how to find and replace data in form fields in acrobat xi, its not allowing to do so while trying, asking for adobe livecycle to get installed. please help.

    Easiest way to do it is the following:
    - Open the PDF file in Acrobat.
    - Go to Tools - Forms - More Form Options - Export Data.
    - Save the form data as an XML file somewhere on your system.
    - Open XML the file in a plain-text editor (I recommend Notepad++).
    - Let's say you want to replace all the years in the dates from "2013" to "2014". Do a global Search&Replace of "2013-" to "2014-" (I added the dash just to make sure that only date fields are edited).
    - Save the XML file (maybe under a new name).
    - Go back to the PDF file, and now go to Tools - Forms - More Form Options - Import Data.
    - Select the edited XML file and import it.
    - Done!

  • How to find and replace any string between " "

    Hi everyone,
    Here my sample
    String szTest;
    szTest = "Yellow banana";
    szTest = "Blue monkey";
    szTest = "Red mango";
    szTest is only needed when it's in testing progress. Now I want to put all of that in the /*comment*/ so the released program won't run those code any more (but still keep szTest so I can use it for future develop testing).
    So Here what I want after using the Find and Replace Box:
    //String szTest; //Manual
    /*szTest = "Yellow banana";*/ //use find and replace
    /*szTest = "Blue monkey";*/ //use find and replace
    /*szTest = "Red mango";*/ //use find and replace
    I think I can do this with Regular expressions or Wildcards. But I don't know how to find and replace any string between " and ".
    Find: szTest = " ??Any string?? ";
    Replace with: /*szTest = " ??Any string?? ";*/
    Thanks for reading.

    Hi Nathan.j.Smith,
    Based on your issue, I suggest you can try the Joel's suggestion check your issue again. In addition, I find a MSDN document about how to use the Regex.Replace Method to match a regular expression pattern with a specified replacement string,
    maybe you will get some useful message.
    https://msdn.microsoft.com/en-us/library/xwewhkd1(v=vs.110).aspx
    If the above suggestion still could not provide you, could you please tell me what language you use to create the program for finding and replace any string using regular expression so that we will find the correct programming develop forum to support this
    issue?
    Best Regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • In Pages, how to search and replace text involving invisible characters?

    In Pages documents, how to search and replace text involving invisible characters, colors and font sizes—a task which is so easy in Mircosoft Word?

    I read that an older version of Pages allowed users to enter special characters in the search/replace fields, but this did not work for me.
    Here: http://www.macworld.com/article/1156533/pagesspecialcharacters.html
    I still am looking for a way to do this.

  • How to remove and replace keyboard on HP Touchsmart Notebook 15-D020NR

    I spilled a drink on my keyboard and now I cannot get the Caps Lock to turn off and a number of keys do not work. I need the instructions on how to remove and replace this no frame keyboard. Thank you.    

    On your Support page- look for Maintenance and Service Guide under Manuals. http://support.hp.com/us-en/product/HP-15-d000-TouchSmart-Notebook-PC-series/6627588/model/6761859/manuals

  • Satellite A30-921: How to remove and replace the memory?

    hi, can anyone help me how to remove and replace the memory of sat A30-921. and also, please give a detailed instruction.
    thank you in advance.

    Hi
    There is no much to explain. At the bottom side in the middle there is placed memory cover (fixed with two screws). Remove the cover and you will see 2 slots there. I dont know how much memory has you there but as Stefan said you can use max 2 GB of RAM (2x PC2700 1024MB - PA3313U-1M1G). How to remove memory modules you can see on http://www.hardwaresecrets.com/article/189/5
    Bye

  • I want to change my apple id primary e-mail from a .msn address to a .gmail address. The problem is that currently my .gmail address is my cover address and I cannot figure out how to remove and replace my gmail recovery address.

    I want to change my apple id primary e-mail from a .msn address to a .gmail address. The problem is that currently my .gmail address is my recovery address; I cannot figure out how to remove and replace my gmail recovery address with a new e-mail address.  I want to do this because I no longer use my .msn address.

    You should be able to change your rescue address by going to My Apple ID, signing in to manage your ID, then selecting the the Password and Security section, and answering the two security questions.  If you have trouble with this, contact the Apple account security team for your country to verify your identity and ask for assistance: Apple ID: Contacting Apple for help with Apple ID account security.  If your country isn't listed, contact iTunes store support by filling out this form: https://www.apple.com/emea/support/itunes/contact.html.

  • How to read and upload microsoft word file into database using forms9i

    Hi,
    How to read and upload microsoft word file into oracle database using forms9i. I appretiate if anyone can send me example or atleast a sujjetion.
    Thanks in advance
    Mahesh Ragineni

    The webutil package includes the ability up upload from the client to the database. See otn.oracle.com/products/forms and click on webutil for more details.
    Regards
    Grant Ronald
    Forms Product Management

  • How to Edit and Replace Psd Files in Adobe Flash - Help!

    Hi Everyone,
    I am new to flash and I am trying to build my first flash site using a flash template. I can use flash to edit certain components like header text, etc. But The content is impossible for me to change. I think that these are psd files, which I can open with gimp or another program and edit. I save and replace that file, but when I view movie again, the content is the same. I guess what I need to know is how to get these files back into my flash movie after I have edited them. Please help, I am no computer expert, but I am learning. A how to for dummies answer would be awesome.

    Maybe You should try the Flash-forum:
    http://forums.adobe.com/community/flash

  • How to find and replace text in Excel with Automator

    I am new to Automator. And I would like some help how I can create a service that will allow me to find and replace certain text in Excel. I noticed that there is an action to do this for Word documents, but not for Excel document.
    Any suggestions how I can do this?
    Thanks so much for your help.

    Easiest way to do it is the following:
    - Open the PDF file in Acrobat.
    - Go to Tools - Forms - More Form Options - Export Data.
    - Save the form data as an XML file somewhere on your system.
    - Open XML the file in a plain-text editor (I recommend Notepad++).
    - Let's say you want to replace all the years in the dates from "2013" to "2014". Do a global Search&Replace of "2013-" to "2014-" (I added the dash just to make sure that only date fields are edited).
    - Save the XML file (maybe under a new name).
    - Go back to the PDF file, and now go to Tools - Forms - More Form Options - Import Data.
    - Select the edited XML file and import it.
    - Done!

  • How to find and replace multiple cells at a time

    I am doing repetitive work re find text in numbers but then replace following cells with text. How can I find and replace multiple cells at a time?
    i.e. doing my own budget spreadsheet and coding all transactions with description and code

    Did you try the "Find/Replace" dialog box?:
    Then click the "Replace All" button in the bottom left.

  • How to copy and paste a document typed in the EpicWrite (esp. a text typed in Kannada)on a Microsoft Word 2007 page?

    02-03-2012
    For last one week, I have been trying in vain to copy and paste a document typed in the Epic Write on a Word 2007 format, so that I can retrieve or modify it anytime without depending on the Internet connection. Whenever, I paste on a webpage, it cannot be edited and when I transfer that on a Word page, only words & figures in English appear and the rest of the text is displayed in blank square boxes.
    How I can overcome this problem?

    Are that pages in Unicode?
    *[http://kn.wikipedia.org/wiki/%E0%B2%95%E0%B2%A8%E0%B3%8D%E0%B2%A8%E0%B2%A1]

  • How To: Find and replace multiple words in one Click ?

    I have an file with about 150 Pages where I want to replace a word about 500 time by one click.
    Find and Replace works but only with one word.
    How can I do it by one click ?

    You can't, not in Acrobat anyway.
    This is the kind of thing that should be done in the original file format,
    not in a PDF.

  • SharePoint Calc Column - How to Find and Replace ANY & ALL Values with Something Else

    Haven't found a solution on this even though it seems like it should be cut and dry.
    I have a column containing characters "-" (e.g., XXX123-123-fjhrh-sdafsdfsd). I want to find every "-" and replace it with "@". Seems easy but so far haven't found a solution. My calc column always seems to stop at the first
    occurence of "-" and only replace that one. Seems every forumula wants you to tell SharePoint where to start (position). You can't simply tell SharePoint, Find this "-" ALL OCCURENCES and replace with this "@" ALL OCCURENCES.
    I don't have the option of saying start at this position because my data is not the same in every cell/field (e.g., number of characters).
    Closest I've gotten is this:
    =REPLACE([IN THIS COLUMN],FIND("-",[IN THIS COLUMN]),LEN("-","@")
    RESULTS:
    XXX@123-XXX-123

    Hi JJSHAREP,
    The formula only works when there are only three "-" in the column value, and the formula will fail if there are more than or less than three "-" in the column value.
    I recommend to use Jquery code to replace the characters in the column called IN THIS COLUMN in the UI:
    <script src="http://code.jquery.com/jquery-1.10.2.min.js" type="text/javascript"></script>
    <script type="text/javascript">
    $(function () {
    var Index=0;
    $(".ms-listviewtable tr th").each(function(i){
    if($(this).find("div").attr("name")=="IN_x0020_THIS_x0020_COLUMN"){
    Index=i;
    $(".ms-listviewtable tr").each(function(i){
    if(i>0){
    var value=$(this).find("td").eq(Index).text();
    var value1=value.replace(/\-/g, '@');
    $(this).find("td").eq(titleIndex).text(value1);
    </script>
    Best regards.
    Thanks
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

Maybe you are looking for

  • Safari won't launch - "Safari quit unexpectedly while using the Quartzcomposer plug-in". I'm currently running 10.9.2

    Hi, Safari will no longer lanch on my Macbook Pro, It says "Safari quit unexpectedly while using the Quartzcomposer plug-in". I'm currently running 10.9.2, any help would be appreciated. It gives me this report: Process:     Safari [893] Path:       

  • PI 7.1 Email Attachment binary file

    Hi, I am trying to attach a binary (encrypted) file to a regular mapped email (receiver adapter) before sending it. It is similiar to attach pdf-files at the end of a mapping process. Is there no way to attach binary files other than writing an adapt

  • JMS Message Property in JMS Receiver

    Hi there, I need to set a JMS String property of a message I send. This message is fixed for one channel. We use XI 3.0 SP 20. I went through the documentation and saw that I can give up-tp 10 properties. But only the name and the type. But where can

  • Mount my dvd and Cd drives

    I have both cd and dvd burning drives, and ever since I first installed arch they've been innaccesable, and their contenst invisible. Two cd drives (one too many) and a dvd drive are listed in /media, but I can't see any of their contents. Something

  • Where is JDeveloper 11g Patch Set 2 (11.1.1.3.0)

    From the download link below, it only shows JDeveloper 11g (11.1.1.2.0). http://www.oracle.com/technology/software/products/jdev/htdocs/soft11.html Where is the newer version 11.1.1.3? I thought it was there last week. Thanks, Jeffrey