當前位置: 首頁>>代碼示例>>Java>>正文


Java JButton.setIconTextGap方法代碼示例

本文整理匯總了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);
}
 
開發者ID:equella,項目名稱:Equella,代碼行數:9,代碼來源:ManagementDialog.java

示例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();
		}
	});
}
 
開發者ID:transwarpio,項目名稱:rapidminer,代碼行數:19,代碼來源:ColorValueCellEditor.java

示例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;
}
 
開發者ID:equella,項目名稱:Equella,代碼行數:14,代碼來源:AdminToolList.java

示例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();
}
 
開發者ID:equella,項目名稱:Equella,代碼行數:49,代碼來源:AdminToolList.java


注:本文中的javax.swing.JButton.setIconTextGap方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。