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

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

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

JButton.putClientProperty介绍

暂无

代码示例

代码示例来源:origin: kiegroup/optaplanner

public static JButton makeSmallButton(JButton button) {
  button.setMargin(new Insets(0, 0, 0, 0));
  button.putClientProperty("Nimbus.Overrides", smallButtonUIDefaults);
  return button;
}

代码示例来源:origin: stanfordnlp/CoreNLP

highlightButton = makeColorButton("Pick a new highlight color: ",
                 Preferences.getHighlightColor(), prefPanel);
highlightButton.putClientProperty("JButton.buttonType","icon");
displayOptions.add(highlightLabel);
displayOptions.add(highlightButton);

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

button.setToolTipText(navigationButton.getTooltip());
button.setIcon(new ImageIcon(scaledImage));
button.putClientProperty(SubstanceSynapse.FLAT_LOOK, Boolean.TRUE);
button.setFocusable(false);
button.addActionListener(e ->

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

public DataControl(String nodePath, Port port) {
  super(nodePath, port);
  setLayout(new BoxLayout(this, BoxLayout.LINE_AXIS));
  clearDataButton = new JButton("Clear");
  clearDataButton.setMargin(new Insets(1, 0, 0, 0));
  clearDataButton.putClientProperty("JButton.buttonType", "textured");
  clearDataButton.putClientProperty("JComponent.sizeVariant", "small");
  clearDataButton.setFont(Theme.SMALL_BOLD_FONT);
  clearDataButton.setForeground(Theme.TEXT_NORMAL_COLOR);
  clearDataButton.addActionListener(this);
  add(clearDataButton);
  /*showDataButton = new JButton("Show Data...");
  showDataButton.setMargin(new Insets(1, 0, 0, 0));
  showDataButton.putClientProperty("JButton.buttonType", "textured");
  showDataButton.putClientProperty("JComponent.sizeVariant", "small");
  showDataButton.setFont(Theme.SMALL_BOLD_FONT);
  showDataButton.setForeground(Theme.TEXT_NORMAL_COLOR);
  showDataButton.addActionListener(this);
  add(showDataButton);*/
  add(Box.createHorizontalGlue());
}

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

public FileControl(String nodePath, Port port) {
  super(nodePath, port);
  setLayout(new FlowLayout(FlowLayout.LEADING, 0, 0));
  fileField = new JTextField();
  fileField.putClientProperty("JComponent.sizeVariant", "small");
  fileField.setPreferredSize(new Dimension(150, 19));
  fileField.setEditable(false);
  fileField.setFont(Theme.SMALL_BOLD_FONT);
  chooseButton = new JButton("...");
  chooseButton.putClientProperty("JButton.buttonType", "gradient");
  chooseButton.setPreferredSize(new Dimension(30, 27));
  chooseButton.addActionListener(this);
  add(fileField);
  add(chooseButton);
  setValueForControl(port.getValue());
}

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

public TextControl(String nodePath, Port port) {
  super(nodePath, port);
  setLayout(new BorderLayout(0, 0));
  textField = new JTextField();
  textField.putClientProperty("JComponent.sizeVariant", "small");
  textField.setFont(Theme.SMALL_BOLD_FONT);
  textField.addActionListener(this);
  externalWindowButton = new JButton("...");
  externalWindowButton.putClientProperty("JComponent.sizeVariant", "small");
  externalWindowButton.putClientProperty("JButton.buttonType", "gradient");
  externalWindowButton.setFont(Theme.SMALL_BOLD_FONT);
  externalWindowButton.addActionListener(this);
  add(textField, BorderLayout.CENTER);
  add(externalWindowButton, BorderLayout.EAST);
  setValueForControl(port.getValue());
}

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

filePanel.add(fileField);
JButton chooseButton = new JButton("...");
chooseButton.putClientProperty("JButton.buttonType", "gradient");
chooseButton.setPreferredSize(new Dimension(30, 27));
chooseButton.addActionListener(this);

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

directoryPanel.add(directoryField);
JButton chooseButton = new JButton("...");
chooseButton.putClientProperty("JButton.buttonType", "gradient");
chooseButton.setPreferredSize(new Dimension(30, 27));
chooseButton.addActionListener(this);

代码示例来源:origin: edu.toronto.cs.medsavant/medsavant-component-fields

private void updateButtonPositions() {
  if (rejectChangesButton.isVisible() && acceptChangesButton.isVisible()) {
    rejectChangesButton.putClientProperty("JButton.segmentPosition", "first");
    acceptChangesButton.putClientProperty("JButton.segmentPosition", "last");
  } else {
    rejectChangesButton.putClientProperty("JButton.segmentPosition", "only");
    acceptChangesButton.putClientProperty("JButton.segmentPosition", "only");
  }
}

代码示例来源:origin: edu.toronto.cs.medsavant/medsavant-client

public static JButton getTexturedButton(String s) {
  JButton button = new JButton(s);
  button.setFocusable(false);
  button.putClientProperty("JButton.buttonType", "textured");
  return button;
}

代码示例来源:origin: edu.toronto.cs.medsavant/medsavant-client

public static JButton getSoftButton(String string) {
  JButton b = new JButton(string);
  //b.putClientProperty("JButton.buttonType", "segmentedRoundRect");
  //b.putClientProperty("JButton.segmentPosition", "only");
  b.setFocusable(false);
  b.putClientProperty("JComponent.sizeVariant", "small");
  return b;
}

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

JButton org = null;
for (int i = 0; i < combo.getComponentCount(); i++) {
  if (combo.getComponent(i) instanceof JButton) {
    org = (JButton) combo.getComponent(i);
    UIDefaults buttonDefaults = new UIDefaults();
    buttonDefaults.put("ComboBox:\"ComboBox.arrowButton\"[Enabled].foregroundPainter", painter);
    org.putClientProperty("Nimbus.Overrides.InheritDefaults", false);
    org.putClientProperty("Nimbus.Overrides", buttonDefaults);
    break;
  }
}

代码示例来源:origin: com.jtattoo/JTattoo

protected void setActive(boolean flag) {
  if (getWindowDecorationStyle() == BaseRootPaneUI.FRAME) {
    Boolean active = flag ? Boolean.TRUE : Boolean.FALSE;
    iconifyButton.putClientProperty(PAINT_ACTIVE, active);
    closeButton.putClientProperty(PAINT_ACTIVE, active);
    maxButton.putClientProperty(PAINT_ACTIVE, active);
  }
  getRootPane().repaint();
}

代码示例来源:origin: edu.toronto.cs.medsavant/medsavant-client

public static JButton getTexturedButton(ImageIcon icon) {
  JButton button = new JButton(icon);
  ViewUtil.makeSmall(button);
  button.setFocusable(false);
  button.putClientProperty("JButton.buttonType", "textured");
  return button;
}

代码示例来源:origin: jsettlers/settlers-remake

private void initButtonPanel() {
  buttonPanel.setLayout(new GridLayout(0, 1, 20, 20));
  mainButtonPanel.setLayout(new BorderLayout());
  mainButtonPanel.add(buttonPanel, BorderLayout.NORTH);
  JButton btExit = new JButton(Labels.getString("main-panel-exit-button"));
  btExit.addActionListener(e -> settlersFrame.exit());
  btExit.putClientProperty(ELFStyle.KEY, ELFStyle.BUTTON_MENU);
  mainButtonPanel.add(btExit, BorderLayout.SOUTH);
  add(mainButtonPanel);
  add(emptyPanel);
  getTitleLabel().setVisible(false);
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-terminal-nb

private JButton adjustButton(JButton b) {
  b.setBorderPainted(false);
  b.setOpaque(false);
  b.setText(null);
  b.putClientProperty("hideActionText", Boolean.TRUE);	// NOI18N
  // NOI18N
  return b;
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/napkinlaf

public static JButton createArrowButton(int pointTowards, int size) {
  Icon arrow = NapkinIconFactory.createArrowIcon(pointTowards, size);
  JButton button = new JButton(arrow);
  button.setBorderPainted(false);
  Dimension dim = new Dimension(size + 3, size + 3);
  button.setPreferredSize(dim);
  button.setMinimumSize(dim);
  button.putClientProperty(NO_ROLLOVER_KEY, Boolean.TRUE);
  return button;
}

代码示例来源:origin: org.java.net.substance/substance

/**
 * Configures the straight side of the arrow button.
 */
protected void configureArrowButtonStraightSide() {
  this.arrowButton.putClientProperty(
      SubstanceLookAndFeel.BUTTON_SIDE_PROPERTY, this.comboBox
          .getComponentOrientation().isLeftToRight() ? Side.LEFT
          : Side.RIGHT);
}

代码示例来源:origin: org.opentcs.thirdparty.jhotdraw/jhotdraw

public void setDisclosureStateCount(int newValue) {
  int oldValue = getDisclosureStateCount();
  disclosureButton.putClientProperty(DisclosureIcon.STATE_COUNT_PROPERTY, newValue);
  firePropertyChange(DISCLOSURE_STATE_COUNT_PROPERTY, oldValue, newValue);
}

代码示例来源:origin: com.github.insubstantial/substance-swingx

private void configurePopupButton() {
  Side side = this.datePicker.getComponentOrientation().isLeftToRight() ? Side.LEFT
      : Side.RIGHT;
  this.substancePopupButton.putClientProperty(
      SubstanceLookAndFeel.BUTTON_SIDE_PROPERTY, side);
  // this.substancePopupButton.putClientProperty(
  // SubstanceLookAndFeel.BUTTON_OPEN_SIDE_PROPERTY, side);
  // this.substancePopupButton.putClientProperty(
  // SubstanceLookAndFeel.FLAT_PROPERTY, Boolean.TRUE);
  this.substancePopupButton.setRolloverEnabled(true);
}

相关文章

JButton类方法