How to addComponentListener JFrame

JFrame addComponentListener Example

This tutorial will teach you how to addComponentListener JFrame which is top level components that are used to create GUI applications.

Other JFrame Methods

 addComponentListener JFrame  Example

[
/** * * @author Eric
 * Blog:coding-whizz.blogspot.com
 */
import javax.swing.JFrame;
import java.awt.Dimension;
import java.awt.Component;
import java.awt.Point;

import java.awt.event.ComponentListener;
import java.awt.event.ComponentEvent;

public class JFrameAddComponentListener  extends       
 JFrame implements ComponentListener{
    JFrameAddComponentListener()
    {
        super(" JFrameAddComponentListener");

        setSize(300, 300);
        addComponentListener(this);
        setVisible(true);
    }


    public void componentHidden(ComponentEvent event)
    {
        Component c=(Component)event.getSource();
        System.out.println("Component Hidden");
    }
    public void componentShown(ComponentEvent event)
    {
        Component c=(Component)event.getSource();
        System.out.println("Component Shown");
    }
    public void componentMoved(ComponentEvent event)
    {
        Component c=(Component)event.getSource();
        Point loc=c.getLocation();
        System.out.println("New JFrame location is  "+loc);

    }
    public void componentResized(ComponentEvent event)
    {
        Component c=(Component)event.getSource();
        Dimension newSize=c.getSize();
        System.out.println("New JFrame size is " +newSize);
    }
    public static void main(String args [])
    {
        new JFrameAddComponentListener();
    }

}
]

COMMENTS

Name

android arrays cnna1 graphics java java control statements java.swing JButton JFrame JLabel JTextField laravel node.js OPP questions swing technology
false
ltr
item
Code WHIZZ: How to addComponentListener JFrame
How to addComponentListener JFrame
JFrame addComponentListener Example
Code WHIZZ
https://code-whizz.blogspot.com/2017/04/how-to-addcomponentlistener-jframe.html
https://code-whizz.blogspot.com/
http://code-whizz.blogspot.com/
http://code-whizz.blogspot.com/2017/04/how-to-addcomponentlistener-jframe.html
true
5534598864497432585
UTF-8
Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS CONTENT IS PREMIUM Please share to unlock Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy