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

27
LINES

< > BotCompany Repo | #1009955 // Fancy Control Frame

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

Download Jar. Libraryless. Click here for Pure Java version (9576L/65K).

1  
!7
2  
3  
sS background = #1009946;
4  
static IVar<S> text;
5  
static JTextField tf;
6  
static JDesktopPane desktop;
7  
8  
p-nimbus-noconsole {
9  
  text = persistentVar("Text", "Show me a window!");
10  
  
11  
  onEnter(tf = bindTextFieldToVar(text, jcenteredtextfield(text!)), f go);
12  
  desktop = jTiledBackgroundDesktopPane(background);
13  
  autoFixDesktopPane(desktop);
14  
  addFullSizeComponent(desktop, jtransparent_recursive(jTopCenter(hstackWithSpacing(withTopMargin(60,
15  
    hstackWithSpacing(jMinWidth(400, setFontSize(30, tf)),
16  
      jbutton("OK", f go)/*,
17  
      jbutton("Exit", f cleanKill)*/))))));
18  
  cleanExitOnFrameClose(showMaximizedFrame(desktop));
19  
  focus(tf);
20  
}
21  
22  
svoid go { callStaticAnswerMethod(getText(tf)); }
23  
24  
answer {
25  
  if "show me a window"
26  
    addInternalFrame(desktop, "Here it is.", random(100, desktop.getWidth()-100-300), 400, 300, 200);
27  
}

Author comment

Began life as a copy of #1009950

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1009955
Snippet name: Fancy Control Frame
Eternal ID of this version: #1009955/5
Text MD5: 7772f1595eb00e2e4d2bbfb83a74d646
Transpilation MD5: 1e23a7f53c9d8c07a480293d0d70650e
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-09-10 18:55:07
Source code size: 856 bytes / 27 lines
Pitched / IR pitched: No / No
Views / Downloads: 621 / 1341
Version history: 4 change(s)
Referenced in: [show references]