1 | static JPanel scrollable_trackHeight(final Component component) { |
2 | class P extends SingleComponentPanel implements Scrollable { |
3 | *() { super(component); } |
4 | |
5 | public Dimension getPreferredScrollableViewportSize() { ret getPreferredSize(); } |
6 | |
7 | public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction) { return 20; } |
8 | |
9 | public int getScrollableBlockIncrement(Rectangle visibleRect, int orientation, int direction) { |
10 | ret (direction == SwingConstants.HORIZONTAL ? visibleRect.width : visibleRect.height)*5/6; |
11 | } |
12 | |
13 | public bool getScrollableTracksViewportWidth() { false; } |
14 | public boolean getScrollableTracksViewportHeight() { true; } |
15 | } |
16 | ret swing(func -> P { new P }); |
17 | } |
Began life as a copy of #1014106
download show line numbers debug dex old transpilations
Travelled to 8 computer(s): bhatertpkbcr, cfunsshuasjs, gwrvuhgaqvyk, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1020092 |
Snippet name: | scrollable_trackHeight |
Eternal ID of this version: | #1020092/1 |
Text MD5: | 46774a54f3984f361112a55350a43fcc |
Author: | stefan |
Category: | javax / gui |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2018-12-07 01:23:33 |
Source code size: | 754 bytes / 17 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 239 / 269 |
Referenced in: | [show references] |