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


< > BotCompany Repo | #1000921 - makeFrame (make JFrame and show it) - contains standard frame title popup menu

JavaX fragment (include)

static S makeFrame_defaultIcon;
sbool makeFrame_hideConsole;
static new ThreadLocal<VF1<JFrame>> makeFrame_post;

static JFrame makeFrame() {
  ret makeFrame((Component) null);

static JFrame makeFrame(O content) {
  ret makeFrame(programTitle(), content);

static JFrame makeFrame(S title) {
  ret makeFrame(title, null);

static JFrame makeFrame(S title, O content) {
  ret makeFrame(title, content, true);

static JFrame makeFrame(fS title, fO content, final bool showIt) {
  final VF1<JFrame> post = optParam(makeFrame_post);
  ret swing(func -> JFrame {
    if (getFrame(content) != null)
      ret getFrame(setFrameTitle((Component) content, title));
    final JFrame frame = new JFrame(title);
    if (makeFrame_defaultIcon != null)
      setFrameIconLater(frame, makeFrame_defaultIcon);
    Component wrapped = wrap(content);
    if (wrapped != null)
    callF(post, frame);
    if (showIt)
    //callOpt(content, "requestFocus");
    if (showIt && makeFrame_hideConsole) {
      makeFrame_hideConsole = false;
    ret frame;

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1000921
Snippet name: makeFrame (make JFrame and show it) - contains standard frame title popup menu
Eternal ID of this version: #1000921/23
Text MD5: f44cd1681627d045c5488d11b5452b3a
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-06-30 14:51:41
Source code size: 1317 bytes / 49 lines
Pitched / IR pitched: No / No
Views / Downloads: 662 / 1638
Version history: 22 change(s)
Referenced in: [show references]