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

21
LINES

< > BotCompany Repo | #1005943 // RightAlignedLine

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

Transpiled version (5599L) is out of date.

static class RightAlignedLine extends JPanel {
  *(int spacing, Component... components) {
    this(components);
    setSpacing(spacing);
  }
    
  *(Component... components) {
    setLayout(LetterLayout.rightAlignedRow());
    for (Component component : components)
      if (component != null)
        add(component);
  }
  
  void setSpacing(int spacing) {
    ((LetterLayout) getLayout()).setSpacing(spacing, spacing);
  }

  public void add(String text) {
    add(new JLabel(text));
  }
}

Author comment

Began life as a copy of #1004150

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1005943
Snippet name: RightAlignedLine
Eternal ID of this version: #1005943/4
Text MD5: 3a9c1a37b608e3dac3d875b4d6a2ac36
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-03-17 18:28:24
Source code size: 514 bytes / 21 lines
Pitched / IR pitched: No / No
Views / Downloads: 498 / 2070
Version history: 3 change(s)
Referenced in: [show references]