• Post Reply Bookmark Topic Watch Topic
  • New Topic

keyEvent handling?

 
nick kaushik
Ranch Hand
Posts: 48
Chrome Java Netbeans IDE
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi everyone
i am trying to make a calender application.
what is does is print the calender of month of date you provide. & after that move the calender to next year same month or next month same year according to arrow keys....

what i want to ask is is their any way to perform event handling on keyboard keys without using awt ie, without making button or key objects as such.
thanks......
 
Rob Spoor
Sheriff
Posts: 20822
68
Chrome Eclipse IDE Java Windows
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just because you don't want to use AWT components doesn't mean you can't use anything from AWT. Swing is built on top of AWT; Component is still an indirect super class of all Swing components. Other classes like java.awt.Dimension, java.awt.Rectangle and java.awt.Point are also used extensively in Swing, and the Swing listeners (from javax.swing.event) are not meant to replace the AWT listeners (from java.awt.event), but add to them for Swing specifics. You can still use interfaces and classes like KeyListener, KeyEvent, MouseListener and MouseEvent.
 
Rob Camick
Ranch Hand
Posts: 2701
10
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use Key Bindings.
 
Jj Hill
Ranch Hand
Posts: 41
Chrome Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Listen to Rob's advice. Both of them.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!