本文整理汇总了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);
}
示例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 );
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
}
示例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;
}
示例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);
}
示例10: BooleanCellRenderer
import javax.swing.JCheckBox; //导入方法依赖的package包/类
public BooleanCellRenderer() {
super();
cb = new JCheckBox();
cb.setOpaque(true);
cb.setHorizontalAlignment(0);
}
示例11: BooleanTableCellEditor
import javax.swing.JCheckBox; //导入方法依赖的package包/类
public BooleanTableCellEditor(JCheckBox cb) {
super(cb);
cb.setOpaque(true);
cb.setHorizontalAlignment(0);
}