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

30
LINES

< > BotCompany Repo | #1001106 // showText function

JavaX fragment (include)

// Note: very SLOW with big text (JTextArea)
// Use showText_fast_noWrap instead

static JTextArea showText(fS title, O text) {
  ret showText(null, title, text);
}

static JTextArea showText(JTextArea ta, fS title, O text) {
  fS _text = str(text);
  if (ta != null)
    ret activateFrameAndReturnComponent(setFrameTitle(title, setText(ta, _text)));
    
  ret swing(func -> JTextArea {
    JTextArea textArea = newTypeWriterTextArea(_text);
    makeFrame(title, new JScrollPane(textArea));
    ret textArea;
  });
}

static JTextArea showText(O text) {
  ret showText(str(text));
}

static JTextArea showText(S text) {
  ret showText(autoFrameTitle(), text);
}

static JTextArea showText() {
  ret showText("");
}

download  show line numbers  debug dex  old transpilations   

Travelled to 20 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, dpqxeycirhfy, gwrvuhgaqvyk, ishqpsrjomds, lnbujpyubztb, lpdgvwnxivlt, mowyntqkapby, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt, whxojlpjdney, xrpafgyirdlv, yanjaxplzisb

No comments. add comment

Snippet ID: #1001106
Snippet name: showText function
Eternal ID of this version: #1001106/8
Text MD5: e244e6d89e97fa8262000113828f7236
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-08-28 14:03:47
Source code size: 744 bytes / 30 lines
Pitched / IR pitched: No / No
Views / Downloads: 729 / 1171
Version history: 7 change(s)
Referenced in: #1001142 - showText_fontSize function
#1002427 - Accellerating 629 (SPIKE)
#1005286 - showWrappedText function
#1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1012344 - showTextArea - synonym of showText
#1024212 - showText_fast_noWrap - use JFastLogView_noWrap
#1034600 - showLines
#3000382 - Answer for ferdie (>> t = 1, f = 0)