Mega Code Archive
Internal Frame Listener Demo
import java.beans.PropertyVetoException;
import javax.swing.plaf.*;
import javax.swing.border.*;
import javax.swing.event.*;
import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
public class InternalFrameListenerDemo
extends JFrame
implements ActionListener, InternalFrameListener
{
protected int m_count;
protected int m_tencount;
private int[] m_counts = new int[7];
private int m_open, m_closing, m_close, m_iconify,
m_deiconify, m_activate, m_deactivate;
protected JButton m_newFrame;
protected JDesktopPane m_desktop;
protected JComboBox m_UIBox;
protected UIManager.LookAndFeelInfo[] m_infos;
private JLabel m_lOpened, m_lClosing, m_lClosed,
m_lIconified, m_lDeiconified, m_lActivated,
m_lDeactivated;
protected IFEventCanvas m_ifEventCanvas;
protected Timer m_eventTimer;
public InternalFrameListenerDemo() {
setTitle("Animated InternalFrameListener");
m_count = m_tencount = 0;
JPanel innerListenerPanel = new JPanel(new GridLayout(7,1));
JPanel listenerPanel = new JPanel(new BorderLayout());
m_ifEventCanvas = new IFEventCanvas();
m_lOpened = new JLabel("internalFrameOpened");
m_lClosing = new JLabel("internalFrameClosing");
m_lClosed = new JLabel("internalFrameClosed");
m_lIconified = new JLabel("internalFrameIconified");
m_lDeiconified = new JLabel("internalFrameDeiconified");
m_lActivated = new JLabel("internalFrameActivated");
m_lDeactivated = new JLabel("internalFrameDeactivated");
innerListenerPanel.add(m_lOpened);
innerListenerPanel.add(m_lClosing);
innerListenerPanel.add(m_lClosed);
innerListenerPanel.add(m_lIconified);
innerListenerPanel.add(m_lDeiconified);
innerListenerPanel.add(m_lActivated);
innerListenerPanel.add(m_lDeactivated);
listenerPanel.add("Center", m_ifEventCanvas);
listenerPanel.add("West", innerListenerPanel);
listenerPanel.setOpaque(true);
listenerPanel.setBackground(Color.white);
m_desktop = new JDesktopPane();
m_desktop.setBorder(new SoftBevelBorder(BevelBorder.LOWERED));
m_newFrame = new JButton("New Frame");
m_newFrame.addActionListener(this);
m_infos = UIManager.getInstalledLookAndFeels();
String[] LAFNames = new String[m_infos.length];
for(int i=0; i