I have the following code
JPanel pb = new JPanel();
JLabel b = new JLabel("Buscar por ...");
JTextField bt = new JTextField(10);
JButton bb = new JButton("Lupa");
// bb.setBackground(color);
bb.addActionListener(new Busquedad());
bb.addKeyListener(new KeyAdapter() {
public void keyPressed(KeyEvent e) {
//Busquedad
}
});
The Search class collects the text written in a JTextField and performs a search in the database.
My problem is that I want to be able to execute that if I click the button or if I use tab + enter, that is to say, that when using the keyboard perform the search as if I clicked