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

15
LINES

< > BotCompany Repo | #1019509 // dynamicallyPaintedComponent

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (2939L/17K).

1  
// paint: graphics/component width/component height
2  
// called in AWT thread
3  
static JComponent dynamicallyPaintedComponent(final VF3<Graphics2D, Int, Int> paint) {
4  
  ret swing(func -> JComponent {
5  
    ret new JComponent {
6  
      public void paint(Graphics g) {
7  
        callF(paint, (Graphics2D) g, getWidth(), getHeight());
8  
      }
9  
    };
10  
  });
11  
}
12  
13  
static JComponent dynamicallyPaintedComponent(IVF3<Graphics2D, Int, Int> paint) {
14  
  ret dynamicallyPaintedComponent(toVF3(paint));
15  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 12 computer(s): bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1019509
Snippet name: dynamicallyPaintedComponent
Eternal ID of this version: #1019509/7
Text MD5: a916e8ee253f6b6b05d106fa44f63eb3
Transpilation MD5: 16b939e365b83dd504cfd0a892136428
Author: stefan
Category: javax / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-05-07 15:08:32
Source code size: 494 bytes / 15 lines
Pitched / IR pitched: No / No
Views / Downloads: 329 / 411
Version history: 6 change(s)
Referenced in: [show references]