当前位置: 首页>>代码示例>>Java>>正文


Java AbstractButton.isSelected方法代码示例

本文整理汇总了Java中javax.swing.AbstractButton.isSelected方法的典型用法代码示例。如果您正苦于以下问题:Java AbstractButton.isSelected方法的具体用法?Java AbstractButton.isSelected怎么用?Java AbstractButton.isSelected使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.swing.AbstractButton的用法示例。


在下文中一共展示了AbstractButton.isSelected方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: removeButtonContentAreaAndBorder

import javax.swing.AbstractButton; //导入方法依赖的package包/类
private static void removeButtonContentAreaAndBorder(AbstractButton button) {
    boolean canRemove = true;
    if (button instanceof JToggleButton) {
        canRemove = !button.isSelected();
    }
    if (canRemove) {
        button.setContentAreaFilled(false);
        button.setBorderPainted(false);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:11,代码来源:SearchButton.java

示例2: getDefaultComponent

import javax.swing.AbstractButton; //导入方法依赖的package包/类
public Component getDefaultComponent(Container aContainer) {
    Component c = getFirstComponent(aContainer);
    
    if (c instanceof AbstractButton) {
        ButtonModel bm = ((AbstractButton)c).getModel();
        if (bm instanceof DefaultButtonModel) {
            ButtonGroup bg = ((DefaultButtonModel)bm).getGroup();
            Enumeration<AbstractButton> en = bg == null ? null : bg.getElements();
            while (en != null && en.hasMoreElements()) {
                AbstractButton ab = en.nextElement();
                if (ab.isSelected()) return ab;
            }
        }
    }
    
    return c;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:18,代码来源:ProfilerPopup.java

示例3: getSelectedButtonText

import javax.swing.AbstractButton; //导入方法依赖的package包/类
String getSelectedButtonText(ButtonGroup buttonGroup) {
	    for (Enumeration buttons = buttonGroup.getElements(); buttons.hasMoreElements();) {
	        AbstractButton button = (AbstractButton) buttons.nextElement();

	        if (button.isSelected()) {
	            return button.getText();
	        }
	    }
	    return null;
}
 
开发者ID:srilekhadasari,项目名称:online-quiz-application-in-java-with-jdbc-using-swing-login-registration-timer,代码行数:11,代码来源:Questions.java

示例4: refresh

import javax.swing.AbstractButton; //导入方法依赖的package包/类
private void refresh(final AbstractButton b) {
    b.setBackground(UIUtils.getProfilerResultsBackground());
    boolean hovered = Boolean.TRUE.equals(b.getClientProperty(PROP_HOVERED));
    boolean filled = b.isEnabled() && (hovered || b.isSelected() || b.isFocusOwner());
    b.setOpaque(filled);
    b.setContentAreaFilled(filled);
    b.repaint();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:9,代码来源:TransparentToolBar.java

示例5: getSelected

import javax.swing.AbstractButton; //导入方法依赖的package包/类
public JRadioButton getSelected() {
    Enumeration<AbstractButton> en = radioGroup.getElements();
    while (en.hasMoreElements()) {
        AbstractButton b = en.nextElement();
        if (b.isSelected()) {
            return (JRadioButton)b;
        }
    }
    throw new IllegalStateException();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:11,代码来源:AvailableProvidersPanel.java

示例6: isSelectionEmpty

import javax.swing.AbstractButton; //导入方法依赖的package包/类
@Override
public boolean isSelectionEmpty()
{
	for( AbstractButton button : choices.keySet() )
	{
		if( button.isSelected() )
		{
			return false;
		}
	}
	return true;
}
 
开发者ID:equella,项目名称:Equella,代码行数:13,代码来源:RadioButtonChoiceList.java

示例7: itemStateChanged

import javax.swing.AbstractButton; //导入方法依赖的package包/类
@Override
public void itemStateChanged(ItemEvent e)
{
	AbstractButton button = (AbstractButton) e.getSource();
	if( button.isSelected() )
	{
		choiceSelected(button);
	}
	else
	{
		choiceDeselected(button);
	}
}
 
开发者ID:equella,项目名称:Equella,代码行数:14,代码来源:RadioButtonChoiceList.java

示例8: getSelectedButtonText

import javax.swing.AbstractButton; //导入方法依赖的package包/类
/**
 * Determines the label of the current selected button.
 * @param buttonGroup
 * @return The text label of the selected button.
 */
public static String getSelectedButtonText(ButtonGroup buttonGroup) {
    for (Enumeration<AbstractButton> buttons = buttonGroup.getElements(); buttons.hasMoreElements();) {
        AbstractButton button = buttons.nextElement();

        if (button.isSelected()) {
            return button.getText();
        }
    }

    return null;
}
 
开发者ID:LEB-EPFL,项目名称:SASS,代码行数:17,代码来源:ButtonGroupUtils.java

示例9: getSelectedButton

import javax.swing.AbstractButton; //导入方法依赖的package包/类
private String getSelectedButton(ButtonGroup bGroup) {
    for (Enumeration<AbstractButton> buttons = bGroup.getElements(); buttons.hasMoreElements();) {
        AbstractButton button = buttons.nextElement();
        if (button.isSelected()) {
            return button.getText();
        }
    }
    return "None";
}
 
开发者ID:CognizantQAHub,项目名称:Cognizant-Intelligent-Test-Scripter,代码行数:10,代码来源:CognizantITSSettings.java

示例10: isEnabledAndSelected

import javax.swing.AbstractButton; //导入方法依赖的package包/类
@Override
protected boolean isEnabledAndSelected(AbstractButton button)
{
	return button.isEnabled() && button.isSelected();
}
 
开发者ID:equella,项目名称:Equella,代码行数:6,代码来源:RadioButtonChoiceList.java

示例11: mousePressed

import javax.swing.AbstractButton; //导入方法依赖的package包/类
public void mousePressed( MouseEvent evt ) {
	dragWindow = false;
	dragMap = false;
	if( evt.isControlDown() ) {
		return;
	} 

	Rectangle r = map.getVisibleRect();
	if (rect == null) return;

	r.x += x;
	r.y += y;
	r.width = this.w;
	r.height = this.h;
	if( r.contains( evt.getPoint() ) ) {
		evt.consume();
		AbstractButton b = map.getMapTools().profileB;
		profileEnabled = b.isSelected();
		if (profileEnabled) b.doClick();

		dragWindow = true;
		lastPoint = evt.getPoint();
		r.x+=rect.x;
		r.y+=rect.y;
		r.width=(int)rect.width;
		r.height=(int)rect.height;
		if (r.contains(evt.getPoint())){
			dragMap=true;
			dragWindow = false;
			drawRect();
		} else if (rect.x+rect.width>this.w){
			r.x-=this.w;
			if (r.contains(evt.getPoint())) {
				rect.x-=this.w;
				dragMap=true;
				dragWindow = false;
				drawRect();
			}
		}
		else 
			drawBox();
	}
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:44,代码来源:LocationInset.java


注:本文中的javax.swing.AbstractButton.isSelected方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。