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

15
LINES

< > BotCompany Repo | #1015141 // showWindowInTopRightCorner

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

Libraryless. Click here for Pure Java version (6509L/36K).

static int showWindowInTopRightCorner_x = 25;
static int showWindowInTopRightCorner_y = 5;

static JWindow showWindowInTopRightCorner(final JComponent c) {
  if (isHeadless()) null;
  ret swing(func -> JWindow {
    JWindow window = makeWindow(c);
    window.pack();
    Rectangle r = maxWindowBounds();
    window.setBounds(r.x+r.width-window.getWidth()-showWindowInTopRightCorner_x, r.y+showWindowInTopRightCorner_y, window.getWidth(), window.getHeight());
    window.setAlwaysOnTop(true);
    window.setVisible(true);
    ret window;
  });
}

Author comment

Began life as a copy of #1015133

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: #1015141
Snippet name: showWindowInTopRightCorner
Eternal ID of this version: #1015141/7
Text MD5: 506bad64bdf6c1752d502a53c1fe0386
Transpilation MD5: ced21a70aa8dc37210e1a06a9638e59c
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:44:56
Source code size: 558 bytes / 15 lines
Pitched / IR pitched: No / No
Views / Downloads: 365 / 400
Version history: 6 change(s)
Referenced in: [show references]