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

22
LINES

< > BotCompany Repo | #1015641 // showSuggestion_individual

JavaX fragment (include)

static double showSuggestion_hideTime = 3.0;

// action is called in new thread
static JLabel showSuggestion_individual(fS suggestionText, fO action) {
  final int fontSize = 20, buttonFontSize = 15;
  final JLabel label = fontSize(fontSize, jCenteredMultiLineLabel(suggestionText));
  final VF1<JFrame> framePost = getThreadLocal(makeFrame_post);
  swing {
    makeFrame_post.set(or(framePost, vf1_frameAutoRequestFocusFalse()));
    JFrame f = alwaysOnTop(showPackedFrameInBottomRightCorner(
      withLineBorder(Color.black, withMargin(
        centerAndSouth(
          label,
          withTopMargin(makeFirstButtonBold(fontSizeAll(buttonFontSize, jcenteredbuttons(
            "OK", r {
              hideSuggestion(label);
              callFInNewThread(action);
            }, "No", r { hideSuggestion(label) })))))))));
    disposeWindowAfter_unlessMouseInIt(f, showSuggestion_hideTime);
  }
  ret label;
}

Author comment

Began life as a copy of #1015640

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: #1015641
Snippet name: showSuggestion_individual
Eternal ID of this version: #1015641/3
Text MD5: 0d4f6d242e18fc48fb61ffea3902c3de
Author: stefan
Category: javax / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-05-21 00:32:34
Source code size: 936 bytes / 22 lines
Pitched / IR pitched: No / No
Views / Downloads: 351 / 389
Version history: 2 change(s)
Referenced in: [show references]