Java JComponent Properties disposeParentWindow(JComponent component)

Here you can find the source of disposeParentWindow(JComponent component)

Description

dispose Parent Window

License

Open Source License

Declaration

public static void disposeParentWindow(JComponent component) 

Method Source Code


//package com.java2s;
/*/*from  w  w w.j  a v a2s  .  c  om*/
(C) 2007 Stefan Reich (jazz@drjava.de)
This source file is part of Project Prophecy.
For up-to-date information, see http://www.drjava.de/prophecy
    
This source file is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation, version 2.1.
*/

import javax.swing.*;

import java.awt.*;

public class Main {
    public static void disposeParentWindow(JComponent component) {
        Window window = SwingUtilities.windowForComponent(component);
        if (window != null)
            window.dispose();
    }
}

Related

  1. buildComponentPanel(JComponent component, int hgap, int vgap, boolean isOpaque)
  2. buildComponentPanelRight(JComponent component, int hgap, int vgap, boolean isOpaque)
  3. disableAll(JComponent component)
  4. doDisable(JComponent component)
  5. getProperties(JComponent component)
  6. getProperties(JComponent component)
  7. getProperties(JComponent component)