javax.swing.AbstractButton.invalidate()方法的使用及代码示例

x33g5p2x  于2022-01-15 转载在 其他  
字(1.6k)|赞(0)|评价(0)|浏览(98)

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

AbstractButton.invalidate介绍

暂无

代码示例

代码示例来源:origin: com.jidesoft/jide-oss

@Override
public void propertyChange(PropertyChangeEvent e) {
  super.propertyChange(e);
  String prop = e.getPropertyName();
  if (JideButton.BUTTON_STYLE_PROPERTY.equals(prop)
      || "opaque".equals(prop)
      || AbstractButton.CONTENT_AREA_FILLED_CHANGED_PROPERTY.equals(prop)
      ) {
    AbstractButton b = (AbstractButton) e.getSource();
    b.repaint();
  }
  else if (JideButton.PROPERTY_ORIENTATION.equals(prop)
      || "hideActionText".equals(prop)) {
    AbstractButton b = (AbstractButton) e.getSource();
    b.invalidate();
    b.repaint();
  }
  else if ("verticalTextPosition".equals(prop)
      || "horizontalTextPosition".equals(prop)) {
    AbstractButton b = (AbstractButton) e.getSource();
    b.updateUI();
  }
}

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

/**
  * Description of the Method
  *
  * @param e  Description of Parameter
  */
 public void propertyChange(PropertyChangeEvent e) {
  String propertyName = e.getPropertyName();
  if (e.getPropertyName().equals(Action.NAME)) {
   String text = (String) e.getNewValue();
   button.setText(text);
   button.repaint();
  }
  else if (propertyName.equals("enabled")) {
   Boolean enabledState = (Boolean) e.getNewValue();
   button.setEnabled(enabledState.booleanValue());
   button.repaint();
  }
  else if (e.getPropertyName().equals(Action.SMALL_ICON)) {
   Icon icon = (Icon) e.getNewValue();
   button.setIcon(icon);
   button.invalidate();
   button.repaint();
  }
 }
}

相关文章

微信公众号

最新文章

更多

AbstractButton类方法