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

20
LINES

< > BotCompany Repo | #1000920 // JLabel with HTML content

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

Libraryless. Click here for Pure Java version (40L/1K/2K).

!747
!multi-line strings

m {
  static S html = [[
    <html><b>Bold</b> and <i>italic</i>.</html>
  ]];
  
  p {
    makeFrame(new JLabel(html.trim())); // trim is important!
  }
  
  static void makeFrame(Component content) {
    JFrame frame = new JFrame("JavaX");
    frame.getContentPane().add(content);
    frame.setBounds(300, 100, 500, 400);
    frame.setVisible(true);
    exitOnFrameClose(frame);
  }
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1000920
Snippet name: JLabel with HTML content
Eternal ID of this version: #1000920/1
Text MD5: 280c090bcebd41148efc83c46cfbdccb
Transpilation MD5: b4bc9eb822996be0c6f2f50bf4d36b64
Author: stefan
Category: javax
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2015-09-09 17:03:50
Source code size: 431 bytes / 20 lines
Pitched / IR pitched: No / Yes
Views / Downloads: 657 / 673
Referenced in: [show references]