1 | static JPanel scrollable_trackWidth(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() { true; } |
14 | public boolean getScrollableTracksViewportHeight() { false; } |
15 | } |
16 | ret swing(func -> P { new P }); |
17 | } |
Began life as a copy of #1008609
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1014106 |
Snippet name: | scrollable_trackWidth |
Eternal ID of this version: | #1014106/5 |
Text MD5: | f45b437d83f43d711075958f5f593470 |
Author: | stefan |
Category: | javax / gui |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2018-04-10 17:35:26 |
Source code size: | 753 bytes / 17 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 438 / 474 |
Version history: | 4 change(s) |
Referenced in: | [show references] |