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

51
LINES

< > TinyBrain | #1008042 - Interactive Java [dev.]

JavaX source code (desktop) [tags: use-pretranspiled] - run with: x30.jar - homepage

Uses 1937K of libraries. Click here for Pure Java version (10980L/77K).

!7

sS concepts = [[
  xdzeaxtmkazaxncy - Set object to string X
  ocipgkzuhonmxyxp - Run standard function X on object
  rkaqgiahlhpqcsfb - Cool!
]];

sO object;
sS text;
static JTextArea taObject;
static JTextField tfCmd;

p-awt {
  blueSteel();
  useConcepts(concepts);
  object = 5;
  text = struct(object);
  taObject = wrappedTextArea(text);
  setFontSize(taObject, 15);
  tfCmd = jtextfield("ocipgkzuhonmxyxp plus1");
  showFrame(
    centerAndSouth(jSection("Object", taObject),
    jSection("Command", textFieldWithButton("Go", tfCmd))));
  onEnter(tfCmd, f go);
  requestFocus(tfCmd);
  hideConsole();
}

svoid go {
  tfCmd.selectAll();
  final Lisp cmd = englishToLisp(getTextTrim(tfCmd));
  thread { pcall-messagebox { loading {
    if (cmd.is("ocipgkzuhonmxyxp", 1)) // Run standard function X on object
      setObject(makeAndCall_cached(cmd.raw(0), object);
    if (cmd.is("xdzeaxtmkazaxncy", 1)) // Set object to string X
      setObject(cmd.raw(0));
    if (cmd.is("rkaqgiahlhpqcsfb"))
      infoBox("Thanks!");
  }}}
}

svoid setObject(fO o) swing {
  object = o;
  try {
    text = struct(o);
  } catch e {
    text = getStackTrace(e);
  }
  taObject.setText(text);
}

download  show line numbers  debug dex   

Travelled to 2 computer(s): cfunsshuasjs, tvejysmllsmz

No comments. add comment

Snippet ID: #1008042
Snippet name: Interactive Java [dev.]
Eternal ID of this version: #1008042/20
Text MD5: fd0ace180865d2e24660eb8b517aa60a
Transpilation MD5: d4e2ec2382754efa521a6ad1a57036ab
Author: stefan
Category: javax
Type: JavaX source code (desktop)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-04-21 16:42:52
Source code size: 1236 bytes / 51 lines
Pitched / IR pitched: No / No
Views / Downloads: 49 / 103
Version history: 19 change(s)
Referenced in: [show]