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

29
LINES

< > BotCompany Repo | #1006640 // Short Commands

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

Libraryless. Click here for Pure Java version (9459L/65K/220K).

!7

concept Cmd { S text, program; }

p-substance-thread {
  final SimpleCRUD crud = new SimpleCRUD(Cmd).show();
  awt {
    autoFrameTitle(crud.panel);
    final new JTextField tfBoom;
    final new JLabel lblAnswer;
    addToWindow(crud.panel, withLabel("Try it here:", tfBoom);
    addToWindow(crud.panel, lblAnswer);
    onEnter(tfBoom, r-thread {
      // almost-clean sync here
      setText(lblAnswer, or(pcallAnswerMethod(getText(tfBoom)), "?"));
    });
    requestFocus(tfBoom);
    hideConsole();
  }
}

answer {
  S answer = "";
  for (Cmd cmd) if (match(cmd.text, s)) {
    nohupJavax(cmd.program);
    answer += "Yo! ";
  }
  try answer trim(answer);
}

download  show line numbers  debug dex  old transpilations   

Travelled to 15 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, hszllmzzlmie, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt, wikwqtdvqeud

No comments. add comment

-
Snippet ID: #1006640
Snippet name: Short Commands
Eternal ID of this version: #1006640/1
Text MD5: 44351fcda38aa08db1228ac82e075869
Transpilation MD5: c8bf6ad0f70e4f6da9684d7351e6c652
Author: stefan
Category: javax / gui
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-01-25 05:31:00
Source code size: 694 bytes / 29 lines
Pitched / IR pitched: No / No
Views / Downloads: 493 / 617
Referenced in: