本文整理了Java中javax.swing.JButton.setHorizontalAlignment()
方法的一些代码示例,展示了JButton.setHorizontalAlignment()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JButton.setHorizontalAlignment()
方法的具体详情如下:
包路径:javax.swing.JButton
类名称:JButton
方法名:setHorizontalAlignment
暂无
代码示例来源:origin: kiegroup/optaplanner
private JButton createExampleButton(final CommonApp commonApp) {
String iconResource = commonApp.getIconResource();
Icon icon = iconResource == null ? new EmptyIcon() : new ImageIcon(getClass().getResource(iconResource));
JButton button = new JButton(new AbstractAction(commonApp.getName(), icon) {
@Override
public void actionPerformed(ActionEvent e) {
commonApp.init(OptaPlannerExamplesApp.this, false);
}
});
button.setHorizontalAlignment(JButton.LEFT);
button.setHorizontalTextPosition(JButton.RIGHT);
button.setVerticalTextPosition(JButton.CENTER);
button.addMouseListener(new MouseAdapter() {
@Override
public void mouseEntered(MouseEvent e) {
descriptionTextArea.setText(commonApp.getDescription());
}
@Override
public void mouseExited(MouseEvent e) {
descriptionTextArea.setText("");
}
});
return button;
}
代码示例来源:origin: redwarp/9-Patch-Resizer
this.xhdpiButton.setVerticalTextPosition(SwingConstants.BOTTOM);
this.xhdpiButton.setHorizontalTextPosition(SwingConstants.CENTER);
this.xhdpiButton.setHorizontalAlignment(SwingConstants.CENTER);
this.xhdpiButton.setIcon(this.blueArrow);
this.xhdpiButton.setSelectedIcon(this.redArrow);
代码示例来源:origin: marytts/marytts
jButton_Record.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
jButton_Record.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
jButton_Record.setMaximumSize(new java.awt.Dimension(95, 25));
jButton_Play.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
jButton_Play.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
jButton_Play.setMaximumSize(new java.awt.Dimension(95, 25));
代码示例来源:origin: marytts/marytts
jButton_Record.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
jButton_Record.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
jButton_Record.setMaximumSize(new java.awt.Dimension(95, 25));
jButton_Play.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
jButton_Play.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
jButton_Play.setMaximumSize(new java.awt.Dimension(95, 25));
代码示例来源:origin: fossasia/neurolab-desktop
button.setHorizontalAlignment(JButton.LEFT);
代码示例来源:origin: ron190/jsql-injection
labelIsCheckingUpdate.setHorizontalAlignment(SwingConstants.LEFT);
labelIsCheckingUpdate.setBorderPainted(false);
labelIsCheckingUpdate.setContentAreaFilled(false);
labelIsReportingBugs.setHorizontalAlignment(SwingConstants.LEFT);
labelIsReportingBugs.setBorderPainted(false);
labelIsReportingBugs.setContentAreaFilled(false);
labelIsEvading.setHorizontalAlignment(SwingConstants.LEFT);
labelIsEvading.setBorderPainted(false);
labelIsEvading.setContentAreaFilled(false);
labelIsFollowingRedirection.setHorizontalAlignment(SwingConstants.LEFT);
labelIsFollowingRedirection.setBorderPainted(false);
labelIsFollowingRedirection.setContentAreaFilled(false);
labelTestConnection.setHorizontalAlignment(SwingConstants.LEFT);
labelTestConnection.setBorderPainted(false);
labelTestConnection.setContentAreaFilled(false);
labelParseForm.setHorizontalAlignment(SwingConstants.LEFT);
labelParseForm.setBorderPainted(false);
labelParseForm.setContentAreaFilled(false);
buttonIsUsingProxy.setHorizontalAlignment(SwingConstants.LEFT);
buttonIsUsingProxy.setBorderPainted(false);
buttonIsUsingProxy.setContentAreaFilled(false);
buttonIsUsingProxyHttps.setHorizontalAlignment(SwingConstants.LEFT);
代码示例来源:origin: magefree/mage
jButtonFooterNext.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
jButtonFooterNext.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
jButtonFooterNext.setOpaque(false);
代码示例来源:origin: freeplane/freeplane
protected JButton addAction(final JComponent arrowLinkPopup, Action action) {
JButton comp = new JButton(action);
comp.setHorizontalAlignment(JButton.LEFT);
addPopupComponent (arrowLinkPopup, null, comp);
return comp;
}
代码示例来源:origin: stackoverflow.com
private JButton makeJButton(String label, String toolTip, Color bgColor, final Color highlight) {
JButton button = new JButton(label);
button.setToolTipText(toolTip);
button.setBackground(bgColor);
button.setHorizontalAlignment(JButton.CENTER);
button.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
Highlighter.shadeSymmetric(currentCell, highlight);
}
});
return button;
}
代码示例来源:origin: freeplane/freeplane
public ScriptComboBoxEditor() {
showEditorBtn = new JButton();
script = "";
setButtonText();
showEditorBtn.setHorizontalAlignment(SwingConstants.LEFT);
showEditorBtn.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
editScript(false);
}
});
actionListeners = new LinkedList<ActionListener>();
minimumSize = new Dimension(600, 400);
bounds = null;
}
代码示例来源:origin: org.gdl-lang.gdl-tools/openehr-utils-gui-swing
private JButton getAcceptButton() {
if (acceptButton == null) {
acceptButton = new JButton();
acceptButton.setText(OpenEHRLanguageManager.getMessage("Accept"));
acceptButton.setIcon(OpenEHRImageUtil.ACCEPT_ICON);
acceptButton.setEnabled(true);
acceptButton.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
acceptButton.addActionListener(getAcceptChangesAction());
}
return acceptButton;
}
代码示例来源:origin: org.gdl-lang.gdl-tools/openehr-utils-gui-swing
protected JButton getAcceptButton() {
if (acceptButton == null) {
acceptButton = new JButton();
acceptButton.setText(OpenEHRLanguageManager.getMessage("Accept"));
acceptButton.setIcon(OpenEHRImageUtil.ACCEPT_ICON);
acceptButton.setEnabled(true);
acceptButton.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
acceptButton.addActionListener(getAcceptChangesAction());
}
return acceptButton;
}
代码示例来源:origin: org.gdl-lang.gdl-tools/cds-gui-swing
private JButton getAcceptButton() {
if (acceptButton == null) {
acceptButton = new JButton();
acceptButton.setText(OpenEHRLanguageManager.getMessage("Accept"));
acceptButton.setIcon(OpenEHRImageUtil.ACCEPT_ICON);
acceptButton.setEnabled(true);
acceptButton.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
acceptButton.addActionListener(getAcceptChangesAction());
}
return acceptButton;
}
代码示例来源:origin: org.gdl-lang.gdl-tools/openehr-utils-gui-swing
private JButton getAcceptButton() {
if (acceptButton == null) {
acceptButton = new JButton();
acceptButton.setText(OpenEHRLanguageManager.getMessage("Accept"));
acceptButton.setIcon(OpenEHRImageUtil.ACCEPT_ICON);
acceptButton.setEnabled(true);
acceptButton.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
acceptButton.addActionListener(getAcceptChangesAction());
}
return acceptButton;
}
代码示例来源:origin: freeplane/freeplane
private void addUriWithoutTitle(Box box, String uriProperty) {
try {
final String urlText = ResourceController.getResourceController().getProperty(uriProperty);
URI uri = new URI(urlText);
JButton uriButton = UITools.createHtmlLinkStyleButton(uri, urlText);
uriButton.setHorizontalAlignment(SwingConstants.LEADING);
box.add(uriButton);
} catch (URISyntaxException e1) {
}
}
代码示例来源:origin: jpos/jPOS
public JComponent create (UI ui, Element e) {
JButton button = new JButton (e.getText());
button.setHorizontalAlignment(JLabel.CENTER);
button.setBorder(new EmptyBorder(3, 3, 3, 3));
String font = e.getAttributeValue ("font");
if (font != null)
button.setFont (Font.decode (font));
return button;
}
}
代码示例来源:origin: freeplane/freeplane
private void addUri(Box box, String uriProperty, String message) {
try {
URI uri;
uri = new URI( ResourceController.getResourceController().getProperty(uriProperty));
JButton uriButton = UITools.createHtmlLinkStyleButton(uri, message);
uriButton.setAlignmentX(Component.LEFT_ALIGNMENT);
uriButton.setHorizontalAlignment(SwingConstants.LEADING);
box.add(uriButton);
} catch (URISyntaxException e1) {
}
}
}
代码示例来源:origin: Exslims/MercuryTrade
private JButton getOperationButton(String title, String iconPath) {
JButton button = this.componentsFactory.getButton(title);
button.setPreferredSize(new Dimension(210, 35));
button.setForeground(AppThemeColor.TEXT_DEFAULT);
button.setHorizontalAlignment(SwingConstants.LEFT);
button.setBackground(AppThemeColor.ADR_BG);
button.setFont(this.componentsFactory.getFont(FontStyle.BOLD, 16f));
button.setIcon(this.componentsFactory.getIcon(iconPath, 22));
button.setBorder(BorderFactory.createCompoundBorder(
BorderFactory.createMatteBorder(1, 1, 1, 1, AppThemeColor.ADR_PANEL_BORDER),
BorderFactory.createEmptyBorder(2, 10, 2, 2)));
return button;
}
代码示例来源:origin: lbalazscs/Pixelitor
private static JButton createLinkButton() {
JButton linkButton = new JButton("<HTML><FONT color=\"#000099\"><U>" + HOME_PAGE + "</U></FONT></HTML>");
linkButton.setHorizontalAlignment(SwingConstants.CENTER);
linkButton.setBorderPainted(false);
linkButton.setFocusPainted(false);
linkButton.setOpaque(false);
linkButton.setBackground(box.getBackground());
linkButton.setAlignmentX(Component.CENTER_ALIGNMENT);
linkButton.addActionListener(new OpenInBrowserAction(null, HOME_PAGE));
return linkButton;
}
代码示例来源:origin: freeplane/freeplane
private JButton addStyleButton(DefaultFormBuilder formBuilder, String label, AFreeplaneAction action) {
final JButton button = new JButton(){
private static final long serialVersionUID = 1L;
{
setUI(BasicButtonUI.createUI(this));
}
};
button.addActionListener(action);
button.setHorizontalAlignment(SwingConstants.LEFT);
final String labelText = TextUtils.getText(label);
UITools.addTitledBorder(button, labelText, StyleEditorPanel.FONT_SIZE);
TranslatedElement.BORDER.setKey(button, label);
formBuilder.append(button, formBuilder.getColumnCount());
formBuilder.nextLine();
return button;
}
内容来源于网络,如有侵权,请联系作者删除!