Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

boolean checkbox swing

boolean isSelected = jCheckBox.isSelected();

if(isSelected ){
   jCheckBox.setSelected(false);
} else {
   jCheckBox.setSelected(true);
}
Comment

boolean checkbox swing

static class BooleanRenderer extends JCheckBox implements TableCellRenderer, UIResource
{
    private static final Border noFocusBorder = new EmptyBorder(1, 1, 1, 1);

    public BooleanRenderer() {
        super();
        setHorizontalAlignment(JLabel.CENTER);
        setBorderPainted(true);
    }

    public Component getTableCellRendererComponent(JTable table, Object value,
                                                   boolean isSelected, boolean hasFocus, int row, int column) {
        if (isSelected) {
            setForeground(table.getSelectionForeground());
            super.setBackground(table.getSelectionBackground());
        }
        else {
            setForeground(table.getForeground());
            setBackground(table.getBackground());
        }
        setSelected((value != null && ((Boolean)value).booleanValue()));

        if (hasFocus) {
            setBorder(UIManager.getBorder("Table.focusCellHighlightBorder"));
        } else {
            setBorder(noFocusBorder);
        }

        return this;
    }
}
Comment

PREVIOUS NEXT
Code Example
Java :: byte array in java 
Java :: initialize an arraylist in java in java 
Java :: Java comment vérifier une égalité de String 
Java :: exception in java 
Java :: jframe calculator 
Java :: Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8 
Java :: java use parent method 
Java :: kotlin edittext default value 
Java :: java string split underscore 
Java :: java swing on close 
Java :: how to get string value in java in android 
Java :: scaletype android dynamic 
Java :: is c# similar to java 
Java :: Create Java Strings using the new keyword 
Java :: insert in arraylist 
Java :: Java void Keyword 
Java :: java static keyword 
Java :: how to print array in one line in java 
Java :: java and or precedence 
Java :: lcm of two number in java 
Java :: Java Nested and Inner Class 
Java :: switch expression java 
Java :: Java Enum compareTo() 
Java :: basics of java 
Java :: convert character arraylist to array 
Java :: advantages of using java 
Java :: how to encrypt password in properties file in spring boot 
Java :: java mahout get clusters centers 
Java :: convert code from kotlin to java 
Java :: android tab theme 
ADD CONTENT
Topic
Content
Source link
Name
4+4 =