Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

17
LINES

< > BotCompany Repo | #1014106 // scrollable_trackWidth

JavaX fragment (include)

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 });
}

Author comment

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: 439 / 474
Version history: 4 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1020092 - scrollable_trackHeight