| | |
JTextField
![]() |
•
•
Join Date: Jun 2003
Posts: 11
Reputation:
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:
Java Syntax (Toggle Plain Text)
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
![]() |
Similar Threads
- 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
| Thread Tools | Search this Thread |
-xlint add android api applet application applications array arrays automation bank bi binary blackberry bluetooth chat class client code compile compiler component database development digit eclipse equation error event fractal freeze functiontesting game gameprogramming givemetehcodez graphics gui health html hyper ide idea image infinite input int integer j2me java javame javaprojects jetbrains jni jpanel jtable julia learningresources linux list login loop main map method methods mobile myregfun netbeans newbie nonstatic notdisplaying pearl problem program programming project qt recursion scanner screen scrollbar server set sms sort sorting spamblocker sql sqlserver string superclass swing system text-file thread threads tree variablebinding windows xor





