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

35
LINES

< > BotCompany Repo | #1009944 // lalala 5 [OK]

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

Download Jar. Libraryless. Click here for Pure Java version (8793L/58K).

!7

static IVar<S> text;
static JTextField tf;
static JDesktopPane desktop;

p-awt {
  text = persistentVar("Text", "Show me a window!");
  
  tf = jcenteredtextfield(text!);
  onUpdate(tf, r { text.set(getText(tf)) });
  onEnter(tf, f go);
  desktop = jTiledBackgroundDesktopPane(#1009931);
  final JPanel bg = jtransparent_recursive(
    jfullcenter(withBottomMargin(550, jMinWidth(400,
      setFontSize(30, tf)))));
  desktop.add(bg);
  desktop.setLayout(layoutManagerFromFunction(voidfunc(Container c) {
    bg.setBounds(0, 0, c.getWidth(), c.getHeight());
  }));
  //desktop.add(setBounds(100, 400, 300, 200, jInternalFrame("Hello!")));
  cleanExitOnFrameClose(showFullScreen(desktop));
  focus(tf);
  hideConsole();
}

svoid go { callStaticAnswerMethod(getText(tf)); }

answer {
  if "show me a window" {
    JInternalFrame frame; 
    desktop.add(setBounds(random(100, desktop.getWidth()-100-300), 400, 300, 200, frame = jInternalFrame("Here it is.")));
    frame.moveToFront();
  }
}

Author comment

Began life as a copy of #1009940

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1009944
Snippet name: lalala 5 [OK]
Eternal ID of this version: #1009944/10
Text MD5: a10808e660bd46473dc26b5bd4dfded7
Transpilation MD5: 2543758537a1629d9f75194aab989a2d
Author: stefan
Category: javax / a.i.
Type: JavaX source code (desktop)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-08-27 03:40:05
Source code size: 1026 bytes / 35 lines
Pitched / IR pitched: No / No
Views / Downloads: 630 / 1384
Version history: 9 change(s)
Referenced in: [show references]