Help needed to customize word wrap in a styled JTextPane editor

I would appreciate if someone could teach me how to customize the wrap property on JTextPane.

I want to set the wrap property at a desire width regardeles of the viewport. then I want to use Horizontal ScrollBar to view the hidden part oft he document's width.

Thanks for your help.


Hernan

Comments

  • It could be solved simply override the method "getScrollableTracksViewportWidth()" always returns as "false".

    at first you setting the text to the jtextpane, you should set the size by the most long row width.

    and after the setting of Text, you may add the pane into the jscrollpane.

    after the setBounds, the scroll will made..


    : I would appreciate if someone could teach me how to customize the wrap property on JTextPane.
    :
    : I want to set the wrap property at a desire width regardeles of the viewport. then I want to use Horizontal ScrollBar to view the hidden part oft he document's width.
    :
    : Thanks for your help.
    :
    :
    : Hernan
    :

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion