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

14
LINES

< > BotCompany Repo | #1016623 // enableWordWrapForTextArea

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (2896L/17K).

static JTextArea enableWordWrapForTextArea(JTextArea ta) {
  ret enableWordWrapForTextArea(ta, true);
}

static JTextArea enableWordWrapForTextArea(JTextArea ta, bool enabled) {
  if (ta != null) swing {
    ta.setLineWrap(enabled);
    ta.setWrapStyleWord(true);
    // Haven't found a way to reliable enable word-wrapping for
    // an already visible text area
    //revalidate(enclosingScrollPane(ta));
  }
  ret ta;
}

Author comment

Began life as a copy of #1008025

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1016623
Snippet name: enableWordWrapForTextArea
Eternal ID of this version: #1016623/7
Text MD5: 5c797868d9ddf83e7ffce14a9f3fce06
Transpilation MD5: ca1f8ef857ad8aa8d1cb219108829648
Author: stefan
Category: javax / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-01-14 17:22:28
Source code size: 435 bytes / 14 lines
Pitched / IR pitched: No / No
Views / Downloads: 557 / 662
Version history: 6 change(s)
Referenced in: [show references]