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

16
LINES

< > BotCompany Repo | #1006706 // titleStatus - add a leading status to a window's title

JavaX fragment (include)

static new WeakHashMap<JFrame, S> titleStatus_map;

static void titleStatus(Component c, O _status) {
  S status = strOrEmpty(_status);
  JFrame f = getFrame(c);
  if (f == null) ret;
  S sep = " - ";
  S s = titleStatus_map.get(f);
  if (s != null) s = empty(status) ? s : status + sep + s;
  else s = replaceLeader(status, sep, getFrameTitle(f));
  setFrameTitle(f, s);
}

static void titleStatus_setBaseTitle(Component c, S title) {
  mapPut(titleStatus_map, getFrame(c), title);
}

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: #1006706
Snippet name: titleStatus - add a leading status to a window's title
Eternal ID of this version: #1006706/6
Text MD5: 0fe9e457384485216b8ad64d51dc0121
Author: stefan
Category: javax / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-04-20 16:38:09
Source code size: 499 bytes / 16 lines
Pitched / IR pitched: No / No
Views / Downloads: 440 / 508
Version history: 5 change(s)
Referenced in: [show references]