1 package com
.intellij
.openapi
.ui
;
3 import org
.jetbrains
.annotations
.Nullable
;
6 import javax
.swing
.border
.EmptyBorder
;
9 public class CheckBoxWithDescription
extends JPanel
{
11 private JCheckBox myCheckBox
;
13 public CheckBoxWithDescription(JCheckBox box
, @Nullable String description
) {
16 setLayout(new BorderLayout());
17 add(myCheckBox
, BorderLayout
.NORTH
);
19 if (description
!= null) {
20 final int iconSize
= box
.getPreferredSize().height
;
22 final DescriptionLabel desc
= new DescriptionLabel(description
);
23 desc
.setBorder(new EmptyBorder(0, iconSize
+ UIManager
.getInt("CheckBox.textIconGap"), 0, 0));
24 add(desc
, BorderLayout
.CENTER
);
28 public JCheckBox
getCheckBox() {