Styled document with word wrap

Hi,
I need a text component which I can style the text and have word wrapping. I am currently using JEditorPane and HTML to do necessary styling but there is no word wrapping. JTextArea does word wrapping but no styling.
any ideas?
thanks.

do you have a solution? I gave you a hint to the solution. You guessed what the answer was. I don't understand what problem you are having.
If you need further help then you need to create a [url http://homepage1.nifty.com/algafield/sscce.html]Short, Self Contained, Compilable and Executable, Example Program (SSCCE) that demonstrates the incorrect behaviour, because I can't guess exactly what you are doing based on the information provided.
And don't forget to use the [url http://forum.java.sun.com/help.jspa?sec=formatting]Code Formatting Tags so the code retains its original formatting.

Similar Messages

  • AWT only canvas - styled text, images, word wrap and url posting.. how???

    Wassup people!
    Ive created a java chat client which uses the JTextPane to post messeges, emoticons and styled text. But the main problem here is that the majority of web browsers only support awt. Telling the users to download the latest jre with swing is long and most would rather go to another site, so i have reprogrammed the whole client in awt apart from the textpane. I now face the problem of creating a canvas that supports styled text, images, word wrap and url posting.
    I am only a beginner in java and the initial client was quite easy to do using swing, but to program an efficient canvas that supports this has proved to be quite challenging. would anyone beable to show me the best way of doing this? or refer me onto a library that already supports this? or is there even an awt version of the JTextPane somewhere which would save alot of time? any help would be most appreciated.
    Thanks

    I've seen a few APIs that are 100% pure java in 1.1 that implement a styled text area. They aren't free though and I'm pretty sure someone made some money off of the fact that java 1.1 didn't implement a styled text area.
    I understand the problem you are having. Before the days of swing styled text was something you wished you had. Just so you know, there is no easy way of doing this. You could always paint it yourself with a canvas in a scroll pane but then you get to the point where, unless you did some serious mouse handling, highlighting text becomes very difficult.

  • Getting error with word wrap

    So this is the error im getting:
    Error: Error #1502: A script has executed for longer than the default timeout period of 15 seconds.
              at flashx.textLayout.elements::FlowElement/getAbsoluteStart()[C:\Vellum\branches\v1\1.0\dev\ output\openSource\textLayout\src\flashx\textLayout\elements\FlowElement.as:960]
              at flashx.textLayout.compose::TextFlowLine/get location()[C:\Vellum\branches\v1\1.0\dev\output\openSource\textLayout\src\flashx\textLayo ut\compose\TextFlowLine.as:262]
              at flashx.textLayout.compose::ComposeState/createTextLine()[C:\Vellum\branches\v1\1.0\dev\ou tput\openSource\textLayout\src\flashx\textLayout\compose\ComposeState.as:369]
              at flashx.textLayout.compose::ComposeState/composeNextLine()[C:\Vellum\branches\v1\1.0\dev\o utput\openSource\textLayout\src\flashx\textLayout\compose\ComposeState.as:295]
              at flashx.textLayout.compose::BaseCompose/composeParagraphElementIntoLines()[C:\Vellum\branc hes\v1\1.0\dev\output\openSource\textLayout\src\flashx\textLayout\compose\BaseCompose.as:3 45]
              at flashx.textLayout.compose::ComposeState/composeParagraphElement()[C:\Vellum\branches\v1\1 .0\dev\output\openSource\textLayout\src\flashx\textLayout\compose\ComposeState.as:264]
              at flashx.textLayout.compose::BaseCompose/composeBlockElement()[C:\Vellum\branches\v1\1.0\de v\output\openSource\textLayout\src\flashx\textLayout\compose\BaseCompose.as:219]
              at flashx.textLayout.compose::BaseCompose/composeInternal()[C:\Vellum\branches\v1\1.0\dev\ou tput\openSource\textLayout\src\flashx\textLayout\compose\BaseCompose.as:322]
              at flashx.textLayout.compose::ComposeState/composeInternal()[C:\Vellum\branches\v1\1.0\dev\o utput\openSource\textLayout\src\flashx\textLayout\compose\ComposeState.as:126]
              at flashx.textLayout.compose::BaseCompose/composeTextFlow()[C:\Vellum\branches\v1\1.0\dev\ou tput\openSource\textLayout\src\flashx\textLayout\compose\BaseCompose.as:288]
              at flashx.textLayout.compose::ComposeState/composeTextFlow()[C:\Vellum\branches\v1\1.0\dev\o utput\openSource\textLayout\src\flashx\textLayout\compose\ComposeState.as:102]
              at flashx.textLayout.compose::StandardFlowComposer/http://ns.adobe.com/textLayout/internal/2008::callTheComposer()[C:\Vellum\branches\v1\1.0\dev\output\openSource\textLayout\src\flashx\textLayout\compos e\StandardFlowComposer.as:678]
              at flashx.textLayout.compose::StandardFlowComposer/internalCompose()[C:\Vellum\branches\v1\1 .0\dev\output\openSource\textLayout\src\flashx\textLayout\compose\StandardFlowComposer.as: 758]
              at flashx.textLayout.compose::StandardFlowComposer/compose()[C:\Vellum\branches\v1\1.0\dev\o utput\openSource\textLayout\src\flashx\textLayout\compose\StandardFlowComposer.as:821]
              at flashx.textLayout.container::TextContainerManager/compose()[C:\Vellum\branches\v1\1.0\dev \output\openSource\textLayout\src\flashx\textLayout\container\TextContainerManager.as:1205 ]
              at flashx.textLayout.container::TextContainerManager/updateContainer()[C:\Vellum\branches\v1 \1.0\dev\output\openSource\textLayout\src\flashx\textLayout\container\TextContainerManager .as:1292]
              at spark.components::RichEditableText/updateDisplayList()[E:\dev\4.0.0\frameworks\projects\s park\src\spark\components\RichEditableText.as:2605]
              at mx.core::UIComponent/validateDisplayList()[E:\dev\4.0.0\frameworks\projects\framework\src \mx\core\UIComponent.as:8531]
              at mx.managers::LayoutManager/validateClient()[E:\dev\4.0.0\frameworks\projects\framework\sr c\mx\managers\LayoutManager.as:932]
              at mx.core::UIComponent/validateNow()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\core \UIComponent.as:7631]
              at spark.components::DataGroup/getVirtualElementAt()[E:\dev\4.0.0\frameworks\projects\spark\ src\spark\components\DataGroup.as:1430]
              at layouts::SemiCarouselLayout/updateDisplayListVirtual()[C:\ColdFusion9\wwwroot\com\schooli mprovement\pd360\layouts\SemiCarouselLayout.as:745]
              at layouts.supportClasses::NavigatorLayoutBase/updateDisplayList()[C:\ColdFusion9\wwwroot\co m\schoolimprovement\pd360\layouts\supportClasses\NavigatorLayoutBase.as:400]
              at layouts.supportClasses::PerspectiveNavigatorLayoutBase/updateDisplayList()[C:\ColdFusion9 \wwwroot\com\schoolimprovement\pd360\layouts\supportClasses\PerspectiveNavigatorLayoutBase .as:132]
              at layouts::SemiCarouselLayout/updateDisplayList()[C:\ColdFusion9\wwwroot\com\schoolimprovem ent\pd360\layouts\SemiCarouselLayout.as:716]
              at spark.components.supportClasses::GroupBase/updateDisplayList()[E:\dev\4.0.0\frameworks\pr ojects\spark\src\spark\components\supportClasses\GroupBase.as:1224]
              at spark.components::DataGroup/updateDisplayList()[E:\dev\4.0.0\frameworks\projects\spark\sr c\spark\components\DataGroup.as:1316]
              at mx.core::UIComponent/validateDisplayList()[E:\dev\4.0.0\frameworks\projects\framework\src \mx\core\UIComponent.as:8531]
              at mx.managers::LayoutManager/validateDisplayList()[E:\dev\4.0.0\frameworks\projects\framewo rk\src\mx\managers\LayoutManager.as:663]
              at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\4.0.0\frameworks\projects\frame work\src\mx\managers\LayoutManager.as:736]
              at mx.managers::LayoutManager/doPhasedInstantiationCallback()[E:\dev\4.0.0\frameworks\projec ts\framework\src\mx\managers\LayoutManager.as:1072]
    From what I can tell I have several links and the end of my text flow they are formatted like this "2.nf.5" they reference to a code. If I add text to so that one of them kicks down to then next line the error goes away. also if I change the textAlign to justify it goes away as well. it looks like it has to do with the word wrap. If you have any suggestions or help that would be great thanks.

    "Error: Error #1502: A script has executed for longer than the default timeout period of 15 seconds." means there is an endless loop in getAbsoluteStart(). That is to say, one of the elements in the textflow has a incorrect '_parent'. You can debug to see if it's your fault or ours.

  • JtextPane with word wrapping chops up words and lines

    Hi,
    I have a JTextPane for use ina a chat type scenario, inside a JScrollPane. I use "insertString()" to put in user entered strings:
    doc.insertString(doc.getLength(), s+"\n", doc.getStyle("regular"));
    It works most of the time, but whena string is long it cuts up words and lines and I can't figure out why! I want the pane to wrap text like any normal text box, not chop up words and so on. Entering the string "i think some times the chat gets cut up funny and the words gets chopped" cuts up the word "funny" like so:
    i think some times the chat gets cut up f
    unny and the words gets chopped
    Entering "i think some times the chat gets cut up funny and the words gets chopped up and it realllllllllllllllllllllllllllllllly sucks you know" produces:
    i think some times the chat gets cut up f
    unny and the words gets chopped up and it rea
    lllllllllllllllllllllllllllllllly sucks you k
    now
    Here it has cut up "funny", "realllllllllllllllllllllllly" and also for some reason "know" (even though there is plenty of space for the word "know" on the last line).
    Please help!
    PS. Using a JtextArea instead is not an option available to me. I am insert plain text, not HTML or rtf.
    Thanks NC

    PS. Using a JtextArea instead is not an option available to me. I am insert plain text, not HTML or rtf.If you are using "plain text" then it is an option.
    If you are using styled text then you need to use a JTextPane. Here is some code I've used in the past. I've never notice any problems unless the word is wider than the width of the text pane in which case it will use character level wrapping instead of word level wrapping:
    http://forum.java.sun.com/thread.jspa?forumID=57&threadID=342068

  • JTable/jlist with word wrapping cells?

    Hello all,
    I got a simple looking problem but i can't seem to find any working solution for it:
    A jtable or jlist with cells that wordwrap text (cells differ in height).
    I found many examples on groups.google and this forum but they all seem to suffer a 100% processor load when 2 or more cells differ in height.
    Can anyone point me to a working example?
    Kind regards,
    Twan

    Thanks! That's a real live saver.
    I had been looking for a solution for several days, strange google did not yet found the mentioned page, cause it contains usefull information.
    I've just implemented the multiline table and it works without any problems and most important without 100% cpu usage.
    The bucks are comming your way ;-)

  • Placing word documents with embedded metafiles

    Hello,
    I have a Word document with Windows Metafile embedded pictures (with .EPS extensions). The pictures are math formulas, and I am not sure what tool they were created with.
    I open the document with Word 2010. I tried saving the document in both doc and docx format before placing in InDesign. But with ether format the following issue persists.
    The embedded metafile images look fine in Word, however after placing them in InDesign, the individual elements and clipping paths inside the embedded metafile images change their relative to each other positions, so the formulas start looking very wrong – individual symbols collide and/or get clipped.
    Why is this happening? Is there a way to work around this issue?
    I am on Windows 7 and InDesign CS 6.0.
    Thank you

    According to the author, the metafiles were placed in Word 2003 as ‘mathematical equation 3.0’ objects. I tried opening these with MathType 6.9 but it is able to open only a very small subset of the many equations in the document.
    I emailed Design Science for their opinion, but I am afraid that something similar to what is described in the article ‘Equations have become non-editable “pictures” in Microsoft Word’ may have happened to the documents I am working on.
    Here is the article:
    http://www.dessci.com/en/support/mathtype/tsn/tsn103.htm
    The frustrating part is that equations look all right in Word, or when exported from Word to PDF. But the way Adobe reads WMF metafiles, they get messed up.
    One such difference – Empty instead of Auto kerning is described in the following thread:
    http://forums.adobe.com/message/5330174#5330174
    But this is not the only issue. For some metafiles, blindly setting all kerning to auto messes them up. Some other metafiles exhibit bizarre vertical positioning of elements and/or shifts of clipping paths. The combination of these issues makes it very complex to write one-fits-all script to ‘fix’ the metafiles automatically.
    It appears I need to find the appropriate Microsoft libraries to correctly load WMF files into some intermediate vector format, matching Microsoft Word rendering exactly, and then export into EPS or something else that InDesign is capable of processing without repositioning elements.
    Any ideas what these libraries may be?
    Thank you

  • I can not open completly a  word document with pages - it gets cut at page 116

    if I open the same document with Word for mac i can review the 265 pages - but if I opent it wih pages it gets cutted at page 116

    There is probably a table at 116 that has cells that spans over more than one page. Pages can't breakt text withina table cell,.Only between rows.
    You can try to change the paper size in Page Set Up to something much longer, to being able to the the content

  • Formatting options with text wrap

    We are running BPC MS v10 and gave users the ability to enter comments with our input forms this year.  I am pulling the comments into a summary report using a local member which works fine.  The problem is I want to format these cells and use left alignment with word wrap enabled in order to view the full comment in each cell.  When I select any of the cells in the comment column the alignment and text wrap options are both "selected" in the Excel ribbon but it is not wrapping the comments onto the next line.  I have to uncheck the wrap text option in the ribbon and reselect before it will actually wrap to the next line.
    Has anyone else experienced this issue?

    loulou6 wrote:
    Hi Jerry
    It was a word document that wasa emailed over to me, is there any way I can reformat the document to clear any unseen formatting issues. Trying to avoid retyping the whole document,
    Many thanks
    Lou
    Not trivial, but you could Select All, Copy to get the entire imported document onto the Clipboard. Then open a New Pages Word Processing document and then Edit > Paste and Match Style. The new document will match the defaults in the template. If you find that you will be doing this often, make a custom template for this use.
    Jerry

  • Word wrap in multiline text

    JDeveloper 11.1.2.0.0
    We have a description that is shown in the UI. The width of the component is fixed and is shown in multi-lines.
    How can we show the text in multiline with word wrapping?
    Thanks in advance,
    Navaneeth

    Did you simply try an <af:outputText>? That's all it needs. This will wrap just fine without any extra work:
    <af:panelGroupLayout id="pgl1" layout="scroll" inlineStyle="width:400px;">
    <af:outputText value="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed a justo sem, tincidunt consequat ante. Cras eros nunc, ornare ut congue quis, fringilla vel diam. Sed quis massa non libero laoreet suscipit sit amet eget leo. Pellentesque gravida leo a diam dapibus placerat porta lorem blandit. Maecenas id odio vitae nulla consequat blandit." id="ot2"/>
    </af:panelGroupLayout>

  • Word wrap - add return within cell

    I have the need of putting word(s) on definitive lines within a cell. The particular case I am working with at the moment is a cemetery listing that has additional information particularly multiple spouses. I want each spouse's name to appear on a different line within that cell which Xcel does by using either ctl/enter or option/enter rather than putting a number of spaces in a wrapped cell so the next name would shift to the next line. Does Numbers have something similar?
    Tks

    Found another neat feature that also works with word wrap. Use Inspector to Merge two or more cells, I happen to have a long text in the first cell of three cell I wanted to use. Follow that by adding Word Wrap while still in Inspector. Low and Behold, the text that far exceeded the one cell now uses three cell for display and if the data then exceeds that amount of space it wraps as if the three cell are a single cell. It just so happened that the data I mentioned above needed three lines. Also, if you want specific parts of the data to be on specific lines within the unified cell, both line break functions previously mentioned will force the next part of the data to go to the next line ad infintum(??) or until the combined cell space/character limit is reached.

  • Microsoft Office 2004 (Word) unable to save files  I have been running Office 2004 on my Intel iMac with Snow Leopard for some time and all of a sudden I cannot save a document. Word just stopped responding and I have to force quit. I can open Word and cr

    Microsoft Office 2004 (Word) unable to save files
    I have been running Office 2004 on my Intel iMac with Snow Leopard for some time and all of a sudden I cannot save a document. Word just stopped responding and I have to force quit. I can open Word and create a new document but I cannot save it. I reinstalled Word but that didn’t help. Then went to the Internet and found at least one other Mac user having the same problem which it suggests is caused by a recent Mac Security Update:
    http://answers.microsoft.com/en-us/mac/forum/macoffice2004-macword/word-2004-wil l-not-open-or-save-documents/b04eb870-9b0d-4f3b-bb47-b122301e36f6
    So I check for a new Mac Security Update and sure enough there was one. I downloaded it and now Word seems to be working, as it should. I can both open and save files. The only problem remaining is that when I open Word I get the following error message “An unexpected error occurred while trying to load the Microsoft Framework library”. I contacted Apple but they were unable to help.
    How can I get rid of this error message?

    Look, I realize you might have to get your machine working, so this is how you revert back.
    Restore proceedure to pre-Security Update 2012-001 v 1.0 & v 1.1
    #1 Backup your personal data off the machine.
    Backup files off the computer (not to TimeMachine). If you don't have a external drive, get one and connect to the USB/Firewire port and simply drag and drop copy your User folder to the external drive, it will copy all your files. It's best to have two backups of your data off the machine when trying to restore.
    Disconnect all drives now to prevent any mistakes from occuring.
    #2 Reinstall OS X 10.6 from disk
    Get out your 10.6 install disk and make sure it's clean and polished (very soft cloth and a bit of rubbing alcohol, no scratches) If your disk is borked, you'll have to order a new one from Apple with your serial number.
    Hold c boot off the 10.6 disk (wired keyboard, internal optical drive), use Disk Utility First Aid to >Repair Disk  of your internal drive  (do not format or erase!!), Quit DU and simply re-install 10.6.
    Note: Simply reinstalling 10.6 version from disk (without erasing the drive) only replaces 10.6.8 with 10.6.x and bundled Apple programs, won't touch your files (backup anyway)  or most programs, unless they installed a kext file into OS X itself. (only a few on average do this)
    #3 Update to 10.6.8 without Security Update 2012-001 v1.0 or v1.1
    Reboot and log in, update to 10.6.8 via Software Update, but EXCLUDE THE Security Update 2012-001 by checkinig the details and unchecking the blue check box.
    #4 Reinstall any non-working third party programs
    When you reboot, make sure to reinstall any programs that require kext files installed into OS X, you'll know, they won't work when you launch them or hang for some reason as they are missing the part they installed into OS X.
    If for some freakish reason you get gray screen at any time when booting (possible it might occur when you reinstall older programs), hold the shift key down while booting (Safe Mode, disables kext files) and update your installed third party software so it's compatible with 10.6.8.
    https://support.apple.com/kb/TS2570
    That's it really.

  • What is the best way to work with Word documents in The InDesign CS4???

    I work in Microsoft Word 2007 and all my documents have *.doc format.
    What is the best way to work with Word documents in InDesign CS4???
    David Blatner says to avoid copying and pasting text from Word instead of placing it (Ctrl+D).
    How about pasting RTF or Text Document???
    I want to make book's layout in ID CS4 and its main feature is that there is the left page with text and the right - with graphics.
    So, as I understand to place the text on each page I must create for example 70 Word documents and place each item on 70 left pages???
    It loks like wasting time. I sthere another way of making such layout???  What kind????

    It's best to place any text.
    You can have all of your text in one file and use auto-flow to add threaded text frames and pages as required (Hold down the Shift key when you click the loaded text cursor), but it's a little non-standard to have the thread only on one side of the spread from the auto-flow perspective, so you'll have to set up properly.
    This is one case where a master text frame will work to your advantage. On your master page spread, add a text frame to the left page, but not to the right (or at least not threaded to one on the right -- for some other project you might actually want two independent text threads). Hold the loaded cursor over a frame on the left side of a document page and auto-flow. ID will add new spreads as necessary, but only put the text on the left side.
    Peter

  • I saved a word file onto my imac.  when i go to open file in documents with pages the file is grey and unable to open.  the workable files are highlighted in bold.  is there a way to open this file????

    i saved a word file onto my imac.  when i go to open file in documents with pages the file is grey and unable to open.  the workable files are highlighted in bold.  is there a way to open this file????

    THis is safe for Mac's? Sorry, I have just never heard of this site before.
    And there are literally tens of thousands of sites of which I've not heard, too. Not this one.
    It's legit. There are lots of links in Apple Support Communities to the LibreOffice web site, as well as others that are legitimate open-source developers of options to buying MS Office, such as NeoOffice and OpenOffice. I have Open Office installed on one of my older Macs that can't run Office 2011 and it is rock-solid.
    I've been here too long to start posting bogus urls now.

  • Unable to edit document using "Edit with Word" option

    Hi All,
    i am having an issue with Office web apps. i am using SharePoint 2013 and Office web apps 2013. all the configurations have been done successfully. but i have a different kind of issue.
    i am able to open documents in browser
    i am able to edit document using " edit with word/excel web" option
    but i am unable to edit document using "edit with word/excel" option
    i have Office 2010 installed on my local machine.
    do we need to have MS office of 2013 version? or is there anything missing from configuration part.
    Please help me.
    Thank You,
    Bhaskar.

    Hi,
    According to your post, my understanding is that you could not use the "edit with word/excel" option.
    I had tested the issue with the Office 2010, the option worked well.
    You don’t need to install the Office 2013 to use this option.
    What did you mean “but i am unable to edit document using "edit with word/excel" option
    Did you mean the option gray out? Did the issue occur in other browsers?
    You can use compatibility mode to check whether it works.
    Open IE->Tools->Compatibility View Settings
    You can also add the site into Trusted sites.
    Open the IE->Internet Options->Security->Sites->add the site into the Websites, then check whether it works.
    What's more, you can also use other browsers to check whether it works, such as Firefox, Chrome.
    Thanks & Regards,
    Jason
    Jason Guo
    TechNet Community Support

  • I have upgraded to Pages 5.0.1 and now I cannot print or pass along "comments" in the text of a document. I previously was able to convert the Pages document, with comments, to a "Word" document so that others could view the edited text. How do I do that?

    I have upgraded to Pages 5.0.1 and now I cannot print or pass along "comments" in the text of a document. I previously was able to convert the Pages document, with comments, to a "Word" document so that others could view the edited text. How do I do that?

    When you installed Pages v5, it automatically moved the older Pages ’09 v4.3 into /Applications/iWork '09 folder. If you want normal comment interoperability, you are advised to resume using the older version of Pages. Newer, is certainly not better with Pages v5.

Maybe you are looking for

  • Adobe PS (cs 5.5)not recognising all of my RAM

    Hi. I am currently running a Mac with OS 10.8.2 and have installed Adobe CS 5.5 Production Premium. Within Photoshop- Preferences- Performance, Photoshop is only recognising 2100MB of RAM, while my Computer has 16GB of RAM available. I have checked a

  • Exporting file to Youtube Elements 7

    Hi Guy's, I'm tring to help someone else so i dusted off my elements 7 software and I'm have a problem exporting the video. The file size is 96 megs.How can I comprise the file? I tried the "share" Internet" options to post...but the youtube option i

  • Numbers on my iOS devices have recently been updated but not on my iMac is this correct ?

    Numbers on both our iPads and our iPhone were recently updated but there has been no update for our iMac is this correct ?

  • Photoshop Elements 16 bit/ProPhoto RGB  ?

    At this point in time I don't believe PSE10 or indeed 11 supports 16 bit working or ProPhoto RGB. This is an issue when transferring images from Lightroom for editing in Layers etc. I currently use Photoshop CC for this purpose, which is great but to

  • Bandwidth Utilization

    Hi, May I know if there is a way to track bandwidth utilization (data download per month)... I am planning to migrate our application from intranet to internet and would require to select service provider (package option) based on the approx current