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

38
LINES

< > BotCompany Repo | #1011957 // Jexer Dual Mode Test (text mode/AWT)

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

Download Jar. Uses 615K of libraries. Click here for Pure Java version (2714L/19K).

!7

lib 1012119

import jexer.*;
import jexer.backend.SwingBackend;

sclass MyApplication extends TApplication {
  *() throws UnsupportedEncodingException {
    super(isHeadless() ? BackendType.XTERM : BackendType.SWING);
    
    if (getBackend() instanceof SwingBackend)
      ((SwingBackend) getBackend()).setFont(loadFont(#1012116));

    // Create standard menus for File and Window
    addFileMenu();
    addWindowMenu();
    new MyWindow(this);
  }
}

sclass MyWindow extends TWindow {
  *(TApplication application) {
    super(application, "My Window", 30, 20);

    addLabel("This is a label", 5, 3);
    addField(5, 5, 20, false, "enter text here");
    addButton("Press &Me!", 5, 8, new TAction() {
      public void DO() {
        MyWindow.this.messageBox("Box Title", "You pressed me, yay!");
      }
    });
  }
}

p {
  startThread(new MyApplication);
}

Author comment

Began life as a copy of #1011956

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1011957
Snippet name: Jexer Dual Mode Test (text mode/AWT)
Eternal ID of this version: #1011957/7
Text MD5: 964dc166ef0d14caad1bb92077d9848d
Transpilation MD5: c491662025ab4931b94ea2201c946399
Author: stefan
Category:
Type: JavaX source code (desktop)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-06-24 04:35:17
Source code size: 905 bytes / 38 lines
Pitched / IR pitched: No / No
Views / Downloads: 358 / 833
Version history: 6 change(s)
Referenced in: [show references]