用SwingUtilities.invokeLater包装您的呼叫,以便在处理所有未决的AWT事件后发生:
pricePerLiter.addFocusListener(new java.awt.event.FocusAdapter() { public void focusGained(java.awt.event.FocusEvent evt) { SwingUtilities.invokeLater(new Runnable() { @Override public void run() { pricePerLiter.selectAll(); } }); }});
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)