The method addWindowListener is included in the class JFrame, which is demonstrated through an example Java program. A MyFrame class extends JFrame and uses the addWindowListener method to add a window closing event listener. When the window closes, the program exits with a status of 0.
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
The method addWindowListener is inclided in the class JFrame- true or.docx
1. The method addWindowListener is inclided in the class JFrame?
true or false
Solution
The method addWindowListener is inclided in the class JFrame?
true or false
sol: true add window listener is included in jframe
i will show you in below example
class MyFrame extends JFrame
{
MyFrame() Â Â //constructor
{
super("Split Pane Demo");
addWindowListener(new WindowAdapter() //this is the method used in myframe which extends
jframe
{
public void windowClosing(WindowEvent we)Â Â Â Â Â //closing the window
{
System.exit(0);
}
});