How to prevent automatic line wrapping in a JEditorPane

I have added a JEditorPane inside a JScrollPane which is inturn is added inside a JPanel with a GridLayout.
While JEditorPane is loaded with an HTML page or a html file is read into it with an HTMLDocument the longer lines are geting wrapped automatically to the next line when the display area of the parent component of the JPanel where the original JScrollPane is held (like the JFrame or JSplitPane etc.)
It doesn't help even after seeing a preferredsize/maximumSize or minimumSize
of the JEditorPane (b'cos it defaults to some other size which i'ven't set at all).
The horizontal scrollbar apperas only the when the the JEditorPanes size is reduced lesser than its defult size which has been set (probably by the layout manager).
I want to get rid of this behaviour of the JEditorPane such that horizontal Scollbar should apper as soon as the user reduce the size of the window displaying the above component hierarchy (parent container->JScrollPane->JEditorPane) and no line wrapping occurs.
Note : 1. JEditorPane doesn'y have linewrapping API like JTextArea
2. Its default and automatic linewrapping behaviour is conforming
with word line wrapping where lines are broken at the end of a
word which can be fully accomodated.

I have added a JEditorPane inside a JScrollPane which is inturn is added inside a JPanel with a GridLayout.
While JEditorPane is loaded with an HTML page or a html file is read into it with an HTMLDocument the longer lines are geting wrapped automatically to the next line when the display area of the parent component of the JPanel where the original JScrollPane is held (like the JFrame or JSplitPane etc.)
It doesn't help even after seeing a preferredsize/maximumSize or minimumSize
of the JEditorPane (b'cos it defaults to some other size which i'ven't set at all).
The horizontal scrollbar apperas only the when the the JEditorPanes size is reduced lesser than its defult size which has been set (probably by the layout manager).
I want to get rid of this behaviour of the JEditorPane such that horizontal Scollbar should apper as soon as the user reduce the size of the window displaying the above component hierarchy (parent container->JScrollPane->JEditorPane) and no line wrapping occurs.
Note : 1. JEditorPane doesn'y have linewrapping API like JTextArea
2. Its default and automatic linewrapping behaviour is conforming
with word line wrapping where lines are broken at the end of a
word which can be fully accomodated.

Similar Messages

  • My mail stopped automatic line wrapping what's up?

    How do I get back to automatic line wrapping in mail?

    There is a setting under the Advanced tab for the
    account preferences to not keep all messages and
    their attachments available for offline viewing but I
    don't use this setting and don't experience the same
    problems.
    To clarify, do you mean that you "do not" keep all messages (etc.) available for offline viewing, or that you "do" keep all messages (etc.) available? At present, I have this option to "keep all messages and attachments available for off-line viewing" checked positive, by default I presume.
    After first creating the account if there
    are a number of server stored mailboxes and messages
    available on the server, the mailbox and message
    synchronization process takes longer than normal and
    the time it takes for subsequent synchronization
    should not be a real long process unless a number of
    changes have been make with server stored mailboxes.
    Odd thing is that I only have one saved message in the .Mac account, and that is a tiny weeny one (about 10K) with no attachments or anything! By the way, since I have just been going through everything all over again, I notice that what really seems to be holding things up (I've now changed synchronization to "manual" on both computers) is when I "Get Mail" and Mail is trying to open the .Mac mailbox - this goes on interminably (as I can see in Activity Viewer).
    Try using the Rebuild Mailbox function on all server
    stored mailboxes. All messages will disappear
    temporarily and the mailbox will be resynchronized
    with the server.
    Sorry for being dense, but I've been all over my Mail application and all over my .Mac settings and I can't find this "Rebuild Mailbox" function. Could you please tell me exactly where I can find this Rebuild Mailbox function?
      Mac OS X (10.4.9)  

  • How to prevent automatic download and install of Reader 8.1.2

    Hi-
    I have Adobe Reader 7.0.9 and I need to keep it as my default Adobe reader program and plug-in for some applications that I use.
    Over the last week, Adobe reader 8.1.2 downloads automatically and installs itself in my business laptop (Win XP SP2) and replaces my 7.0.9 version.
    Each time I uninstall the 8.1.2 and reinstall the 7.0.9. I ensure the option of automatic download and install is disabled in 7.0.9.
    But it still happens I have for the xth time today the new 8.1.2 in my laptop.
    Anybody knows what is going on ? And how can I solve this issue to keep my 7.0.9 version ?
    Thanks.

    radellaf wrote:
    This nonsense is happening right now on my iPhone.  2.3GB deleted, now iOS 8 is downloading without my consent.
    That's *not* a good thing to hear.
    After the download finishes, do NOT press the Install Now button. Try the following to remove the download from the device. Here's the procedure I came up with last time this happened with iOS 7...It may or may not work.
    Re: Apple Forced iOS7 update on my iPad2 !
    Afterwards if you succeed, block Apple's update server using the following method so it wont get pushed to the device again:
    In your router's settings, set up a block (using Access Restrictions or similar in the router's web interface) to mesu.apple.com. This will prevent the devices from "phoning home" to Apple, checking for the update and getting the download pushed to it again.
    Or follow the instructions at this link:
    http://ios8tips.com/how-to-prevent-automatic-update-to-ios-8/

  • How to add new line wrapping rule?

    Hi all,
    I have a question about line wrapping condition of Java editor of JDeveloper.
    JDev has some predefined rules for it and I can change them from preference.
    But can I add a new rule?
    I'd like to place conditional operators such as "&&" or "||" at head of line.
    For example, as below.
    if (values[0].length() > 2
    && values[1].length() == 3
    || values[2].length() < 10
    && values[3].length() == 0) {
    JDev doesn't seem to have the predefined rule about conditional operators.
    So I'd like to know if I can add new one.
    My Jdeveloper is 11.1.1.6.0.
    Thanks,
    Atsushi

    Atsushi,
    I don't think you can add a new rule there.
    However, how about setting Line Wrapping->Binary Operators and Assignments to Always? Your code would then look like
           if (values[0].length() >
                2 &&
                values [1].length() ==
                3 ||
                values [2].length() <
                10 &&
                values [3].length() ==
                0 ) {
            }-Arun

  • How can I set line wrap on a JButton??

    Hi...
    I am working on an application that required to have a long label on a button and I was wondering if anyone know how to set line wrap on a JButton. Any suggestion will be greatly appreciate.

    If it is not inconvenient for you to use mouse events instead of action events this procedure may be adequate.
    Invoke "createImage" on the JButton to obtain an "Image" object then use "getGraphics" on the image object to get "Graphics" object. Next call "getFontMetrics" on the "Graphics" object to obtain "FontMetrics". Now you can get the size of a String drawn from the "drawString" method of the "Graphics" object. This can be obtained in an int returned from "getHeight" method in "FontMetrics".
    You can obtain the center of the "Image" by using "getSize" method from JButton and dividing it by 2.
    You can get the width of characters by using "FontMetrics" "charsWidth" method. Now you can use the int returned from charsWidth and getHeight to align text in the JButton "Image" by using the "Dimension"
    object returned by the "getSize" method. Now invoke
    the "drawString" method for as many lines of text as you would like to display. After finished drawing strings you
    construct an ImageIcon with its one parameter being the "Image" object you have created and drawn on.
    Now you invoke the "setIcon" method of JButton to insert the ImageIcon as the image displayed on the JButton.
    At this point you have a JButton with all the text you want displayed on it, but with no event handling. So
    you are going to add a MouseListener to the JButton.
    In the MouseListener override the "mouseClicked" method
    inside the method obtain the MouseEvent's location through "getX" and "getY". Next invoke the JButton's
    "getLocation" method to obtain a "Point" object. Now invoke the "Point" objects "getX" and "getY" methods to return the int locations of the origin of the JButton.
    Now invoke the "getSize" method of the JButton to get
    a "Dimension" object containing the size of the JButton.
    Now you can use boolean operations to determine if the
    x, y coordinate that was obtained by the MouseEvent falls within the boundries of the JButton component.
    Something like this:
    public void mouseClicked(MouseEvent mouseEvent) {
    Point point=jbutton.getLocation();
    Dimension dimension=jbutton.getSize();
    int pX=point.getX();
    int pY=point.getY();
    int dW=dimension.width;
    int dH=dimension.height;
    int mX=mouseEvent.getX();
    int mY=mouseEvent.getY();
    if(mX>pX & mX<(pX+dW)) {
    if(mY>pY & mY<(pY+dH)) {
    //This means that the point does indeed fall within
    //the boundries of the JButton, so place the code
    //that would normally appear in actionPerformed
    //within this code block
    Good Luck.

  • How to detect the line wrap event of JTextPane?

    Hi all,
    I'd like to detect the line wrapping event of JTextPane, so as to adjust the visible rows of JTextPane. How could I do this? Thanks!
    Yi Bing

    there is no wrap event.
    Wrap happens during relayout. The event which invokes relayout could be different. E.g. change size or chane model (document).
    Just add document listener and componnet listener.
    Regards,
    Stas

  • How to prevent automatic display of "Server Manager" in Win Server 2008 R2

    Beginner's question:
    How to prevent the automatic loading of "Server Manager" in
    Windows Server 2008 R2 ?
    Thanks

    Task Scheduler|Library|Microsoft|Windows|Server Manager here you can disable or delete the task named
    ServerManager.
    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows]
    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees , and confers no rights.

  • How To Prevent Automatic Downloads/Upgrades of Sftwr.

    Can someone please tell me how to revise the settings in Adobe Reader and other products to prevent automatic downloads?  I would like to have control over when downloads happen.  Thank you.

    Adobe Reader XI and Acrobat XI Updater Settings

  • Standard output automatically line wraps at 40 characters, How to stop that

    Hello, After frustrated searching I will ask this. I am currently using the terminal to run my fortran code using gfortran and intel's ifort (10.1.015) writing relevant data to the standard out by
    write(,) or write(*,100)
    100 format(i4,1x,4(f8.3,1x)
    regardless of which compiler I use the output is always wrapped after 40 characters.
    Here is an example using a formated line
    Description of uniform random quaternions
    Index |q| w x y z
    1 1.000 -0.469 -0.383 -0.357
    -0.711
    2 1.000 0.365 0.202 0.151
    0.896
    As you can see this is wrapping the last number. So how can I get a longer line?
    The wrapping is not seen when I do this on a linux at work or my powerbook with 10.4.
    Thanks
    Chris

    Sorry, yes that was a typo in defining 5 not 4 floats, but I have another line with 12 floating point numbers that are formated correctly in the format statement but wrap at 40 regardless. But, if I read data from that file, the compiler still reads it as a single line. So is this a terminal issue or fortran? Opening in vi still wraps as if a carriage return is there. (Also opened in text and texwrangler with same wrapping)
    I have sent a similar question to Intel and will update if I get anything.
    Thank you

  • How can I automatically word wrap a string placed in a (multicolumn) listbox ?

    Hello,
    Using LabView 7.0:
    I need to automatically wrap text inserted in a multicolumn listbox.
    The size of the listbox is fixed and I don't know the legth of the string that will be inserted. But the whole string must be visible, because it's Information is important
    I'm not allowed to use a fixed width font. :-(
    Has anyone any ideas (or a solution already?)
    How can I compute the length of a string in pixel to calculate to position to wrap?
    Thanks in advance,
    best regards,
    Rainer

    Hi Veena,
    The trick is to use the Get Text Rect.vi to calculate where to wrap your text string. There's no feature to automatically wrap the string for you, so you will have to split you string into sections/lines, that doesn't exceed the width of the column in the listbox.
    Good luck!
    - Philip Courtois, Thinkbot Solutions

  • How do I override line wrap to customize a JTextPane w/ StyledDocument?

    Any example would be greatly appreciated -
    I just want to indent any line that gets wrapped, but
    don't know how to go about it.
    Thanks.

    heres an example
    Situation: Your TextPane is 30 Characters long
    public boolean  enoughSpace(String x)
         //Code to check to see if the String x is going to be wrapped by auto wrap
    public void indent()
         //Code to get the number of characters left in a line, then add that many empty spaces     to your styleddocument then add 5 more blank spaces.
    //This next part goes wherever your adding your string to styled document
    if(!enoughSpace())
         indent();
    }bad part about it is i dont know any code off the top of my head to right it for you and you have to add words to your styled document one word at a time. Hope this helps :-D;

  • How to prevent automatically opening of downloaded zip-files?

    I have a problem to install an extension in Joomla. Joomla asks for a Zip-file. When I download the zip-file from the website, the zip-file is shown in Finder as a folder, i.e. an opened zip-file. Joomla does not see a folder, because it looks for a zip-file. I have a terrible solution, but I am sure others will know a better one. I used my old Windows computer, downloaded the zip-file that in Windows shows the extension .zip. Copy the file to Finder and now it shows in Finder the file as a zip-file. So, I suppose that my OS X (now Yosemite, but it happened already under Maverics) or my Safari changes a zip-file in an opened form. I could not find a way to change this to the state that Safari, Finder or OS X is not automatically opening zip-files.

    Choose Preferences from the Safari menu, click on General, and uncheck the box to automatically open safe files.
    (114978)

  • How to prevent automatic translation of a non-english site - usually by worldlingo

    Before chosen site opens worldlingo overides and displays in a translation (of sorts). Would like to see the original language text and/or choose translator (have Foxlingo addon) . Is this because the site(s) recognise application is made from a UK portal perhaps, although this doesn't happen with IE?

    Before chosen site opens worldlingo overides and displays in a translation (of sorts). Would like to see the original language text and/or choose translator (have Foxlingo addon) . Is this because the site(s) recognise application is made from a UK portal perhaps, although this doesn't happen with IE?

  • Automatic word wrapping in context help window?

    Hello together
    I don't get the way how labview does the automatic word wrapping in the context help window. Does somebody know that?
    regards
    Woodi

    I see my problem. Everytime I do just a single carriage return, or a return, the automatic line wrapping doesn't work. But it works fine, if I do two carriage returns.
    This is actually not exactly what I want, but at least the user doesn't have to scroll.
    Woodi

  • Disable Line wrap in Terminal

    How do you disable line wrap in bash? As in
    $ls -la
    or
    mysql> select * from db;
    displaying exceedingly lengthy data. Or perhaps readline options to disable wrapping?
    May be just a horizontal scroll bar in Terminal?

    Thanks for responding. I believe that setting is for input not output. Plus it is on. I think terminal needs a horizontal scrool bar.
    $ bind -v
    set bind-tty-special-chars on
    set blink-matching-paren on
    set byte-oriented off
    set completion-ignore-case off
    set convert-meta off
    set disable-completion off
    set enable-keypad off
    set expand-tilde off
    set history-preserve-point off
    set horizontal-scroll-mode on
    set input-meta on
    set mark-directories on
    set mark-modified-lines off
    set mark-symlinked-directories off
    set match-hidden-files on
    set meta-flag on
    set output-meta on
    set page-completions on
    set prefer-visible-bell on
    set print-completions-horizontally off
    set show-all-if-ambiguous off
    set show-all-if-unmodified off
    set visible-stats off
    set bell-style audible
    set comment-begin #
    set completion-query-items 100
    set editing-mode emacs
    set keymap emacs

Maybe you are looking for

  • HT1491 icon "store" in the top right corner... please help !

    when I open settings-sounds, I don't have icon "store" in the top right corner... can someone give me a hint about this? I am from Croatia, can this maybe be the reason? I updated to the last iOS 6.1.3. Thanks in advance

  • Weird Mountain Lion Error: Not Writing to Disk

    I've been having a problem where my MBP running Mountain Lion. Since updating to 10.8.2, my computer will randomly lose its the ability to read and write to disk. Files will not save, keychain access fails (asking me to reenter my passwords, which I

  • Custom Search Portlet: How to specify a page in the auto query?

    I want to specify a page in an auto query (Automatically display search results). I'm able to specify a pagegroup (Tab What to Search), but unable to select a specific page and to include/exclude subpages. This option is available on the SearchForm T

  • I want to change my alias

    I've had this account for several years -- not sure how many. When I set it up, I unwittingly made my alias my actual name. Probably not such a good idea in today's creepy world. It looks like I can't change my alias. I thought about closing the acco

  • Trouble with deleting mail in Gmail

    Before I upgraded to iOS 5 last night, when I deleted an email in gmail using the mail app on my phone, it would move it into the trash.  From here I could delete it out of the trash, and it would be gone for good.  Since I've updated, when I move an