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

25
LINES

< > BotCompany Repo | #1013348 // Blinking Red Text Spike v3 [OK]

JavaX source code (desktop) [tags: use-pretranspiled] - run with: x30.jar

Download Jar. Libraryless. Click here for Pure Java version (5856L/39K).

1  
!7
2  
3  
static float fontSize = 80f;
4  
5  
import java.awt.font.*;
6  
import java.awt.geom.*;
7  
8  
p-awt {
9  
  JPanel panel = singleColorPanel(Color.RED);
10  
  new JWindow w;
11  
  w.add(panel);
12  
  w.setVisible(true);
13  
  
14  
  TextLayout tl = new TextLayout("PERV ALERT", w.getFont().deriveFont(Font.BOLD, fontSize),
15  
    ((Graphics2D) w.getGraphics()).getFontRenderContext());
16  
  Rectangle2D r = tl.getBounds();
17  
  print("Bounds: " + r);
18  
  new AffineTransform tx;
19  
  tx.translate(0, r.getHeight());
20  
  Shape outline = tl.getOutline(tx);
21  
  //w.setShape(new Ellipse2D.Double(0,0,500,500));
22  
  centerWindow(w, iceil(r.getWidth()), iceil(r.getHeight()));
23  
  w.setShape(outline);
24  
  blinkWindowUsingSize(w);
25  
}

Author comment

Began life as a copy of #1013339

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: #1013348
Snippet name: Blinking Red Text Spike v3 [OK]
Eternal ID of this version: #1013348/4
Text MD5: 005c600a1727fb68f4a28d4dcdad0846
Transpilation MD5: 88f227603c1905520ebad8e5299364cf
Author: stefan
Category: javax / gui
Type: JavaX source code (desktop)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-01-02 23:12:25
Source code size: 691 bytes / 25 lines
Pitched / IR pitched: No / No
Views / Downloads: 524 / 1063
Version history: 3 change(s)
Referenced in: [show references]