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


< > BotCompany Repo | #1006245 // infoMessage - show info message in top-right corner

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

Libraryless. Click here for Pure Java version (7785L/44K).

static bool infoMessage_alwaysOnTop = true;
static double infoMessage_defaultTime = 5.0;

// automatically switches to AWT thread for you
static JWindow infoMessage(S text) {
  ret infoMessage(text, infoMessage_defaultTime);

static JWindow infoMessage(final S text, final double seconds) {
  ret infoMessage_noprint(text, seconds);

static JWindow infoMessage_noprint(S text) {
  ret infoMessage_noprint(text, infoMessage_defaultTime);

static JWindow infoMessage_noprint(final S _text, final double seconds) {
  fS text = hideCredentials(_text);
  if (empty(text)) null;
  logQuotedWithDate(infoBoxesLogFile(), text); 
  if (isHeadless()) null;
  ret (JWindow) swingAndWait(func {
    JWindow window = makeWindow(infoMessage_makePanel(text));
    window.setSize(300, 150);
    if (infoMessage_alwaysOnTop)
    if (vmBus_noObjections shouldShowInfoBox(window, text))
    if (seconds != 0)
      disposeWindowAfter(iround(seconds*1000), window);
    ret window;

static JWindow infoMessage(Throwable e) {
  ret infoMessage(exceptionToStringShort(e));

Author comment

Began life as a copy of #1003544

download  show line numbers  debug dex  old transpilations   

Travelled to 19 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, imzmzdywqqli, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mowyntqkapby, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, sawdedvomwva, snaazhdonpnp, tslmcundralx, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv

No comments. add comment

Snippet ID: #1006245
Snippet name: infoMessage - show info message in top-right corner
Eternal ID of this version: #1006245/18
Text MD5: 3d0d18610f05422289c3347a45d45e92
Transpilation MD5: 10874b560d3b73d0bcf0def7015a82db
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:40
Source code size: 1279 bytes / 41 lines
Pitched / IR pitched: No / No
Views / Downloads: 663 / 807
Version history: 17 change(s)
Referenced in: [show references]