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

35
LINES

< > BotCompany Repo | #1015133 // flatInfoBox_topRightCorner - show flat info message in top-right corner

JavaX fragment (include)

1  
please include function flatInfoBox.
2  
3  
static int flatInfoBox_topRightCorner_x = 50;
4  
static int flatInfoBox_topRightCorner_y = 5;
5  
6  
static JWindow flatInfoBox_topRightCorner(S text) {
7  
  ret flatInfoBox_topRightCorner(text, flatInfoBox_defaultTime);
8  
}
9  
10  
static JWindow flatInfoBox_topRightCorner(final S text, final double seconds) {
11  
  print(text);
12  
  ret flatInfoBox_topRightCorner_noprint(text, seconds);
13  
}
14  
15  
static JWindow flatInfoBox_topRightCorner_noprint(S text) {
16  
  ret flatInfoBox_topRightCorner_noprint(text, flatInfoBox_defaultTime);
17  
}
18  
19  
static JWindow flatInfoBox_topRightCorner_noprint(final S text, final double seconds) {
20  
  logQuotedWithDate(infoBoxesLogFile(), text); 
21  
  if (isHeadless()) null;
22  
  ret (JWindow) swingAndWait(func {
23  
    JWindow window = makeWindow(flatInfoBox_makePanel(text));
24  
    window.pack();
25  
    window.setBounds(screenWidth()-window.getWidth()-flatInfoBox_topRightCorner_x, flatInfoBox_topRightCorner_y, window.getWidth(), window.getHeight());
26  
    if (flatInfoBox_alwaysOnTop)
27  
      window.setAlwaysOnTop(true);
28  
    window.setVisible(true);
29  
    disposeWindowAfter(iround(seconds*1000), window);
30  
    ret window;
31  
  });
32  
33  
  /*ret moveToTopRightCorner(flatInfoBox_topRightCorner_x, flatInfoBox_topRightCorner_y,
34  
    packWindow(flatInfoBox_noprint(text, flatInfoBox_defaultTime)));*/
35  
}

Author comment

Began life as a copy of #1014595

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: #1015133
Snippet name: flatInfoBox_topRightCorner - show flat info message in top-right corner
Eternal ID of this version: #1015133/12
Text MD5: 67bcd0a5000c9fbca1f17e5a40cbf309
Author: stefan
Category: javax / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-10-27 09:45:51
Source code size: 1342 bytes / 35 lines
Pitched / IR pitched: No / No
Views / Downloads: 394 / 409
Version history: 11 change(s)
Referenced in: [show references]