javax.swing.JButton.setAlignmentX()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(6.5k)|赞(0)|评价(0)|浏览(219)

本文整理了Java中javax.swing.JButton.setAlignmentX()方法的一些代码示例,展示了JButton.setAlignmentX()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JButton.setAlignmentX()方法的具体详情如下:
包路径:javax.swing.JButton
类名称:JButton
方法名:setAlignmentX

JButton.setAlignmentX介绍

暂无

代码示例

代码示例来源:origin: stackoverflow.com

JButton button1 = new JButton("OK");
 button1.setEnabled(false);
 button1.setAlignmentX(-1);
 JButton button2 = new JButton("Apply");
 button1.setEnabled(false);
 button1.setAlignmentX(-1);

代码示例来源:origin: stackoverflow.com

JButton button_ok = makeButton("OK", false, -1);
JButton button_apply = makeButton("Apply", true, 1);
// what exactly is being set here?

...

// much later:
private static JButton makeButton(String name, boolean enabled,
    int alignment)
{
  JButton button = new JButton(name);
  button.setEnabled(enabled);
  button.setAlignmentX(alignment);
  return button;
}

代码示例来源:origin: skylot/jadx

close.setAlignmentX(0.5f);

代码示例来源:origin: skylot/jadx

close.setAlignmentX(0.5f);

代码示例来源:origin: log4j/log4j

newButton.setAlignmentX(0.5f);

代码示例来源:origin: marytts/marytts

zoomPanel.add(Box.createVerticalGlue());
JButton zoomIn = new JButton("Zoom In");
zoomIn.setAlignmentX(CENTER_ALIGNMENT);
zoomIn.addActionListener(new ActionListener() {
  public void actionPerformed(ActionEvent evt) {
zoomPanel.add(zoomIn);
JButton zoomOut = new JButton("Zoom Out");
zoomOut.setAlignmentX(CENTER_ALIGNMENT);
zoomOut.addActionListener(new ActionListener() {
  public void actionPerformed(ActionEvent evt) {

代码示例来源:origin: marytts/marytts

zoomPanel.add(Box.createVerticalGlue());
JButton zoomIn = new JButton("Zoom In");
zoomIn.setAlignmentX(CENTER_ALIGNMENT);
zoomIn.addActionListener(new ActionListener() {
  public void actionPerformed(ActionEvent evt) {
zoomPanel.add(zoomIn);
JButton zoomOut = new JButton("Zoom Out");
zoomOut.setAlignmentX(CENTER_ALIGNMENT);
zoomOut.addActionListener(new ActionListener() {
  public void actionPerformed(ActionEvent evt) {

代码示例来源:origin: magefree/mage

searchButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/search_24.png")));
searchButton.setToolTipText("Search and select from list");
searchButton.setAlignmentX(1.0F);
searchButton.setMinimumSize(new java.awt.Dimension(24, 24));
searchButton.setPreferredSize(new java.awt.Dimension(32, 32));

代码示例来源:origin: jbox2d/jbox2d

pauseButton.setAlignmentX(CENTER_ALIGNMENT);
stepButton.setAlignmentX(CENTER_ALIGNMENT);
resetButton.setAlignmentX(CENTER_ALIGNMENT);
saveButton.setAlignmentX(CENTER_ALIGNMENT);
loadButton.setAlignmentX(CENTER_ALIGNMENT);
quitButton.setAlignmentX(CENTER_ALIGNMENT);

代码示例来源:origin: magefree/mage

pnlRandomPacks.add(txtRandomPacks);
JButton btnSelectRandomPacks = new JButton();
btnSelectRandomPacks.setAlignmentX(Component.LEFT_ALIGNMENT);
btnSelectRandomPacks.setText("Select packs to be included in the pool");
btnSelectRandomPacks.setToolTipText(RandomPacksSelectorDialog.randomDraftDescription);

代码示例来源:origin: magefree/mage

buttonStop.setAlignmentX(0.5F);
buttonStop.setPreferredSize(new java.awt.Dimension(65, 30));
buttonStop.addActionListener(new java.awt.event.ActionListener() {
buttonSearchSet.setAlignmentX(1.0F);
buttonSearchSet.setPreferredSize(new java.awt.Dimension(25, 25));
buttonSearchSet.addActionListener(new java.awt.event.ActionListener() {

代码示例来源:origin: magefree/mage

btnSetFastSearch.setAlignmentX(1.0F);
btnSetFastSearch.setPreferredSize(new java.awt.Dimension(23, 23));
btnSetFastSearch.addActionListener(new java.awt.event.ActionListener() {

代码示例来源:origin: magefree/mage

btn.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/search_32.png")));
btn.setToolTipText(FastSearchUtil.DEFAULT_EXPANSION_TOOLTIP_MESSAGE);
btn.setAlignmentX(1.0F);
btn.setPreferredSize(new java.awt.Dimension(32, 32));
btn.addActionListener(new java.awt.event.ActionListener() {

代码示例来源:origin: magefree/mage

btnFlagSearch.setAlignmentX(1.0F);
btnFlagSearch.setPreferredSize(new java.awt.Dimension(23, 23));
btnFlagSearch.addActionListener(new java.awt.event.ActionListener() {

代码示例来源:origin: magefree/mage

buttonsPanel.setLayout(boxlayout);
btnExit = new javax.swing.JButton();
btnExit.setAlignmentX(Component.LEFT_ALIGNMENT);
buttonsPanel.add(btnExit);
btnSetFastSearch.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/search_24.png")));
btnSetFastSearch.setToolTipText(FastSearchUtil.DEFAULT_EXPANSION_TOOLTIP_MESSAGE);
btnSetFastSearch.setAlignmentX(1.0F);
btnSetFastSearch.setMinimumSize(new java.awt.Dimension(24, 24));
btnSetFastSearch.setPreferredSize(new java.awt.Dimension(32, 32));

代码示例来源:origin: magefree/mage

btnExpansionSearch.setAlignmentX(1.0F);
btnExpansionSearch.setFocusable(false);
btnExpansionSearch.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);

代码示例来源:origin: stackoverflow.com

JPanel panel = new JPanel();
panel.setLayout(new BoxLayout());

JButton button = new JButton("Button1");
button.setAlignmentX(Component.CENTER_ALIGNMENT);
panel.add(button);

button = new JButton("Button2");
button.setAlignmentX(Component.CENTER_ALIGNMENT);
panel.add(button);

button = new JButton("Button3");
button.setAlignmentX(Component.CENTER_ALIGNMENT);
panel.add(button);

add(panel);

代码示例来源:origin: freeplane/freeplane

private JButton createSelectNodesButton() {
  JButton btnHighlightSlideContent = createButtonWithIcon("SelectSlideContent.icon", "slide.select.tooltip");
  btnHighlightSlideContent.setAlignmentX(Component.CENTER_ALIGNMENT);
  btnHighlightSlideContent.addActionListener(new ActionListener() {
    @Override
    public void actionPerformed(ActionEvent e) {
      slide.replaceCurrentSelection();
    }
  });
  return btnHighlightSlideContent;
}
private JToggleButton createSetFoldingStateToggleButton() {

代码示例来源:origin: freeplane/freeplane

private JButton createSetSelectedNodeButton() {
  JButton btnSetSelectedNode = createButtonWithIcon("SetSlideContent.icon", "slide.set.tooltip");
  btnSetSelectedNode.setAlignmentX(Component.CENTER_ALIGNMENT);
  btnSetSelectedNode.addActionListener(new ActionListener() {
    @Override
    public void actionPerformed(ActionEvent e) {
      final List<String> selection = Controller.getCurrentController().getSelection().getOrderedSelectionIds();
      UndoableSlide.of(slide).setSelectedNodeIds(new LinkedHashSet<>(selection));
    }
  });
  return btnSetSelectedNode;
}

代码示例来源: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) {
    }
  }
}

相关文章

微信公众号

最新文章

更多

JButton类方法