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

35
LINES

< > BotCompany Repo | #1001623 // showFrame (synonym of makeFrame)

JavaX fragment (include)

static JFrame showFrame() {
  ret makeFrame();
}

static JFrame showFrame(O content) {
  ret makeFrame(content);
}

static JFrame showFrame(S title) {
  ret makeFrame(title);
}

static JFrame showFrame(String title, O content) {
  ret makeFrame(title, content);
}

static JFrame showFrame(final JFrame f) {
  if (f != null) swing {
    if (frameTooSmall(f)) frameStandardSize(f);
    if (!f.isVisible()) f.setVisible(true); // XXX
    if (f.getState() == Frame.ICONIFIED) f.setState(Frame.NORMAL);
  }
  ret f;
}

// make or update frame
static JFrame showFrame(String title, O content, JFrame frame) {
  if (frame == null)
    ret showFrame(title, content);
  else {
    frame.setTitle(title);
    setFrameContents(frame, content);
    ret frame;
  }
}

Author comment

Began life as a copy of #1000921

download  show line numbers  debug dex  old transpilations   

Travelled to 17 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mowyntqkapby, mqqgnosmbjvj, mqsvbyillbrs, onxytkatvevr, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv

No comments. add comment

Snippet ID: #1001623
Snippet name: showFrame (synonym of makeFrame)
Eternal ID of this version: #1001623/8
Text MD5: 0cdbb7427a1a0e44896111318f3f286f
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-05-13 20:49:42
Source code size: 787 bytes / 35 lines
Pitched / IR pitched: No / No
Views / Downloads: 1018 / 1803
Version history: 7 change(s)
Referenced in: [show references]