Example usage for javax.swing AbstractButton setIgnoreRepaint

List of usage examples for javax.swing AbstractButton setIgnoreRepaint

Introduction

In this page you can find the example usage for javax.swing AbstractButton setIgnoreRepaint.

Prototype

public void setIgnoreRepaint(boolean ignoreRepaint) 

Source Link

Document

Sets whether or not paint messages received from the operating system should be ignored.

Usage

From source file:SoundManagerTest.java

/**
 * Creates a button (either JButton or JToggleButton).
 */// w ww  .  ja  v a 2s. c  om
public AbstractButton createButton(String name, boolean canToggle) {
    AbstractButton button;

    if (canToggle) {
        button = new JToggleButton(name);
    } else {
        button = new JButton(name);
    }
    button.addActionListener(this);
    button.setIgnoreRepaint(true);
    button.setFocusable(false);

    return button;
}