Example usage for javax.swing JToolBar revalidate

List of usage examples for javax.swing JToolBar revalidate

Introduction

In this page you can find the example usage for javax.swing JToolBar revalidate.

Prototype

public void revalidate() 

Source Link

Document

Supports deferred automatic layout.

Usage

From source file:Main.java

/**
 * Turns on display of text in all child buttons within the
 * {@link JToolBar}./*from  w w w .j a v  a2 s  .  c  o  m*/
 * 
 * @param toolBar
 * @param show
 */
public static void showText(JToolBar toolBar, boolean show) {
    for (Component comp : toolBar.getComponents()) {
        if (comp instanceof AbstractButton) {
            ((AbstractButton) comp).putClientProperty("hideActionText", Boolean.valueOf(show));
        }
    }
    toolBar.revalidate();
}