Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Key Bindings

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here's to my first post!

At the moment, I'm up to page 825 (or there abouts) in Ivor Horton's Beginning Java 2. I feel that I have a reasonable understanding of the fundamentals of Java, and figure that I should have a go at putting together my first Java desktop application.

I've just started (see code) and I've hit my first stumbling block.

I'm using Mac OS X, and I would like to build in standard Mac OS X window behaviour into the app. At the moment, all this includes is Command-M to minimise a window & Command-W to close a window.

As a challenge, I wasn't all that keen on including these items in as JMenuItem as I read the suggestion to use Key Bindings.

At the moment I am totally unsure as to how to implement the Key Bindings, as it gets hardly a mention in the book I'm using as a guide and the documentation online is a bit beyond me at the moment.

Here's what I'm working with at the moment (I know it's not much, but please keep in mind that I am a beginner and that I'm focusing on window behaviour at the moment).

WebColor.java
------------



WebWindow.java
--------------



Any suggestions or how-to tips would be very much appreciated. In the mean time, I'll continue trying to interpret the documentation for Key Bindings.

Thanks, James
[ December 06, 2005: Message edited by: James B Sephton ]
 
Ranch Hand
Posts: 1780
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the 'ranch. I think you should post Swing-related questions
to the Swing/etc... forum, but in the meantime, this is the best reference
I've read on keyboard bindings:

http://java.sun.com/products/jfc/tsc/special_report/kestrel/keybindings.html
 
You had your fun. Now it's time to go to jail. Thanks for your help tiny ad.
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic