SHARE
TWEET

Untitled

a guest Jul 18th, 2019 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. @FXML
  2.     private JFXTextField jfautocom;
  3.  
  4.     private DatabaseHandler datahandler;
  5.  
  6. final ObservableList<String> auto =FXCollections.observableArrayList();
  7.  
  8.     @Override
  9.     public void initialize(URL url, ResourceBundle rb) {
  10.         datahandler = DatabaseHandler.getInstance();
  11.  
  12.     }
  13.  
  14. @FXML
  15.     private void autocomp(MouseEvent event)
  16. { String testName = jfautocom.getText();
  17.         TextFields.bindAutoCompletion(jfautocom, auto);
  18.  
  19.         try {
  20.  
  21.             String quy = "SELECT `name` FROM `vendor`";
  22.             ResultSet resultset = datahandler.execQuery(quy);
  23.             while (resultset.next()) {
  24.                 testName = resultset.getString("name");
  25.             }
  26.  
  27.              jfautocom.setText(testName);
  28.                 auto.add(testName);
  29.  
  30.         } catch (SQLException ex) {
  31.             Logger.getLogger(AutocomtestController.class.getName()).log(Level.SEVERE, null, ex);
  32.         }
  33. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top