i have simple gui app and, when I press Tab key, it move focus like this:
but i wanna move like this:
public class Test extends javax.swing.JFrame {
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JTextField jTextField1;
private javax.swing.JTextField jTextField2;
public Test() {
initComponents();
}
// NetBeans generate Form code
public static void main(String args[]) {
new Test().setVisible(true);
}
}
you need a custom FocusTraversalPolicy. see here for an example -> Example
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.