static JPanel scrollable_trackWidth(final Component component) { class P extends SingleComponentPanel implements Scrollable { *() { super(component); } public Dimension getPreferredScrollableViewportSize() { ret getPreferredSize(); } public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction) { return 20; } public int getScrollableBlockIncrement(Rectangle visibleRect, int orientation, int direction) { ret (direction == SwingConstants.HORIZONTAL ? visibleRect.width : visibleRect.height)*5/6; } public bool getScrollableTracksViewportWidth() { true; } public boolean getScrollableTracksViewportHeight() { false; } } ret swing(func -> P { new P }); }
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: | 437 / 473 |
Version history: | 4 change(s) |
Referenced in: | [show references] |