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

25
LINES

< > BotCompany Repo | #1016189 // System Print Log [Dyn Module, old version]

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

Libraryless. Click here for Pure Java version (14457L/101K).

!7

// TODO: capture all of System.out/System.err

sclass SystemPrintLog extends DynModule {
  transient O log;
  transient JTextArea ta;
  
  void start {
    log = getCreator('print_log);
    doEvery(1000, r updateMe);
  }
  
  JComponent visualize() {
    ret componentPopupMenuItems(jSection("SYSTEM LOG", ta = moveCaretToEnd(typeWriterTextArea(str(log)))),
      "Clear", r { clearStringBuffer_gen(log) },
      "Copy to new window", r { showText("System Log", log) });
  }
  
  void unvisualize() { ta = null; }
  
  void update {
    if (ta != null) setText(ta, str(log));
  }
}

Author comment

Began life as a copy of #1016130

download  show line numbers  debug dex  old transpilations   

Travelled to 10 computer(s): aoiabmzegqzx, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, hpgrupgrauku, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, tslmcundralx, tvejysmllsmz

No comments. add comment

Snippet ID: #1016189
Snippet name: System Print Log [Dyn Module, old version]
Eternal ID of this version: #1016189/11
Text MD5: 438e1818e4603707a42be1534887b031
Transpilation MD5: c10bf70b783d215b6c1f5a886e5b8620
Author: stefan
Category: javax / gui
Type: JavaX source code (Dynamic Module)
Public (visible to everyone): Yes
Archived (hidden from active list): Yes
Created/modified: 2018-11-29 02:22:32
Source code size: 611 bytes / 25 lines
Pitched / IR pitched: No / No
Views / Downloads: 368 / 88066
Version history: 10 change(s)
Referenced in: [show references]