java - Allowing User to Resize JScrollPane -


when user moves cursor on border of jscrollpane, can turn cursor 2 little arrows pointing @ opposite directions of each other user may shrink or grow entire jscrollpane?

jscrollpane scrollpane = new jscrollpane(buddylist,     scrollpaneconstants.vertical_scrollbar_as_needed,     scrollpaneconstants.horizontal_scrollbar_as_needed);  layoutconstraints.gridx = 0;  layoutconstraints.gridy = 0; layoutconstraints.gridwidth = 3;  layoutconstraints.gridheight = 8; layoutconstraints.fill = gridbagconstraints.both; layoutconstraints.insets = new insets(10, 6, 10, 36); layoutconstraints.anchor = gridbagconstraints.northwest; layoutconstraints.weightx = 0.8;  layoutconstraints.weighty = 1.0; layout.setconstraints(scrollpane, layoutconstraints); add(scrollpane);//adds scrollpane straight panel class extends jpanel 

you looking @ wrong place. if want allow resizing of scrollpane, scrollpane wrong object at. it’s responsibility of parent container (or layout manager) give or take space component (which happens scrollpane here) , distribute other children. simplest way put scrollpane split pane. may put split pane split pane different orientation allow resizing in both direction, resize direct neighbor of scroll pane (the other child of inner split pane) well. there no solution these layouts forming kind of grid.

note used gridbaglayout in parent container it’s hard achieve such resize support. , if implement tricky trick gridbaglayout size entire rows or columns. have same problem nested split panes worse.


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

IIS->Tomcat Redirect: multiple worker with default -