Example usage for java.awt Container invalidate

List of usage examples for java.awt Container invalidate

Introduction

In this page you can find the example usage for java.awt Container invalidate.

Prototype

@Override
public void invalidate() 

Source Link

Document

Invalidates the container.

Usage

From source file:org.adempiere.apps.graph.PerformanceIndicator.java

/**
 *    Action Listener.//from  w w w  .ja v a2  s .  c  o  m
 *    Update Display
 *   @param e event
 */
public void actionPerformed(ActionEvent e) {
    if (e.getSource() == mRefresh) {
        m_goal.updateGoal(true);
        updateDisplay();
        //
        Container parent = getParent();
        if (parent != null)
            parent.invalidate();
        invalidate();
        if (parent != null)
            parent.repaint();
        else
            repaint();
    }
}

From source file:pt.lsts.neptus.plugins.sunfish.awareness.SituationAwareness.java

@Override
public void setActive(boolean mode, StateRenderer2D source) {
    super.setActive(mode, source);
    Container parent = source.getParent();
    while (parent != null && !(parent.getLayout() instanceof BorderLayout))
        parent = parent.getParent();/*from   w w  w  . java2 s . c om*/
    if (mode) {
        JPanel panel = new JPanel(new BorderLayout());
        panel.add(slider, BorderLayout.CENTER);
        panel.add(minTimeLabel, BorderLayout.WEST);
        panel.add(maxTimeLabel, BorderLayout.EAST);
        parent.add(panel, BorderLayout.SOUTH);
    } else {
        parent = slider.getParent().getParent();
        parent.remove(slider.getParent());
    }
    parent.invalidate();
    parent.validate();
    parent.repaint();

}