Follow along with the video below to see how to install our site as a web app on your home screen.
Anmerkung: This feature may not be available in some browsers.
combobx.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event) {
System.out.println("ACTION COMBO");
combobx.getEditor().selectAll();
}
});
import java.awt.BorderLayout;
import java.awt.event.*;
import javax.swing.JComboBox;
import javax.swing.JFrame;
public class Test implements ActionListener {
JComboBox c;
Test() {
c = new JComboBox();
c.setEditable(true);
c.addItem("Test 1");
c.addItem("Test 2");
c.addItem("Test 3");
c.addItem("Test 4");
JFrame f = new JFrame();
f.setSize(400,100);
f.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);;
}
});
f.add(c, BorderLayout.SOUTH);
f.setVisible(true);
c.addActionListener(this);
}
public static void main (String [] args) {
new Test();
}
public void actionPerformed(ActionEvent e) {
c.getEditor().selectAll();
}
}
public void comboBoxOnHidden(Event event) {
System.out.println("comboBoxOnHidden");
mComboBox.getEditor().selectAll();
}