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

18
LINES

< > BotCompany Repo | #1003285 - withTitle (Swing)

JavaX fragment (include)

static JComponent withTitle(String title, Component c) {
  ret withTitle(withTitle_titlePanel(title), c);
}

static JComponent withTitle_titlePanel(String title) {
  ret jlabel(title);
}

static JPanel withTitle(final JComponent titleComponent, final Component c) {
  ret swing(func -> JPanel {
    titleComponent.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, UIManager.getColor("Button.borderColor")));
    JPanel panel = new JPanel(new BorderLayout());
    panel.setBackground(Color.WHITE);
    panel.add(BorderLayout.NORTH, titleComponent);
    panel.add(BorderLayout.CENTER, wrap(c));
    return panel;
  });
}

download  show line numbers  debug dex   

Travelled to 11 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz

No comments. add comment

Snippet ID: #1003285
Snippet name: withTitle (Swing)
Eternal ID of this version: #1003285/2
Text MD5: e7daf019a40e5bb1d08f8c45910d9f56
Author: stefan
Category: javax / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-09-04 00:32:43
Source code size: 641 bytes / 18 lines
Pitched / IR pitched: No / No
Views / Downloads: 422 / 567
Version history: 1 change(s)
Referenced in: [show references]

Formerly at http://tinybrain.de/1003285 & http://1003285.tinybrain.de