• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

key events!

 
Ranch Hand
Posts: 153
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
(from java-caps mock exam2)
Q30. Please select all correct answers?
A) java.awt.TextArea.SCROLLBARS_NONE
B) java.awt.TextArea does not generate Key events
C) java.awt.TextField generates Key events and Action events
D) java.awt.TextArea can be scrolled using the <-- and --> keys.
Answer:A) java.awt.TextArea.SCROLLBARS_NONE
C) java.awt.TextField generates Key events and Action events
D) java.awt.TextArea can be scrolled using the <-- and --> keys.
________
hi!i am confused over the option (C), afaik text field doesn't respond to indivifual key events so (C) should be wrong.can u clear it pl???
thanx.
ashok.
 
Ranch Hand
Posts: 317
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, ashok, KeyEvent is subclass of InputEvent, which in turn is a subclass of ComponentEvent. Every class that is subclass of Component can generate KeyEvent, TextField is no exception.
It can also generate MouseEvent, which is also a subclass of InputEvent.
Hope it helps.

------------------
Guoqiao Sun
Sun Certified Programmer for Java™ 2 Platform
Try my mock exam¹ at my homepage.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic