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

26
LINES

< > BotCompany Repo | #1019383 // Tray Area Test v1 [Dyn Module, doesn't work anymore]

JavaX source code (Dynamic Module) [tags: use-pretranspiled] - run with: Stefan's OS

Libraryless. Click here for Pure Java version (14623L/100K).

!7

module TrayAreaTest > DynPrintLog {
  start {
    final JPanel trayArea = dm_getOSOpt('trayArea);
    if (trayArea == null) ret with print("No tray area");
    print("Got tray area. Setting contents.");
    swing {
      removeAllComponents(trayArea);
      trayArea.setLayout(new BorderLayout);
      JLabel label = jcenteredlabel("Hello world!");
      trayArea.add(label, BorderLayout.CENTER);
      trayArea.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 20));
      revalidate(trayArea);
      Dimension size = label.getPreferredSize();
      print("Minimum size: " + size);
      Dimension parentSize;
      print("Parent size: " + (parentSize = trayArea.getParent().getSize()));
      //print("height: ", trayArea.getHeight());
      int h = parentSize.height;
      setPreferredSize(trayArea, size.width, size.height);
      revalidate(trayArea.getParent());
    }
    print("Done.");
  }
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1019383
Snippet name: Tray Area Test v1 [Dyn Module, doesn't work anymore]
Eternal ID of this version: #1019383/17
Text MD5: db926aa8dba2ef1d7424a1d300ded29d
Transpilation MD5: 71ef1914c68bea8d4e99422e467a4647
Author: stefan
Category: javax / stefan's os
Type: JavaX source code (Dynamic Module)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-11-04 19:06:54
Source code size: 931 bytes / 26 lines
Pitched / IR pitched: No / No
Views / Downloads: 306 / 442
Version history: 16 change(s)
Referenced in: [show references]