Source Code : InternalFrameEvent Demo
Java Is Open Source Programming Language You Can Download From Java and Java Libraries From http://www.oracle.com.
Click Here to download
We provide this code related to title for you to solve your developing problem easily. Libraries which is import in this program you can download from http://www.oracle.com.
Click Here or search from google with Libraries Name you get jar file related it
InternalFrameEvent Demo

import java.awt.BorderLayout;
import java.awt.Container;
import javax.swing.JDesktopPane;
import javax.swing.JFrame;
import javax.swing.JInternalFrame;
import javax.swing.JLabel;
import javax.swing.JLayeredPane;
import javax.swing.event.InternalFrameEvent;
import javax.swing.event.InternalFrameListener;
public class InternalFrameEventTest {
public static void main(String[] a) {
JFrame frame = new JFrame();
Container contentPane = frame.getContentPane();
JLayeredPane desktop = new JDesktopPane();
desktop.setOpaque(false);
contentPane.add(desktop, BorderLayout.CENTER);
desktop.add(createLayer("One"), JLayeredPane.POPUP_LAYER);
desktop.add(createLayer("Two"), JLayeredPane.DEFAULT_LAYER);
desktop.add(createLayer("Three"), JLayeredPane.PALETTE_LAYER);
frame.setSize(400, 200);
frame.setVisible(true);
}
public static JInternalFrame createLayer(String label) {
return new SelfInternalFrame(label);
}
}
class SelfInternalFrame extends JInternalFrame {
public SelfInternalFrame(String s) {
getContentPane().add(new JLabel(s), BorderLayout.CENTER);
addInternalFrameListener(new InternalFrameListener() {
public void internalFrameActivated(InternalFrameEvent e) {
System.out.println("Activated" + e.getSource());
}
public void internalFrameClosed(InternalFrameEvent e) {
System.out.println("Closed");
}
public void internalFrameClosing(InternalFrameEvent e) {
System.out.println("Closing");
}
public void internalFrameDeactivated(InternalFrameEvent e) {
System.out.println("Deactivated");
}
public void internalFrameDeiconified(InternalFrameEvent e) {
System.out.println("Deiconified");
}
public void internalFrameIconified(InternalFrameEvent e) {
System.out.println("Iconified");
}
public void internalFrameOpened(InternalFrameEvent e) {
System.out.println("Opened");
}
});
setBounds(50, 50, 100, 100);
setResizable(true);
setClosable(true);
setMaximizable(true);
setIconifiable(true);
setTitle(s);
}
}
Thank with us