Example usage for javax.swing JComponent invalidate

List of usage examples for javax.swing JComponent invalidate

Introduction

In this page you can find the example usage for javax.swing JComponent invalidate.

Prototype

@Override
public void invalidate() 

Source Link

Document

Invalidates the container.

Usage

From source file:Main.java

/**
 * Repaints UI tree recursively.//from w w w.  j  ava  2  s.co  m
 *
 * @param c UI component.
 */
private static void updateComponentTreeUI0(Component c) {
    if (c instanceof JComponent) {
        JComponent jc = (JComponent) c;
        jc.invalidate();
        jc.validate();
        jc.repaint();
        JPopupMenu jpm = jc.getComponentPopupMenu();
        if (jpm != null && jpm.isVisible() && jpm.getInvoker() == jc) {
            updateComponentTreeUI(jpm);
        }
    }
    Component[] children = null;
    if (c instanceof JMenu) {
        children = ((JMenu) c).getMenuComponents();
    } else if (c instanceof java.awt.Container) {
        children = ((java.awt.Container) c).getComponents();
    }
    if (children != null) {
        for (int i = 0; i < children.length; i++)
            updateComponentTreeUI0(children[i]);
    }
}

From source file:cool.pandora.modeller.ui.jpanel.base.BagInfoForm.java

private JComponent createFormFields() {
    final BagTableFormBuilder formBuilder = new BagTableFormBuilder(getBindingFactory());
    formBuilder.row();//www .java  2 s . c  om
    if (fieldMap != null && !fieldMap.isEmpty()) {
        createFormFieldsFromMap(formBuilder);//TODO
    }
    final JComponent fieldForm = formBuilder.getForm();
    fieldForm.invalidate();
    return fieldForm;
}