本文整理汇总了Java中javax.swing.JButton.setIconTextGap方法的典型用法代码示例。如果您正苦于以下问题:Java JButton.setIconTextGap方法的具体用法?Java JButton.setIconTextGap怎么用?Java JButton.setIconTextGap使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.JButton
的用法示例。
在下文中一共展示了JButton.setIconTextGap方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setupButton
import javax.swing.JButton; //导入方法依赖的package包/类
private void setupButton(JButton button)
{
applyFlatterLaF(button);
button.setBorderPainted(false);
button.setIconTextGap(10);
button.addActionListener(this);
}
示例2: ColorValueCellEditor
import javax.swing.JButton; //导入方法依赖的package包/类
public ColorValueCellEditor(final ParameterTypeColor type) {
this.type = type;
button = new JButton("Choose Color...");
button.setToolTipText(type.getDescription());
button.setIconTextGap(6);
button.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
Color newColor = JColorChooser.showDialog(RapidMinerGUI.getMainFrame(), "Choose Color for " + type.getKey(),
((ColorIcon) button.getIcon()).getColor());
if (newColor != null) {
setEditorColor(newColor);
}
fireEditingStopped();
}
});
}
示例3: createButtons
import javax.swing.JButton; //导入方法依赖的package包/类
protected List<JButton> createButtons()
{
List<JButton> buttons = new ArrayList<JButton>();
for( TLEAction action : actions )
{
JButton button = new JHoverButton(action);
button.setBorderPainted(false);
button.setIconTextGap(5);
buttons.add(button);
}
return buttons;
}
示例4: setup
import javax.swing.JButton; //导入方法依赖的package包/类
@Override
public void setup(Set<String> grantedPrivileges, String name)
{
getButtonActions(actions);
listFilled = false;
model = new GenericListModel<NameValue>();
list = new JList<>(model);
list.addMouseListener(new ListDoubleClickListener(list, editAction));
list.addMouseListener(new ListPopupListener(list, actions));
list.addListSelectionListener(new ListSelectionListener()
{
@Override
public void valueChanged(ListSelectionEvent e)
{
updateButtons();
}
});
JScrollPane scroll = new JScrollPane(list);
JLabel heading = new JLabel(name);
heading.setHorizontalAlignment(SwingConstants.CENTER);
heading.setHorizontalTextPosition(SwingConstants.CENTER);
JButton refreshButton = new JTextlessButton(refreshAction);
refreshButton.setBorderPainted(false);
refreshButton.setIconTextGap(0);
refreshButton.setBorder(null);
JComponent buttonsComp = createButtonsPanel();
final int width1 = refreshButton.getPreferredSize().width;
final int height1 = refreshButton.getPreferredSize().height;
final int height2 = buttonsComp.getPreferredSize().height;
final int[] rows = {5, height1, 5, TableLayout.FILL, 5, height2,};
final int[] cols = {width1, TableLayout.FILL, width1, 5};
everything = new JPanel(new TableLayout(rows, cols, 0, 0));
everything.add(heading, new Rectangle(1, 1, 1, 1));
everything.add(refreshButton, new Rectangle(2, 1, 1, 1));
everything.add(scroll, new Rectangle(0, 3, 3, 1));
everything.add(buttonsComp, new Rectangle(0, 5, 3, 1));
updateButtons();
}