requestFocus() in java?

2010-02-01 7:00 pm
Hello. I am trying to learn java right no but encounter a problem.

Question: What is requestFocus in API and what is the use of it? How do I use it in my code?

I searched up in the internet but many people said they couldn't use it because of some bugs ...


So hope someone answer my question. thank you

回答 (1)

2010-02-01 7:23 pm
✔ 最佳答案
requestFocus() will make active a JFrame, JInternalFrame, JButton, JTextField, JPassword and a couple of other widgets I can not remember at the moment. I've used it for JTextField so the cursor is blinking, ready to accept keyboard input.

Basically, Swing is a constantly running animation. Becoming familiar with that aspect of java's GUI and you can work with the central running thread to make buttons that animate, window frames that flash, and other specialty things. Maybe that is the reason some say requestFocus() is unusual for them.


收錄日期: 2021-05-01 09:35:11
原文連結 [永久失效]:
https://hk.answers.yahoo.com/question/index?qid=20100201110043AAdu0ic

檢視 Wayback Machine 備份