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

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

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

AbstractButton.setModel介绍

暂无

代码示例

代码示例来源:origin: nroduit/Weasis

@Override
public boolean registerActionState(Object c) {
  if (super.registerActionState(c)) {
    if (c instanceof AbstractButton) {
      ((AbstractButton) c).setModel(model);
    }
    return true;
  }
  return false;
}

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

AbstractButton checkBox = new JCheckBox(myAction);
AbstractButton toggleBtn = new JToggleButton(myAction);
toggleBtn.setModel(checkBox.getModel());

代码示例来源:origin: net.sf.sfac/sfac-core

+ act.getValue(TOOLBAR_GROUP) + "'");
  but = new JToggleButton(act);
  but.setModel(butModel);
} else {
  if (log.isDebugEnabled()) log.debug("Create radio button for action '" + act.getValue(Action.NAME) + "', group='"
      + act.getValue(TOOLBAR_GROUP) + "'");
  but = new JRadioButton(act);
  but.setModel(butModel);
  butGroup.add(but);

代码示例来源:origin: com.mchange/mchange-commons-java

public static void bind(AbstractButton[] buttons, Object[] elements, Object bean, String setPropName) throws IntrospectionException
{
for (int i = 0, len = buttons.length; i < len; ++i)
  {
  AbstractButton doMe = buttons[i];
  doMe.setModel( new SetPropertyElementBoundButtonModel( doMe.getModel(), bean, setPropName, elements[i] ) );
  }
}

代码示例来源:origin: net.sf.tinylaf/tinylaf

TinyComboBoxButton() {
  super("");
  
  DefaultButtonModel model = new DefaultButtonModel() {
    public void setArmed(boolean armed) {
      super.setArmed(isPressed() ? true : armed);
    }
  };
  
  setModel(model);
  
  // Set the background and foreground to the combobox colors.
  setBackground(UIManager.getColor("ComboBox.background"));
  setForeground(UIManager.getColor("ComboBox.foreground"));
  
  if(focusImg == null) {
    ImageIcon icon = TinyLookAndFeel.loadIcon("ComboBoxFocus.png");
    
    if(icon != null) {
      focusImg = new BufferedImage(2, 2, BufferedImage.TYPE_INT_RGB);
      Graphics g = focusImg.getGraphics();
      icon.paintIcon(this, g, 0, 0);
    }
  }
}

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

comboBox.setSelectedIndex(0);
setLayout(new FlowLayout());
setModel(new JToggleButton.ToggleButtonModel());
add(this.beforeText);
add(this.comboBox);

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

public RadioButton() { super(); setModel(new RadioButtonModel()); }
public RadioButton(Action action) { super(action); setModel(new RadioButtonModel()); }
public RadioButton(Icon icon) { super(icon); setModel(new RadioButtonModel()); }
public RadioButton(String text) { super(text); setModel(new RadioButtonModel()); }
public RadioButton(Icon icon, boolean selected) { super(icon, selected); setModel(new RadioButtonModel()); }
public RadioButton(String text, boolean selected) { super(text, selected); setModel(new RadioButtonModel()); }
public RadioButton(String text, Icon icon) { super(text, icon); setModel(new RadioButtonModel()); }
public RadioButton(String text, Icon icon, boolean selected) { super(text, icon, selected); setModel(new RadioButtonModel()); }

代码示例来源:origin: org.xworker/xworker_core

public static void createButtonModels(ActionContext actionContext){
    Thing self = (Thing) actionContext.get("self");
    AbstractButton parent = (AbstractButton) actionContext.get("parent");
    for(Thing child : self.getChilds()){
      ButtonModel model = (ButtonModel) child.doAction("create", actionContext);
      if(model != null){
        parent.setModel(model);
      }
    }
  }
}

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

choice1.setModel(new ReadOnlyToggleButtonModel(true));
choice1.setFocusable(false);
choice2.setModel(new ReadOnlyToggleButtonModel(false));
choice2.setFocusable(false);

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

checkBox.setModel( new JToggleButton.ToggleButtonModel(){
 @Override
 public void setSelected( boolean b ) {

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

btn.setModel(new StickyModel());
btn.setIcon(new ImageIcon(ImageIO.read(getClass().getResource("/Blank.png"))));
btn.setSelectedIcon(new ImageIcon(ImageIO.read(getClass().getResource("/Bomb.png"))));

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

myCheckBox.setModel(buttonModel);

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

checkBox.setModel( groupModel );

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

setModel(model);
setState(initial);

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

JButton normal = createButton("Normal", Color.RED);
JButton fixed = createButton("Fixed", Color.BLUE);
fixed.setModel(new FixedStateButtonModel());
setLayout(new GridLayout(1, 0));
add(normal);

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

setModel(new DefaultButtonModel());
createPaths();

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

JComponent box = Box.createVerticalBox();
JCheckBox button = new JCheckBox(disablingItem.getText());
button.setModel(disablingItem.getModel());
box.add(Box.createGlue());
box.add(button);
box.add(Box.createGlue());
JRadioButton blur = new JRadioButton(blurItem.getText());
blur.setModel(blurItem.getModel());
box.add(blur);
JRadioButton emboss = new JRadioButton(embossItem.getText());
emboss.setModel(embossItem.getModel());
box.add(emboss);
JRadioButton translucent = new JRadioButton(busyPainterItem.getText());
translucent.setModel(busyPainterItem.getModel());
box.add(translucent);
box.add(Box.createGlue());

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

setModel(new DefaultButtonModel());
MouseHandler mh = new MouseHandler();
addMouseListener(mh);

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

setModel(model);
setState(initial);

相关文章

微信公众号

最新文章

更多

AbstractButton类方法