如何使javaswing中的Jbutton只收到一键?

时间:2019-03-23 11:33:40

标签: java sql-server

按钮点击事件:

private void showAnsMouseClicked(java.awt.event.MouseEvent evt) {                                     

      try {
        sm.loadSubject();
        String find = select.getSelectedItem().toString();

        if (find.equalsIgnoreCase("all")) {
            H1(find);
        } else {
            Subject a = sm.findSubject(find);
            H1(a.getId_Subject());
        }
    } catch (Exception ex) {
        Logger.getLogger(show.class.getName()).log(Level.SEVERE, null, ex);
    }

}     

0 个答案:

没有答案