Java Code Examples for javax.swing.JCheckBox#setFocusable()

The following examples show how to use javax.swing.JCheckBox#setFocusable() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CompletionScrollPane.java    From netbeans with Apache License 2.0 6 votes vote down vote up
public CompletionScrollPane(JTextComponent editorComponent, MouseListener mouseListener) {
    
    setHorizontalScrollBarPolicy(HORIZONTAL_SCROLLBAR_NEVER);
    setVerticalScrollBarPolicy(VERTICAL_SCROLLBAR_AS_NEEDED);
    
    // Use maximumSize property to store the limit of the preferred size
    setMaximumSize(new Dimension(400, 300));
    // At least 2 items; do -1 for title height
    int maxVisibleRowCount = Math.max(2,
        getMaximumSize().height / CompletionLayout.COMPLETION_ITEM_HEIGHT - 1);

    // Add the completion view
    view = new JPanel();
    JCheckBox checkbox = new JCheckBox("Rename comments");
    checkbox.setFocusable(false);
    view.add(checkbox);
    JCheckBox checkbox1 = new JCheckBox("Rename Test Class");
    checkbox1.setFocusable(false);
    view.add(checkbox1);
    setViewportView(view);
    installKeybindings(editorComponent);
}