Online Training Spring Hibernate Training in Delhi R Programming Training Course Big Data and Hadoop Training Java Training  

The Window Event



Share on Google+Share on Google+

The Window Event
1 Answer(s)      7 years ago
Posted in : Swing AWT
View Answers

September 23, 2009 at 10:11 AM

Hi Friend,

Try the following code:

import java.awt.*;
import javax.swing.*;
import java.awt.event.*;

class ButtonEvent extends JFrame {

JButton exit_button = new JButton ("Exit Button");

ButtonEvent () {
exit_button.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent evt) {
int i = JOptionPane.showConfirmDialog(null,"Do you want to exit from JFrame?\n" + "Click any button for further processing.");
switch(i) {
case JOptionPane.YES_OPTION:
case JOptionPane.NO_OPTION:
case JOptionPane.CANCEL_OPTION:
setSize(100, 50);
setTitle("Window Button");
public static void main (String [] args) {
ButtonEvent obj = new ButtonEvent();



Related Tutorials/Questions & Answers:
The Window Event - Swing AWT
The Window Event  hey plz i need help here... plz modify..., 700); setTitle("The Window Button"); setVisible(true... void actionPerformed(ActionEvent event) { } public static void
Java window state event
Java window state event  Two java windows, one on top of another... Window at the back is deactivated when the other is on the top. Can iconify when there is only one window using win+d key. In windows, press win+d, window
How to stop window closing in "internalFrameClosing" event.
How to stop window closing in "internalFrameClosing" event.  In an internal frame listener in the internalFrameClosing event I want to ask the user... it but it is still there. Is there a way to abort the frame closing event so the user can go back
Window  how to create an window of a person like regestration form
The scroll browser event of jQuery
The scroll browser event of jQuery In this tutorial ,we will print message on browser's window scrolling using scroll browser event of jQuery...().appendTo(document.body); $(window).scroll(function () { $("span"
window in center
window in center  if i run the programme thw window is in lie in top left corner i want a window open in center
Window Blind
Window Blind  Custom built . Over 30 years of shutter experience. Free in-home consultations
Chat window
the chat window pops up.. It is a div in the chat homepage.. There are few other... in the same application. I want to know how to retain the chat window (along..., the chat window should be constant across all pages in the application for current
Multi window
contains all the details. when i submit this page, a new window opens and asks to enter password. if password entered is correct, the flow goes to previous window
window closing
window closing  hello, In my project i have login,logout and some jsp pages are there and each jsp page is using javascript and onunload script. and i need one solution that,when ever user trying to close browser window
Window Script
Window Script  i want to write windows script can you help me in writing those i want to write script so that it follows below steps Step 1) downloading file from FTP 2) Unzip it 3) Edit it 4) zip it 5) upload again to FTP
KEY EVENT HANDLING  I am trying to write a program that receives every key stroke even when the window is not active or it's minimized. Is there anyway to do
active window means
active window means  active window means what?   The active window is the term used to describe the window that is currently being used
event handling
event handling  diff btwn event handling in and in HTML
Passing values from child window to parent window.
Passing values from child window to parent window.  Hai, I'm having a requirement ,in that when i open a (pop-up)child window from a parent window,the child window will contain multiple checkboxes and when i select multiple
making help window
making help window   how to make help window in gui with java
pop up window in java
pop up window in java  How to open a pop up window in Java
Passing values from child window to parent window.
Passing values from child window to parent window. I have gone thru the link but my requirement is checkboxes.can u please explain
Window Container in Flex4
Window Container in Flex4 : This container are use window applications in flex 4. Spark Window container is provide a way if user want to create own window. The Window container are provide layout and content of operating system window
Event Listeners
Event Listeners  I want to learn the Event Listeners in Java. Any... is the good tutorial and example of Event Listeners in Java. Please check the tutorial Java - Event Listeners Example in Java Applet. Thanks
Flex event
Flex event  Hi.... please tell me about How does Flex event system works? Thanks  Ans: When event are triggered there are three...: In the capturing phase, Flex examines an event target?s ancestors in the display list to see
Event in flex
Event in flex  Hi..... can you tell me about that How do you make component participate in event mechanism? Thanks   Ans: Extend EventDispatcher or any subclass of it or implement IEventDispatcher
Event management
Event management   Hi, I want event management application like maintaining email notifications while task creation and update in broader way using spring java
Event in flex
Event in flex  Hi..... I want to know about What does calling preventDefault() on an event do? How is this enforced? please give me an example for that Thanks   Ans: The methods of the Event class can be used
Prototype Window Class
Prototype Window Class       This javascript class allows you to add window in a HTML page... if you include effects.js file , but it's not mandatory. Prototype Window
Flex event
Flex event  Hi... please give me the answer with example What is event Bubbling? Thanks in advance  Event Bubbling: In the bubbling phase, Flex examines an event?s ancestors for event listeners. Flex starts
Flex event
Flex event  hi...... How to capture and event if the component is disabled? please give an example..... Thanks in advance
Flex event
Flex event  Hi.... Please tell me about How to create your own event in flex? Thanks
Pop Up window - WebSevices
Pop Up window  How refresh pop up window,Tell me correct code for this problem.  Hi friend, I am sending a link. This link will help you. Visit for more information.
Window State - Swing AWT
Window State  Thanks for you reply. I have already tried the setSize() method of AWT Window and also with JFrame. But I want to Maximize the Window when it is opened by the user and instead of the Maximize
JSP Window. Open
JSP Window. Open          JSP Window. Open  is used to open a new window in JSP. The JavaScript function ) open a new browser