Help with text format

I am attempting to emulate an example in shown in:
http://developer.java.sun.com/developer/Books/gui/swing2/swing2_chap11.pdf
With the following code
fieldFormat = new NameFormat();
JFormattedTextField rField = new JFormattedTextField(fieldFormat);
rField.setColumns(15);
rField.setValue(initialValue);
class NameFormat extends Format {
     public StringBuffer format(Object obj, StringBuffer toAppendTo, FieldPosition fieldPosition) {
          fieldPosition.setBeginIndex(toAppendTo.length());
          String str = obj.toString();
          char prevCh = ' ';
          for (int k=0; k<str.length(); k++) {
               char nextCh = str.charAt(k);
               if (Character.isLetter(nextCh) && prevCh == ' ')
                    nextCh = Character.toTitleCase(nextCh);
               toApendTo.append(nextCh);
               prevCh = nextCh;
          fieldPosition.setEndIndex(toAppendTo.length());
          return toAppendTo;
}I get the following error:
FormattedField.NameFormat should be declared abstract; it does not define parseObject(java.lang.String,java.text.ParsePosition) in java.text.Format
Therefore I determined there must be methods missing. Upon looking I find the following two other methods defines for Format .
formatToCharacterIterator(Object obj) {}
parseObject(String source, ParsePosition pos) {}
The problem is I am unable to determine what the methods should do or look like if added to NameFormat.
Any suggestions or help would be appreciated.
Thanks
rykk

Forget it I can't chew gum and walk at the same time.
rykk

Similar Messages

  • Help with text formatting in Stickies

    I just discovered the Stickies app and it's almost perfect for helping me keep track of my tasks and to-dos. However, I'm slightly obsessive on minor details so I have a few questions:
    Is it possible to center the text without having to paste from another source? I've set the style the way I want it in Word and then paste it into a new note where it looks perfect. Large bold centered text. I go to Note > Use as Default but the text alignment isn't saved. I saved the style as a favorite but have to drill down the styles dialogs just to center text. I'll be creating an deleting a lot of these during the day and it's actually easier for me to read these when the text is centered.
    Same as 1 but for line-spacing. When I try to set the default with 1.5x line spacing new notes are created in 12pt Time New Roman
    Is there a way to set it so that Command+Shift+Y always does a Paste and Match Style? My current workaround is to select all and then paste style to set them as the default font.
    Thanks!

    I had the same problem with CP7 and just upgraded to CP8.01. This version seemed to format my long answers almost perfectly when I imported the first two question pools - then it reverted back to the same old CP7 behavior. This makes me think that there must be a way to do this.
    Update: Here's the workaround that I've used to get these "long questions" and "long answers" to fit into the multiple question Master Slide. I copied then duplicated the "MCQ, T/F, FIB, Sequence" Master Question slide. On the new one, I expanded the Question area box, both horizontally and vertically so it will accommodate even very lengthy questions.
    I then did the same for the answers area - I have to adjust both so they didn't overlap - and I reduced the size of my "Review Area" since I won't be needing it in my exam format. After saving my project, I then imported a new question pool that was in GIFT format. Of course all of them are imported using the original "MCQ, T/F, FIB, Sequence" Master Question slide format. But now I can view my "Question Pool"  (Windows > Question Pool), then select all of them (Control, A) then in the "Properties" tab you should have a pull down that allows you to select the new question master slide you just created. Select it and all of your imported slides now should display properly.
    Note that this seems to work only when your answers can fit on two lines - not three lines or more. But if you've stretched wide the answer area box in you master slide this will work for most long answers.

  • MS Word for Macs 2011 in Mavericks - can you help with text formatting?

    When I try to copy and paste text in MS Word for Macs 2011 (14.3.9) the text doesn't retain its formatting. I'm running a year old 27" iMac with OS 10.9.1 Mavericks. My other Mac is still running OS 10.8.5 and the same verision of Word works fine.
    Any ideas?

    Works fine, here.
    I've found it difficult to actually nail down what causes the odd behaviors in Office. I think it is due to the config files scattered all over, never knowing which one to delete.
    However, you may be able to isolate the problem to your own account, or to the system by trying two things:
    1) Log into another user account (a new one would be good, or Guest) and try there.
    2) Boot into Safe Mode and try there: http://support.apple.com/kb/HT1564
    If it works in 1, then there is something in your account causing the issues.
    If it works in 2, then the something is third-party software.

  • Help with texting

    Firstly I would like to say a warm 'Hello' to everyone here. New member, first time visitor and first time Blackberry owner.
    I have purchased today a 'Pearl' and have a question for anyone regarding texting. As I am more used to normal texting on other handsets such as turing off predicative text, I notice that the Blackberry has a similar format (SureType) that automatically chooses the words for you. Sadly I cannot get the hang of this predicative texting format and so ask if there is a way to turn this off so I can write a text message in a normal fasion.
    Any help or assistance is most welcomed
    Jonathan

    Sure, it can be turned off.... Options >Language and then you can go to English (multi-tap).
    When you reboot your device or go On/Off, you will likely have SureType back on. 
    People who are frustrated with SureType (i.e. "it doesn't work.") aren't using it properly.
    When SureType is enabled all you do is type your complete word. At the end of the word SureType 99% of the time has the right word. As you are typing don't pay too much attention to what letter it's putting up. Type the complete word and then see what SureType is entering.
    So you're not up to the challenge? You will become more frustrated with MultiTap, it is not T9 typing that you are so used to from the past 13 years. You'll be back here asking how to turn SureType back on!
    You will hate it for the first week as you do today. Two weeks from now you will say I was right. IF you can keep an open mind, and welcome change and different things, you will be fine. 
    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

  • Problem with text formatting

    I am new to RoboHelp and I am trying to write some more text in an existing project in design view. I use Track Changes and have set the text to be Times New Roman 12pt. When I made a line italic it turned into Arial. I tried to change it to Times once again by selecting the text to format and then choose Format/ Font/ Times New Roman but it won´t change, it is still Arial. Earlier in the text I managed to make a line italic and Times New Roman.
    Anyone who knows what to do?
    (I use RoboHelp 10 with Windows 7 Professional.)

    Thanks for input!
    Yes, I think it was an inline style I made.
    I managed to get the text as I wanted to by deleting it, then I choose a style from the ‘Styles and Formatting’ pod that matched and retyped the text. (To me it seems strange to have to do this. I thought that I could change an inline style by highlighting the text and choose the font I want it to bee from the ‘Formatting’ toolbar.)
    Now I have another (but similar) text formatting problem:
    I copy a text that has style set to Normal. When I insert the text (on a line with style Normal) the font changes from Times New Roman to Arial. The inserted text still has the style Normal. I have in the ‘Styles and Formatting’ pod checked that Normal still has Times New Roman by opening the ‘Styles’ window. (I still have ‘Track Changes’ turned on.)

  • Please Help with text parsing problem

    Hello,
    I have the following text in a file (cut and pasted from VI)
    12 15 03 12 15 03 81 5 80053 1 1,2,3 $23.00 1 ^M
    12 15 03 12 15 03 81 5 84550 1 1,2,3 $15.00 1 ^M
    12 15 03 12 15 03 81 5 84100 1 1,2,3 $15.00 1 ^M
    12 15 03 12 15 03 81 5 83615 1 1,2,3 $15.00 1 ^M
    12 15 03 12 15 03 81 5 82977 1 1,2,3 $15.00 1 ^M
    12 15 03 12 15 03 81 5 80061 1 1,2,3 $44.00 1 ^M
    12 15 03 12 15 03 81 5 83721 1 1,2,3 $15.00 1 ^M
    12 15 03 12 15 03 81 5 84439 1 1,2,3 $44.00 1 ^M
    12 15 03 12 15 03 81 5 84443 1 1,2,3 $40.00 1 ^M
    12 15 03 12 15 03 81 5 85025 1 1,2,3 $26.00 1 ^M
    12 15 03 12 15 03 81 5 85008 1 1,2,3 $5.00 1 ^M
    this method reads the text from a file and stores it in a ArrayList
        public ArrayList readInData(){
            File claimFile = new File(fullClaimPath);
            ArrayList returnDataAL = new ArrayList();
            if(!claimFile.exists()){
                System.out.println("Error: claim data - File Not Found");
                System.exit(1);
            try{
                BufferedReader br = new BufferedReader(new FileReader(claimFile));
                String s;
                while ((s = br.readLine()) != null){
                         System.out.println(s + " HHHH");
                        returnDataAL.add(s);
            }catch(Exception e){ System.out.println(e);}
            return returnDataAL;
        }//close loadFile()if i print the lines from above ... from the arraylist ... here is waht i get ...
    2 15 03 12 15 03 81 5 80053 1 1,2,3 $23.00 1 HHHH
    HHHH
    12 15 03 12 15 03 81 5 84550 1 1,2,3 $15.00 1 HHHH
    HHHH
    12 15 03 12 15 03 81 5 84100 1 1,2,3 $15.00 1 HHHH
    HHHH
    12 15 03 12 15 03 81 5 83615 1 1,2,3 $15.00 1 HHHH
    HHHH
    12 15 03 12 15 03 81 5 82977 1 1,2,3 $15.00 1 HHHH
    HHHH
    12 15 03 12 15 03 81 5 80061 1 1,2,3 $44.00 1 HHHH
    HHHH
    12 15 03 12 15 03 81 5 83721 1 1,2,3 $15.00 1 HHHH
    HHHH
    12 15 03 12 15 03 81 5 84439 1 1,2,3 $44.00 1 HHHH
    HHHH
    12 15 03 12 15 03 81 5 84443 1 1,2,3 $40.00 1 HHHH
    HHHH
    12 15 03 12 15 03 81 5 85025 1 1,2,3 $26.00 1 HHHH
    HHHH
    12 15 03 12 15 03 81 5 85008 1 1,2,3 $5.00 1 HHHH
    HHHH
    I see the ^M on the end of the lines ... but i dont understand why im getting the blank lines
    in between each entry ... I printed "HHHH" just to help with debugging ... anyone have any ideas why i am getting the extra blank lines?
    thanks,
    jd

    maybe its a FileReader deal.. Im not sure, maybe try using InputStreams. This code works for me (it reads from data.txt), give it a try and see if it works:
    import java.io.*;
    public class Example {
         public Example() throws IOException {
              BufferedReader b = new BufferedReader(new InputStreamReader(new FileInputStream("data.txt")));
              String s = "";
              while ((s = b.readLine()) != null) {
                   System.out.println(s);
              b.close();
         public static void main(String[] args) {
              try {
                   new Example();
              catch (IOException e) {
                   e.printStackTrace();
    }

  • Help with re-formatting a PDF for easy printing by anyone?

    Hello,
    I used a template to create a new professional resume, and edited this template in Adobe Fireworks CS3.  It looks good now, but when I try and create a PDF with it, I can't seem to figure out how to make sure it will print properly on a 8.5x11 without the document shrinking or getting skewed.  Can someone help or recommend a service that can optimize my PNG or PDF file to that whoever I send it to will be able to easily view and print it on most any computer?
    Thanks!
    -Jack
    [email address deleted by host]

    Michael,
    Thanks for your response.  My OS is Leopard I believe, but am not at my computer right now.  I took a template from a website which must've been in PNG format, and the default application to edit it with was Fireworks I guess. I have it both in PNG and PDF format, I'll forward it to you if you have a minute to take a look.  My whole idea was to create a newer PDF resume with style/format that will stand out far above from my word resume (boring).
    Thanks,
    Jack
    Sent from my iPhone

  • F4 Help with text table in WD abap

    Hi,
    i am using country related input help with check table T005 in one of table and i want to display the country text along with country id in my table, f4 for country is coming however if i select country from f4 it showing country id in the input field of table.
    i want to have country text also in one of my input fields in the table, i have seen f4 help works if we have explicit search help and using parameter assignment we can have id and text defaulted if we use same context for id and text fields,  however in this case country table t005 has check table t005 where texts are stored in text table t005t so web dynpro abap is't picking up the texts??
    please suggest how can i get the texts as soon as i select country in the f4??

    Hi Kranthi,
    You merely have to have an internal table storing list of countries, which you only need to do once, e.g. on load of application (method WDDOINIT of COMPONENTCONTROLLER). In your view, you have to declare a method for event onEnter of the input field, but this method doesn't have to have any code. Your code will be in method WDDOBEFOREACTION, where you read get country name from country key. Once you've got country name, transfer value to a context attribute to which you've already mapped as a source for attribute value of the UI element.
    Check out SAP Webdynpro component FITV_IMG_DEFHTLCATA -> view V_ITEM.

  • New to After Effects - need help with text manipulation!

    Hi all, I'm new to AE and this forum and I'm looking for some advice. I've been asked by the boss at work to create a short video clip, around 10-15 seconds, where text is displayed on the screen (3 words), after the few seconds, I want a 'forging' noise to happen and the final word in the text to be changed to another word and have a metallic effect applied, similar to the effect in this tutorial:
    Create Hot Metallic Text in After Effects - After Effects - macProVideo.com Hub
    Will this be difficult to do and do you guys think a complete beginner like myself can do it? I've got a lot of experience with the likes of PS, so I'm not too shy with Adobe software.
    Thanks,
    John

    johnster1991 wrote:
    Thanks for the advice, I appreciate it. So will it be difficult to have one word of text come onto the screen and overlay on top of the existing text, as if it's crashing over it? Any ideas on the steps I would use to do this? Thanks
    As you begin your career of using AE, you will change your vocabulary. Overlay will be replaced with spatial references like in front or behind.
    Designing text with surface styles like chrome or metal is not difficult. You can even import them from Photoshop if you have some PS chops or friends who can do it quickly.
    TEXT ONE can be easily replaced with TEXT TWO in any of dozens of different ways but to drop TWO in front of ONE is easy, you're just setting position keyframes. The finesse of animation, though, lies in the illusion of motion, exaggeration, overshooting and recoil. Your TWO could fall and squish and rebound and bounce or it could raise a dust cloud as it hits or it could make the camera wiggle. These are the things that separate simple key framing from animation and motion graphics.

  • How do I fix the problems with text formating functions in hotmail and other text based sites?

    In a Mailing list provider site it disables the text formating functions, instead only showing a 'loading' message. The functions never appear. In Hotmail the scroll arrows on the right hand side does not work. Sometimes the email toolbar becomes 'grey' and the buttons do not work. When forwarding an email sometimes the email does not show in the new email message.
    == This happened ==
    Every time Firefox opened
    == Firefox was reinstalled March 2010.

    The only possible fix was turning the phone off immediately and burying it in a bag of dry rice for a week at least. That might...just might...have worked.  But you're way beyond that and I see no fixes.  In fact the phone is probably going to get more problems before finally gving up the ghost.  Continued use is just shorting out more and more of the circuitry.  For that reason I don't think repair is much of an option. Go to an Apple Store and buy an out-of-warranty replacement.

  • Please help! Text format disappear after upgrade to vs2005

    Post Author: oim
    CA Forum: General
    So I upgraded my VS2003 crystal version 10  C# code to VS2005 but the compiler gave me this error: 'CrystalDecisions.Shared.ExportFormatType' does not contain a definition for 'Text'     the ExportFormatType enum now only has        NoFormat = 0,        CrystalReport = 1,        RichText = 2,        WordForWindows = 3,        Excel = 4,        PortableDocFormat = 5,        HTML32 = 6,        HTML40 = 7,        ExcelRecord = 8, How do I get the Text format back? Thanks a lot!  

    Try deleting the .plists for Adobe Acobat.
    Quit the application.
    You need to look in your user Library/Preferences for the .plist. Either hold down the option key while using the Finder “Go To Folder” command and select your user Library in your home folder or use the Finder “Go To Folder” command and enter ~/Library/Preferences.  Move the .plist(s) to your desktop.
    Open the application and test. If it works okay, delete the plist(s) from the desktop.
    If the application is the same, return the .plist(s) to where you got them from, overwriting the newer ones.
    If you prefer to make your User library permanently visible, use the Terminal command found below.
    Show User Library
    You might want to bookmark the command. I have to use it again after every update. I have also been informed that if you drag the user library to Finder it will remain visible.

  • Need help with adding formatted text and images to Crystal Report?

    Here's my scenario:
    I have a customer statement that's generated as a crystal report and that has a placeholder for advertisement. The advertisement is mixture of formatted text and images. Until now we only had one advertisement that was always used on the report. The new requirement is that we would have a pool of hundreds of advertisements and would need to display one specific advertisement on the customer statement based on various marketing criteria. They key is that the advertisement content will be determined programmatically and cannot be hardcoded into the report. I'm using Crystal2008 with .net SDK.
    Here are the solutions I thought of, but I'm still rather lost and would appreciate your help/opinion.
    1) Pass HTML or RTF to the report
    Not really sure if this is possible and how to get it done. Also how would I pass in images? Would display formatting be reliable when exporting to PDF?
    2) Create each add as a subreport and append it programatically
    I actually have this working, but I only know how to append a new section to the end of the report and then load the subreport to the section. I have no other controll of the placement. Is there a way to dynamically load a subreport to a predefined section in the main report? How about adding a dummy subreport in the main report as a placeholder and then replacing it with a different subreport? How could I do this?
    3) Pass an Image to the report
    I would create each advertisement as an image and then would somehow add the image to the report. How would I load the image and control the placement? Could I somehow define a placeholder for the image in the main report-maybe a dummy image to be replaced?
    Thank you.

    Hello Pavel,
    I would got the third way.
    You can use dynamic images in your report.
    Just by changing the URL to the image the image can be changed.
    Please see the [Crystal Manual|http://help.sap.com/businessobject/product_guides/cr2008/en/xir3_cr_usergde_en.pdf] and search for images.
    or directly here
    [Setting a Dynamic Graphic Location Path on an Image Object|https://boc.sdn.sap.com/node/506]
    [Dynamic image and HTTP://|https://boc.sdn.sap.com/node/3646]
    [codesample for .NET|https://boc.sdn.sap.com/node/6000]
    Please also use
    [Crystal Reports 2008 SDK Documentation and Sample Code|https://boc.sdn.sap.com/developer/library/CR2008SDK]
    [Crystal Reports 2008 .NET SDK Tutorial Samples|https://boc.sdn.sap.com/node/6203]
    Hope this helps
    Falk

  • Help with displaying formated text

    I need some advice in displaying the results from my program. I recieve these results from a CGI program and then display it. I can format how the CGI outputs the text however I want, but in an attempt to make it look nice I have the CGI output html syntax and place my data in nice tables. This text I then send to a JEditorPanel and tell it the text type is html. But there are two problems. The first is, that the results look terrible. It places huge spaces between lines of text, the text is formated bad and at the beginning is the text "head", and "/head" inside of two boxes. The thing is though, if I view this same text straight in Netscape it looks great, but whatever HTML I send to the JEditorPanel looks terrible. Is there a way to improve its results or is there another , better thing to use than the JEditorPanel or a better way to use the JEditorPanel that will allow me to create a pretty, formated text output?

    This was an old post of mine and I don't remember exactly how I was trying to do it, but the problem was just something with the way I was setting up my JEditorPane.
    Now I declare it like this:
         javax.swing.JEditorPane ResultsDisplay = new javax.swing.JEditorPane();
         JScrollPane ResultsDisplayScrollPlane = new JScrollPane(ResultsDisplay);
         HTMLEditorKit htmlEdKit = new HTMLEditorKit();And I do this to set it up during initialization:
              ResultsDisplay.setEditable(false);
              ResultsDisplay.setEditorKit(htmlEdKit);
              ResultsDisplay.setContentType("text/html");
              ResultsDisplay.setEditorKitForContentType("text/html", htmlEdKit);and this during run time to display my HTML formated text:
                   Document doc = ResultsDisplay.getEditorKit().createDefaultDocument();
                   ResultsDisplay.setDocument(doc);
                   System.out.println(inputLine);
                   ResultsDisplay.setText(inputStore.toString());
                   getContentPane().validate();
                           getContentPane().repaint();some of this could be redundant, but it works.
    But are you sure you don't want the dukes? They're stuck to this question and I don't know what else to do with them

  • Urgent - help with Text direction in InDesign CS4

    Hello,
    I use InDesign CS4 on Windows 7. It's a standard version (without options for right-to-left languages).
    Whenever I make a new text frame, it seems to have a right-to-left "logic" of the text. The text types left to right, but the period in the end would go all the way right.
    It also mixes up tabs. It looks like this:
    Instead of:
    Usually I get around it by pasting another correctly formatted text-frame or text, and it works.
    Now I'm trying to create a new document with master frame (in order to be able to easily change the layout successively of a many-paged document), where I need to insert existing (formatted) text. But this text take this "right to left logic", whether I past the text, or even a whole text frame.
    I could find nothing in the character/paragraph options to get rid of this.
    I would greatly appreciate if you could help me.
    with respect,
    Jerusalem Nun.

    This behaviour is normal. Changing the default property of any style, when no document is open, changes the style for every new document, but not for existing document.
    Take a look what is your basic style where all other styles are build up on it, in your case, go to the paragraph style and look what is the basic style which was used.
    If the default style was used (it is the one in brackets), you have always a problem. You should not use it in any case.
    Because you don't have a ME version of InDesign you can't change direction directly, but you can create a new document with the default settings and the same paragraph (and character, table and cell styles) in a new document without RTL styles. Save this document, no content is required.
    Go to the 'infected' document, open the paragraph style panel and in the panel menu take "Load all text styles", select the new document and overwrite with the incoming styles.
    If necessary you might repeat it with the Table, Cell, Character and Object Styles, as all of them have some kind of direction settings.
    I don't know how good your styles were created, you have to adjust your document. And I would strongly recommend—I repeat—I strongly recommend to work always with styles.

  • Help with page formatting in PDF

    Hope that someone can help me with a problem I have.
    I have just purchased Acrobat 9 Pro Extended Version 9.0.0, and am a very new user of Acrobat.
    The problem I have is converting a Word 2002 and SP3 documents (multi pages to PDF.
    The Word document is formatted with the correct margins in that all the text and Header are on the correct pages, but when converted to PDF a small part of the upper text on the next page moves up onto the previous page. Resetting the top ande bottom margins helps, but this should not be necessary.
    Anyone have any ideas to correct this problem.
    clifton06

    You version of WORD defaults to using printer metrics. There are 2 ways to resolve the issue. 1. go to print and select the Adobe PDF printer, back out and fist the document issues in WORD. 2. Deep in the options of WORD, there is a selection for using printer metrics (I assume your version also has this selection). Uncheck that and the problem should go away. You could also change your default printer to the Adobe PDF printer.
    WORD 2007 was changed to have the default set to NOT use printer metrics. All previous versions used the metrics. Thus when you change the printer, WORD reflows the document. The result may be errors in bookmarks, page numbers, and related issues.

Maybe you are looking for