This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
How can I let a text field get focus on it whenever it display? How can I let this text field add a key strok ActionListener (Enter key) that mean when I type "Enter" key in this text field and some action will happen? Please teach me. Thanks!
deekasha gunwant
Ranch Hand
Joined: May 06, 2000
Posts: 396
posted
0
hi, to get the focus to the textfield. use textfield.requestFocus(); and to respond to the enter key - add keyListener to ur text field. - in the keyReleased() method of ur key listener. just check if(keyevnt.getKeyCode()==KeyEvent.VK_ENTER) { ///enter key pressed do ...... } else { ///do nothing }
Anonymous
Ranch Hand
Joined: Nov 22, 2008
Posts: 18944
posted
0
Hi deekasha gunwant: Thank you very much! Moreover do you know How can I determine a database is empty or not, if it is not empty, how can I print out the names of all the tables currently existing in the database. Thank you for your teach!
Anonymous
Ranch Hand
Joined: Nov 22, 2008
Posts: 18944
posted
0
hi u can quey the database by querying the system table "tabs" (i'm taking wrt Oracle) if result set is null then u can say that database was empty, and far as the problem of displaying column name is concerned u can query the same tabe for table_name column and display the result in either text area or table or whatever u wan't to use. but u see it depends a lot on the database u r using. i have written it wrt Oracle only. i don't know whether it will be helpful for u or not. Naima Muzammal NETSOL Intl. Pakistan