Example usage for javax.swing JComponent updateUI

List of usage examples for javax.swing JComponent updateUI

Introduction

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

Prototype

public void updateUI() 

Source Link

Document

Resets the UI property to a value from the current look and feel.

Usage

From source file:plugin.notes.gui.JIcon.java

/**  Delete the file from disk that this icon represents */
private void deleteFile() {
    int choice = JOptionPane.showConfirmDialog(GMGenSystem.inst, "Delete file " + launch.getPath(),
            "Delete File?", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);

    if (choice == JOptionPane.YES_OPTION) {
        try {//from  w w w  . j  ava2 s  . co m
            launch.delete();

            Container cnt = getParent();
            cnt.remove(this);

            if (cnt instanceof JComponent) {
                JComponent comp = (JComponent) cnt;
                comp.updateUI();
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}