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).

1  
!7
2  
3  
concept Cmd { S text, program; }
4  
5  
p-substance-thread {
6  
  final SimpleCRUD crud = new SimpleCRUD(Cmd).show();
7  
  awt {
8  
    autoFrameTitle(crud.panel);
9  
    final new JTextField tfBoom;
10  
    final new JLabel lblAnswer;
11  
    addToWindow(crud.panel, withLabel("Try it here:", tfBoom);
12  
    addToWindow(crud.panel, lblAnswer);
13  
    onEnter(tfBoom, r-thread {
14  
      // almost-clean sync here
15  
      setText(lblAnswer, or(pcallAnswerMethod(getText(tfBoom)), "?"));
16  
    });
17  
    requestFocus(tfBoom);
18  
    hideConsole();
19  
  }
20  
}
21  
22  
answer {
23  
  S answer = "";
24  
  for (Cmd cmd) if (match(cmd.text, s)) {
25  
    nohupJavax(cmd.program);
26  
    answer += "Yo! ";
27  
  }
28  
  try answer trim(answer);
29  
}

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: 447 / 561
Referenced in: [show references]