java - Prevent components inside jscrollpane from extending past horizontal edge -
java - Prevent components inside jscrollpane from extending past horizontal edge -
in project i'm doing have set of jtextpane's wrapped in jpanels within jframe. jtextpane's can various sizes when programming running, , size cannot predicted, unless hardcoded. create sure of jtextpane's (which within jpanels) viewable, have set in scroll pane. here's catch: i want jtextpane's extend past bottom of jscrollpane if needed, don't want them extend past side. want jpanels/jtextpanes take much space possible horizontal, without requiring utilize of horizontal scroll bar. means if window resized horizontally, jtextpanes need resize fill horizontal space. jtextpanes wrapped first in panel uses "grouplayout" supplied netbeans gui builder, , in panel uses boxlayout. reason boxlayout add together new elements (jtextpane's wrapped in panel), via code. much easier using boxlayout.
i tried setting prefferred width of jtextpane's integer.max_value
, caused them extend out of site right. tried disabling, horizontal scrollbar, jtextpanes still extended right. couldn't scroll see them! tried using event grab whenever jframe resized, phone call methods cause in tree resize. didn't seem work @ all. did trying set preferred width of each jtextpane preferred width of jframe, didn't seem have effect.
here's looks if have width of inner jtextpane set 427
:
here's have if leave jtextpane's size @ "default" (which believe integer.max_value
):
in case matters, i'm using netbeans gui builder (matisse), i'd prefer solution didn't involve changing layout manager, open that. note said above, boxlayout used in of panels, it's part of issue.
java swing user-interface jscrollpane matisse
Comments
Post a Comment