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

35
LINES

< > BotCompany Repo | #1009155 // Test dorkbox SystemTray

JavaX source code [tags: use-pretranspiled] - run with: x30.jar

Uses 8614K of libraries. Click here for Pure Java version (1131L/8K/28K).

!7

lib 1009154 lib 1004016 // SystemTray, slf4j
lib 1009055 lib 1009056 // JNA
lib 1009157 // javassist for Windows fixes

import dorkbox.systemTray.*;
import dorkbox.systemTray.SystemTray;
import dorkbox.systemTray.MenuItem;
//import dorkbox.systemTray.swingUI.*;

p {
  // SystemTray.SWING_UI = new CustomSwingUI();
  
  print("Getting SystemTray");
  final SystemTray systemTray = SystemTray.get();
  if (systemTray == null)
    fail("Unable to load SystemTray!");
  print("Got.");

  pcall {
    systemTray.setImage(loadImage2(#1003596));
    print("Set image");
  }

  systemTray.setStatus("Not Running");
  print("Set status");
 
  systemTray.getMenu().add(new MenuItem("Quit", actionListener(r {
    //systemTray.shutdown();
    System.exit(0);
  }))).setShortcut('q'); // case does not matter
  
  print("Added menu item");
}

download  show line numbers  debug dex  old transpilations   

Travelled to 17 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, dpnavvvsbarw, estmjqchrwzt, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, nnmtytuibrzp, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt, wtqryiryparv

No comments. add comment

Snippet ID: #1009155
Snippet name: Test dorkbox SystemTray
Eternal ID of this version: #1009155/15
Text MD5: 734530ff2aa9ad09ac66176bfe9448a8
Transpilation MD5: 53bb638b0776262706d6180c75b16218
Author: stefan
Category: javax / gui
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-07-06 23:36:03
Source code size: 868 bytes / 35 lines
Pitched / IR pitched: No / No
Views / Downloads: 561 / 688
Version history: 14 change(s)
Referenced in: [show references]