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

1  
!7
2  
3  
static IVar<S> text;
4  
static JTextField tf;
5  
static JDesktopPane desktop;
6  
7  
p-awt {
8  
  text = persistentVar("Text", "Show me a window!");
9  
  
10  
  tf = jcenteredtextfield(text!);
11  
  onUpdate(tf, r { text.set(getText(tf)) });
12  
  onEnter(tf, f go);
13  
  desktop = jTiledBackgroundDesktopPane(#1009931);
14  
  final JPanel bg = jtransparent_recursive(
15  
    jfullcenter(withBottomMargin(550, jMinWidth(400,
16  
      setFontSize(30, tf)))));
17  
  desktop.add(bg);
18  
  desktop.setLayout(layoutManagerFromFunction(voidfunc(Container c) {
19  
    bg.setBounds(0, 0, c.getWidth(), c.getHeight());
20  
  }));
21  
  //desktop.add(setBounds(100, 400, 300, 200, jInternalFrame("Hello!")));
22  
  cleanExitOnFrameClose(showFullScreen(desktop));
23  
  focus(tf);
24  
  hideConsole();
25  
}
26  
27  
svoid go { callStaticAnswerMethod(getText(tf)); }
28  
29  
answer {
30  
  if "show me a window" {
31  
    JInternalFrame frame; 
32  
    desktop.add(setBounds(random(100, desktop.getWidth()-100-300), 400, 300, 200, frame = jInternalFrame("Here it is.")));
33  
    frame.moveToFront();
34  
  }
35  
}

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: 631 / 1385
Version history: 9 change(s)
Referenced in: [show references]