Wrox Programmer Forums
|
JSP Basics Beginning-level questions on JSP. More advanced coders should post to Pro JSP.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the JSP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 6th, 2003, 11:39 PM
Registered User
 
Join Date: Oct 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to egiblock Send a message via MSN to egiblock Send a message via Yahoo to egiblock
Default help with Events

been working with the Beginning Java 2 (1.3 edition.)
page 629 working with the SketchFrame java file..

i don't understand how to create event handlers for when someone clicks on the menu and clicks on exit.. where do i define the exit button so when someone clicks on it, it closes the program..

Here's some of my code:

Code:
quitProgramAction = new FileAction("Quit Program",KeyStroke.getKeyStroke('Q', Event.CTRL_MASK));
Code:
addMenuItem(fileMenu, quitProgramAction);
Code:
private JMenuItem addMenuItem(JMenu menu, Action action)
{
JMenuItem item = menu.add(action);

KeyStroke keystroke = (KeyStroke)action.getValue(action.ACCELERATOR_KEY);
    if(keystroke != null)
      item.setAccelerator(keystroke);
      return item;
}

any help is greatly appreciated
thanks..





--
Eric Giblock





Similar Threads
Thread Thread Starter Forum Replies Last Post
Events bschleusner C# 2005 2 February 26th, 2007 05:25 AM
Page Events aware Javascript 2 November 8th, 2006 07:01 AM
Events not firing in IE malk ASP.NET 1.0 and 1.1 Professional 7 August 29th, 2006 01:32 PM
Customised events in C# LowFlyer VS.NET 2002/2003 2 July 15th, 2004 01:53 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.