Maybe you have a solution to this problem...

I've been trying to think of a few ways of performing this task and I can't think of a solution I'm satisfied with.
Here's what's going on...
I have a static method that affects a JTextComponent. It adds a listener and modifies certain areas of text as needed with each key typed. Let's say, for example, that the listener looks for the words "Hello" and "Hi." If it finds "Hello" it converts it to "Hi" and if it finds "Hi" it converts it to "Hello." So someone tries to type "Hello World." After the user is done typing the "Hello" part is converts it to "Hi." Then as s/he keeps typing it will keep converting it back and forth between "Hello" and "Hi." What I want to do is make a set of tags that indicate what's done and what's not. Let's pretend to do it with html-type tags.
So after it converts the word once I would make the text "<converted>Hi</converted> World". Then when it's doing the conversion next key typed it will ignore what's in the tags. The problem is that I can't have the user see the tags.
I considered making it a subclass of JTextComponent and adding a variable that contains the coded message but that doesn't really fit with the rest of my program. Since this is static I don't have somewhere to store the data for the potentially hundreds of JTextComponents that will be affected. Another idea was to use the component's name field to hold the data but I can't guarantee its data and I may overwrite a name that another piece of the program depends on.
One last thought I was thinking is to divide the text using a character that doesn't display. Unfortunately I don't know of any such character and I think the component would try to display something anyway.
I'm sure I was pretty confusing so if you need some clarifying let me know.
Thanks for the help.

Thanks for your response bbritta but perhaps I wasn't clear that that example was pretty basic compared to what I'm doing.
I figured my exact specification would get in the way but I may as well just tell you exactly what I'm doing. The program converts text from our alphabet to another (namely hiragana and katakana). The problem I'm running in to is that I want to be able to switch "modes." As it stands if you're holding left shift it will convert into hiragana. If you're holding the right shift it will convert into katakana. If you're holding nothing down it won't convert it (leaving you with the romaji). The problem comes because when it's told to translate into a certain alphabet it converts the entire text. I need to be able to mark off different locations in the string so that it knows what to convert and what not to.
Does this make it any more clear?

Similar Messages

  • I bought my iphone 5 in Houston Texas May 15 2013 IMEI Nr. 013428009645399.The problem is that in the Greece the country which I live the 4G is not working.If you have any solution for this problem pls. let me know.My email is philcoueth@yahoo.gr Thank yo

    I bought my iphone 5 in Houston on May 15 2013.
    IMEI 013428009645399.The problem I have is that in the country
    which I live GREECE the 4G is
    not working.Please if you have any solution for this
    problem let me know.My email is [email protected]
    Thanking you in advance
    Philip Couridis

    iPhones purchased in the US are NOT guaranteed to work with 4G bands outside of North America.
    For what crazy reason did you purchase an iPhone in the US if you live in Greece?  If your phone needs servicing, it will have to be brought back to the US.  You cannot get that phone serviced in Greece.

  • HT1420 No longer authorized to enter the account was used to five devices have exhausted all attempts to please you to the solution to this problem I reside in recursion and I'm not good at English Language

    No longer authorized to enter the account was used to five devices have exhausted all attempts to please you to the solution to this problem I reside in recursion and I'm not good at English Language 

    MMS will be available for the 3G and 3GS in two weeks - on Friday, September 25th - likely with a carrier update made available via iTunes.
    In the interim - for the next two weeks, ask the sender of an MMS to address the MMS to an email address that you access with the iPhone's Mail client - the sender will enter your email address in the To: field for the MMS instead of your cell phone number with area code. The MMS will be received by you as an email with the photo as an attachment. This will give you the sender's cell phone MMS email address. Add this email address to the contact's info in your iPhone's address book. If you want to send an email with a photo attached as an MMS to this person, address the email to their cell phone MMS email address. The email with the photo attached will be received as an MMS.
    This will be required for another two weeks.

  • Hi, I was importing pictures into iPhoto from my sd card and suddenly iPhoto quit.  Now it just won't open.  When I click on the iphoto icon in the dock, nothing happens!  Does anyone have a solution to this problem please?

    Hi, I was importing pictures into iPhoto from my sd card and suddenly iPhoto quit.  Now it just won't open.  When I click on the iphoto icon in the dock, nothing happens!  Does anyone have a solution to this problem please?

    As a test launch iPhoto with the Option key held down and create a new, test library.  Import some photos and test to see if the same problem persists. Does it?
    If it does then your current library has been damaged and should be repaired: apply the two fixes below in order as needed:
    Fix #1
    Launch iPhoto with the Command+Option keys held down and rebuild the library.
    Since only one option can be run at a time start
    with Option #4 and then #1 as needed.
    Fix #2
    Using iPhoto Library Manager  to Rebuild Your iPhoto Library
    1 - download iPhoto Library Manager and launch.
    2 - click on the Add Library button, navigate to your Home/Pictures folder and select your iPhoto Library folder.
    3 - Now that the library is listed in the left hand pane of iPLM, click on your library and go to the File ➙ Rebuild Library menu option.
    4 - In the next  window name the new library and select the location you want it to be placed.
    5 - Click on the Create button.
    Note: This creates a new library based on the LIbraryData.xml file in the library and will recover Events, Albums, keywords, titles and comments.  However, books, calendars, cards and slideshows will be lost. The original library will be left untouched for further attempts at fixing the problem or in case the rebuilt library is not satisfactory.
    OT

  • Songs stop playing on my iphone I try to start it again and it will not play for more than 2-4 seconds, does anyone have the solution to this problem?

    I have Imatch and songs stop playing on my iphone I try to start it again and it will not play for more than 2-4 seconds, does anyone have the solution to this problem?

    By "hard reset" you mean hold down the Home and power buttons until the iOS device restarts, correct?

  • I also am having problems creating cd cover. When I try to print onlt text comes out picture art is 1 big black square. cannot load library error shows up 126. Do anyone have a solution for this problem?

    Having problem creating cd cover.When I try to print one out only text print no picture. Error message appears "cannot load library"LXBBPRP,DLL Default error126. Anyone have a solution to this problem?

    One other note I do have parallels installed but not running on both machines.
    Make sure on both machines that even if Parallels is not running that the two VPNs it creates in System Preferences > Network are set to Off.
    Also make sure that in System Preferences > Sharing that Internet Sharing is nnot ON.
    Later you will have to adjust the Parallels setting to NOT Share the Mac IP.
    10:18 PM Sunday; June 1, 2008

  • In Logic pro 9.1.7, all of a sudden, it freezes at 'initializing core audio! Does someone have a solution to this problem?

    In Logic pro 9.1.7, all of a sudden, it freezes at 'initializing core audio! Does someone have a solution to this problem?

    Well, let's see: 
                                 a) computer
                                 b) operating system
                                 c) application (i.e. Logic)
                                 b) sub program's (i.e. plugins)
    could all together trigger the cause.
    So a lot more info would  certainly  help us to make some sort of intelligent guess. 
    Have a nice day!

  • After performing a routine software update this week, I am having problems with both of my email accounts.  I am unable to "Reply" to any emails. Does anyone have a solution to this problem?

    After performing a routine software update this week, I am having problems with both of my email accounts.  I am unable to "Reply" to any emails. Does anyone have a solution to this problem?

    I am having the same problem also  Thought it was my network and reset everything including Apple TV but still the problem is there . I assume now it is down to iOS 8 prior to that was perfect

  • When I try to install PSE11, I keep getting error 1935, does anyone have a solution for this problem

    When I try to install PSE11, I keep getting error 1935, does anyone have a solution for
    this problem?

    This thread from the Premiere Elements forum may help:
    http://forums.adobe.com/thread/1286807?tstart=0

  • My display has quit working.  Does anyone have a solution for this problem?

    I have had my Verizon Jetpack MiFi 5510L for a couple of months now.  It has worked fine until a few days ago the display on it started looking strange and now has finally gone blank.  Does anyone have a solution for the problem?

    You can do both, whatever is more convenient to you.  As long as VZW gets its hands on the old device you will be good to go.  Replacements under the warranrty require the user to turn in the old device to VZW.  If your old device is not returned then you will be charged a fee for an entirely new device.  Purchasing a tracking number for a shipment of this kind would be a good idea if you choose to send it in.  Otherwise dropping it off at a store is the safest route you can take. 
    I would suggest contacting VZW phone support on this one and running through your options.  The VZW phone rep can coordinate a delivery to your local VZW store if they do not already have one in stock.  You can also turn in the old device in person to rule out any non-returned device fees.

  • Hi! Did anyone happen that AppStore simply disappear? Anyone have a solution for this problem? Thanks!

    Hi!
    Did anyone happen that AppStore simply disappear?
    Have anyone a solution for this problem?
    thanks! bbj

    Hi.
    Do you mean that App Store has disappeared from the Dock? If so it'll still be in Applications. Select it in Applications, when it opens in the Dock move it one or more places, it will then stay there to access next time you want it.
    If you don't mean the above, see if you have accidentally moved the application to the Trash.
    Good luck,
    Adrian

  • I have a new iPhone 4 which I cannot sync until I upgrade to the latest version of iTunes software (10.2.2).  Upon trying to upgrade, I keep receiving a message which states, "The URL could not be opened."  Anyone have a solution to this problem?

    I have a new iPhone 4 which I cannot sync until I upgrade to the latest version of iTunes software (version 10.2.2).  Upon trying to upgrade, I keep receiving a message which states, "The URL could not be opened."  Anyone else had the same problem & does anyone have a solution?  Would like to try other easier option(s) before uninstalling & installing newest version. 

    You need to buy and install a Mac OS X 10.6 DVD.
    (96040)

  • HT201210 i cant connect to wi-fi the button is grayed, i tryed all steps on apple website and non of the worked,does anyone hava a solution to this problem?

    after downloading IOS 7 my Iphone 4S started working slowly,and then i wasnt able to connect to WI-FI, i was looking for nswer to this problem all over the internet and found some steps on apple website, which didnt help me, even after erasing all content WI-FI still wouldnt turn on.Please help, and as soon as possible i need WI-FI to downlload comet finder app to see comet ISON...

    This is almost always a hardware failure that requires replacing the phone.
    Not clear what you mean by "some steps on apple website", but try everything in this support article:
    iOS: Wi-Fi  settings grayed out or dim

  • I guess you have no solution for this :((

    youtube video says "no response" every time when i try to watch via mobile data ( wifi works )

    Check your configuration settings, both web and access point. There's no reason of YouTube not working other than if your connection is super slow or else if you have invalid settings.

  • Light need...can i have a solution for this problem ? (picture)

    Thank You All<a href="http://lh5.google.com/jeanrafael/RpfUC_0yyGI/AAAAAAAAAA8/6zPGJb48oK8/untitled.JPG?">http://lh5.google.com/jeanrafael/RpfUC_0yyGI/AAAAAAAAAA8/6zPGJb48oK8/untitled.JPG?</a>
    Message was edited by:
            Jean Chiquie

    Hi Jean,
    lots of ideas...depending on your environment
    First of all, since you're using GUI 7.10 - have you applied patch 2? (standard question
    Second: Check these two (old) notes <a href="https://service.sap.com/sap/support/notes/545177">545177</a> and <a href="https://service.sap.com/sap/support/notes/413330">413330</a>.
    Third: Try a network outlet of a co-worker not having your problem (if it works, cry for the network-team, if not, for the hardware-team; may be it's your NIC).
    More ideas on more information of your environment
    Peter

Maybe you are looking for

  • Windows Update story - how it's made and how evolved!

    I am searching for as much information as possible about Windows Update. When it was realeased for the first time, how it evolved to this moment, what was the first update, is there something more than security tuesday patch, everything that could gi

  • Data pulling from R3 to BW server in BI7.0

    Hi all, I am very new in BI7.0 but know the concept of  pulling the data in BW3.5 . I create a generic data source and replicate it in to BI7.0 .Now i am confuse in BI server how to i pull the data from R3 server Bcz each and every screen is differ f

  • Mat**bleep​**a dvd-ram uj-850s 1.10

    I have a satellite p105-s6177.  It is about 2 yrs old, and the dvdrom drive has stopped working for the past 7 days.  I cannot play music, watch a video or burn anything. I am getting a message "cannot find application".  Can anyone help?

  • Network Diagnostic Service won't run, Symantec turned off, yellow triangles by all network devices

    We have a Lenovo laptop that suddenly cannot connect to the network (Windows 2008 R2 domain). The o/s is Windows 7 Pro 64 bit. The system tray icon shows that no network connections are available. When I run the troubleshooter, Windows detects that t

  • Problems with flash and latest versions of Chromium

    Adobe flash check says that the player is installed but disabled.  Tried to follow the instructions to enable the add in but it does not show up on the list.  How can this be fixed?  Need clear step by step instructions.