Java Swing 面试题与答案
问题 21. Which method is used by the applet to recognize the height and width?
getParameters()
Method is used by the applet to recognize the height and width.
问题 22. When we should go for codebase in applet?
If the applet class is not in the same directory, codebase is used.
问题 23. What is the lifecycle of an applet?
init( ) method - called when an applet is first loaded
start( ) method - called each time an applet is started
paint( ) method - called when the applet is minimized or maximized
stop( ) method - called when the browser moves off the applet's page
destroy( ) method - called when the browser is finished with the applet
问题 24. Which method is used for setting security in applets?
setSecurityManager()
Method is used for setting security in applets.
问题 25. What is an event and what are the models available for event handling?
Changing the state of an object is called an event. An event is an event object that describes a state of change. In other words, event occurs when an action is generated, like pressing a key on keyboard, clicking mouse, etc. There different types of models for handling events are event-inheritance model and event-delegation model.
用户评价最有帮助的内容:
- Why does it take so much time to access an Applet having Swing Components the first time?
- What's Java Swing?
- What are the differences between Swing and AWT?
- What is JFC?
- What is AWT?