•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Java section within the Software Development category of DaniWeb, a massive community of 391,555 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,613 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Java advertiser: Lunarpages Java Web Hosting
Views: 5245 | Replies: 2
![]() |
•
•
Join Date: Jun 2003
Posts: 11
Reputation:
Rep Power: 6
Solved Threads: 0
A combination of events can be used for the same listener; listening to i.e. when a certain key is pressed by adding a KeyAdapter's KeyEvent, and listening to when a certain button is being pressed by using the ActionListener's ActionEvent.
So if i.e. a "ok" button should do something one could write a listener class that do the following:
Hope this is of some help,
/Soo-Im
So if i.e. a "ok" button should do something one could write a listener class that do the following:
Class OkListener extends KeyAdapter implements ActionListener {
public void keyTyped(KeyEvent ke) {
// Code for what happens to the JTextField when a certain key is be pressed...
}
public void actionPerformed(ActionEvent ae) {
// Code for what happens to the JTextField when a button is clicked on...
}
}Hope this is of some help,
/Soo-Im
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb Java Marketplace
- LaTeX in JTextField (Java)
- how can i implement a string from Jtextfield and saving it to a file (Java)
- How do you center the text in a JTextField?? (Java)
- How to align text in JTextField (Java)
- line up JTextField GUI java & write to file (Java)
- write into and read from JTextField (Java)
Other Threads in the Java Forum
- Previous Thread: Writing to an Access Database using Java...
- Next Thread: java 3d viewable to everyone


Linear Mode