9 comments
Comment actions Permalink

Override the createEditor() method and, after calling super, call editor.setHorizontalScrollbarVisible(true) and/or editor.setVerticalScrollbarVisible(true) as needed.

3
Comment actions Permalink

Override the createEditor() method and, after calling super

Could please provide me a quick code example?

0
Comment actions Permalink

Thanks Dmitry.
The vertical scrolling works great now. But the horizontal scrollbar does not appear instead the editor gets stretched to fit the codes width.
See attached screenshot.



Attachment(s):
Screenshot 2015-03-09 11.08.33.png
0
Comment actions Permalink

How is your dialog laid out?

0
Comment actions Permalink

Here's the part of the form. I hope this is what you meant. If not please let me know what you need.

<grid id="1af46" binding="panelCode" layout-manager="GridLayoutManager" row-count="2" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">   <margin top="0" left="0" bottom="0" right="0"/>   <constraints>     <grid row="0" column="1" row-span="2" col-span="1" vsize-policy="3" hsize-policy="6" anchor="0" fill="3" indent="0" use-parent-layout="false"/>   </constraints>   <properties/>   <border type="none"/>   <children>     <component id="e3928" binding="labelCode">       <constraints>         <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>       </constraints>       <properties>         <text value="Source Code"/>       </properties>     </component>     <scrollpane id="c9566" binding="scrollPaneCode" custom-create="true">       <constraints>         <grid row="1" column="0" row-span="1" col-span="1" vsize-policy="7" hsize-policy="7" anchor="0" fill="3" indent="0" use-parent-layout="false"/>       </constraints>       <properties/>       <border type="none"/>       <children/>     </scrollpane>   </children> </grid>

0
Comment actions Permalink

You don't need any additional scrollpane around the editor; it'll take care of the scrolling itself.


1
Comment actions Permalink

Got it working. I fixed the size of the JDialog and the containing JPanels.

0
Comment actions Permalink

Thank you @Dmitry. You made my day! After two resultless days working on `JBScrollPane`, I found this post finally. Please provide the Scrolling behavior as a standard API in `EditorTextField` class. Without such forums, it takes forever to find the solution.

0

Please sign in to leave a comment.