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


Java JCheckBox.setOpaque方法代码示例

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


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

示例1: initializeComponents

import javax.swing.JCheckBox; //导入方法依赖的package包/类
private void initializeComponents() {
	qualitySlider = new JSlider(10, 100, 50) {
		private static final long serialVersionUID = -3633632766184431178L;

		@Override
		public Dimension getPreferredSize() {
			return new Dimension(super.getPreferredSize().width/2, new JLabel(" ").getPreferredSize().height);
		}
	};
	qualitySlider.addChangeListener(ce -> r.refresh());
	
	qualitySlider.setOpaque(false);
	statusLabel = new JLabel();
	skipFrames = new JCheckBox("Skip frames", false);
	skipFrames.setOpaque(false);
}
 
开发者ID:CalebKussmaul,项目名称:GIFKR,代码行数:17,代码来源:PreviewStatusPanel.java

示例2: ShowNextTime

import javax.swing.JCheckBox; //导入方法依赖的package包/类
/** Creates a new instance of RecentProjects */
public ShowNextTime() {
    super( new BorderLayout() );
    setOpaque(false);

    button = new JCheckBox( BundleSupport.getLabel( "ShowOnStartup" ) ); // NOI18N
    button.setSelected( WelcomeOptions.getDefault().isShowOnStartup() );
    button.setOpaque( false );
    button.setForeground( Color.white );
    button.setHorizontalTextPosition( SwingConstants.LEFT );
    BundleSupport.setAccessibilityProperties( button, "ShowOnStartup" ); //NOI18N
    add( button, BorderLayout.CENTER );
    button.addActionListener( this );
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:15,代码来源:ShowNextTime.java

示例3: createCheckBox

import javax.swing.JCheckBox; //导入方法依赖的package包/类
final JCheckBox createCheckBox() {
    JCheckBox cb = new JCheckBox();
    cb.setSize(cb.getPreferredSize());
    cb.setBorderPainted(false);
    cb.setOpaque(false);
    return cb;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:8,代码来源:DefaultOutlineCellRenderer.java

示例4: createRestartNotificationDetails

import javax.swing.JCheckBox; //导入方法依赖的package包/类
private JComponent createRestartNotificationDetails() {
    JPanel res = new JPanel( new BorderLayout( 10, 10) );
    res.setOpaque( false );
    JLabel lbl = new JLabel( NbBundle.getMessage( LafPanel.class, "Descr_Restart") ); //NOI18N
    lbl.setCursor( Cursor.getPredefinedCursor( Cursor.HAND_CURSOR ) );
    res.add( lbl, BorderLayout.CENTER );
    final JCheckBox checkEditorColors = new JCheckBox( NbBundle.getMessage( LafPanel.class, "Hint_ChangeEditorColors" ) ); //NOI18N
    if( isChangeEditorColorsPossible() ) {
        checkEditorColors.setSelected( true );
        checkEditorColors.setOpaque( false );
        res.add( checkEditorColors, BorderLayout.SOUTH );
    }
    lbl.addMouseListener( new MouseAdapter() {
        @Override
        public void mouseClicked( MouseEvent e ) {
            if( null != restartNotification ) {
                restartNotification.clear();
                restartNotification = null;
            }
            if( checkEditorColors.isSelected() ) {
                switchEditorColorsProfile();
            }
            LifecycleManager.getDefault().markForRestart();
            LifecycleManager.getDefault().exit();
        }
    });
    return res;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:29,代码来源:LafPanel.java

示例5: createComponent

import javax.swing.JCheckBox; //导入方法依赖的package包/类
private JCheckBox createComponent(JTable table, Object value,
        boolean isSelected, boolean hasFocus, int row, int column) {
    EclipseProject project = projects[row];
    JCheckBox chb = new JCheckBox();
    chb.setSelected(selectedProjects.contains(project) ||
            requiredProjects.contains(project));
    chb.setToolTipText(null);
    if (project.isImportSupported() && !requiredProjects.contains(project)) {
        chb.setEnabled(true);
    } else {
        // required and non-java project are disabled
        chb.setEnabled(false);
        if (!project.isImportSupported()) {
            chb.setToolTipText(ProjectImporterWizard.getMessage(
                    "MSG_NonJavaProject", project.getName())); // NOI18N
        }
    }
    if (isSelected) {
        chb.setOpaque(true);
        chb.setForeground(table.getSelectionForeground());
        chb.setBackground(table.getSelectionBackground());
    } else {
        chb.setOpaque(false);
        chb.setForeground(table.getForeground());
        chb.setBackground(table.getBackground());
    }
    return chb;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:29,代码来源:ProjectSelectionPanel.java

示例6: getTableCellRendererComponent

import javax.swing.JCheckBox; //导入方法依赖的package包/类
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
	
	JCheckBox checkBox = new JCheckBox();
	checkBox.setSelected((Boolean) value);
	checkBox.setHorizontalAlignment(SwingConstants.CENTER);
	checkBox.setOpaque(true);
	GraphGlobals.Colors.setTableCellRendererColors(checkBox, row, isSelected);
	return checkBox;
}
 
开发者ID:EnFlexIT,项目名称:AgentWorkbench,代码行数:10,代码来源:TableCellRenderer4CheckBox.java

示例7: setElements

import javax.swing.JCheckBox; //导入方法依赖的package包/类
public void setElements(Collection<T> elems, boolean selectedByDefault)
{
	mapping.clear();
	removeAll();

	for( T elem : elems )
	{
		JCheckBox checkBox = new JCheckBox(elementToString(elem), selectedByDefault);
		checkBox.setOpaque(false);

		mapping.put(checkBox, elem);
		add(checkBox);
	}
}
 
开发者ID:equella,项目名称:Equella,代码行数:15,代码来源:CheckboxList.java

示例8: createJCheckBoxForTable

import javax.swing.JCheckBox; //导入方法依赖的package包/类
/**
 * It creates a new check box for inclusion in a table and sets 
 * its "is selected" attribute to the given value.
 * 
 * @param selected It determines whether the newly-created check box
 * will be selected or not.
 * @return A new check box for inclusion in a table.
 */
static public JCheckBox createJCheckBoxForTable(boolean selected) {
    JCheckBox checkBox = new JCheckBox();
    checkBox.setOpaque(true);
    checkBox.setHorizontalAlignment(SwingConstants.CENTER);
    checkBox.setForeground(TABLE_COMPONENT_FG_COLOR);
    checkBox.setBackground(TABLE_COMPONENT_BG_COLOR);
    checkBox.setSelected(selected);
    return checkBox;
}
 
开发者ID:vimerzhao,项目名称:gchisto,代码行数:18,代码来源:GUIUtilities.java

示例9: createAndShowGUI

import javax.swing.JCheckBox; //导入方法依赖的package包/类
private static void createAndShowGUI() {
    demoFrame = new JFrame();
    demoFrame.setSize(300, 300);
    demoFrame.setLayout(new FlowLayout());
    demoFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    demoFrame.setUndecorated(true);
    demoFrame.setBackground(new Color(0f, 0, 0, 0.1f));
    JCheckBox b = new JCheckBox("Whatever");
    demoFrame.paintAll(null);
    b.setOpaque(true);
    demoFrame.add(b);
    demoFrame.add(new JButton());
    demoFrame.setVisible(true);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:15,代码来源:ComponentResizeTest.java

示例10: BooleanCellRenderer

import javax.swing.JCheckBox; //导入方法依赖的package包/类
public BooleanCellRenderer() {
    super();
    cb = new JCheckBox();
    cb.setOpaque(true);
    cb.setHorizontalAlignment(0);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:7,代码来源:ResultSetCellRenderer.java

示例11: BooleanTableCellEditor

import javax.swing.JCheckBox; //导入方法依赖的package包/类
public BooleanTableCellEditor(JCheckBox cb) {
    super(cb);
    cb.setOpaque(true);
    cb.setHorizontalAlignment(0);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:6,代码来源:BooleanTableCellEditor.java


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