Example usage for javax.swing JCheckBox setOpaque

List of usage examples for javax.swing JCheckBox setOpaque

Introduction

In this page you can find the example usage for javax.swing JCheckBox setOpaque.

Prototype

@BeanProperty(expert = true, description = "The component's opacity")
public void setOpaque(boolean isOpaque) 

Source Link

Document

If true the component paints every pixel within its bounds.

Usage

From source file:storybook.model.EntityUtil.java

public static List<JCheckBox> createItemCheckBoxes(MainFrame m, ActionListener comp) {
    List<JCheckBox> list = new ArrayList<>();
    BookModel model = m.getBookModel();/*  w w w  . ja  va  2  s.  c o  m*/
    Session session = model.beginTransaction();
    ItemDAOImpl dao = new ItemDAOImpl(session);
    List<Item> items = dao.findAll();
    for (Item item : items) {
        JCheckBox cbItem = new JCheckBox(item.getName());
        cbItem.setOpaque(false);
        cbItem.putClientProperty(SbConstants.ComponentName.CB_ITEM, item);
        cbItem.addActionListener(comp);
        list.add(cbItem);
    }
    model.commit();
    return list;
}