I can't see anyway of doing this because i don't think you can add a key listener to any component that dosen't listen for KeyEvents. If you are testing to see if a value entered in a JTextField equals = then the following code works.
Code:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class W{
public static void main(String[] agrs){
final JFrame jf = new JFrame();
JTextField jtf = new JTextField(10);
jf.getContentPane().add(jtf,BorderLayout.NORTH);
jf.setSize(300,400);
jf.setVisible(true);
jtf.addKeyListener(new KeyGrabber());
jf.addWindowListener(new WindowAdapter(){
public void windowClosing(WindowEvent we){
System.exit(0);
}
});
}
}
class KeyGrabber extends KeyAdapter{
public void keyTyped(KeyEvent ke){
if('=' == ke.getKeyChar()){
// pop up dialog
}
}
}