Advertisement
Guest User

Untitled

a guest
Oct 28th, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.17 KB | None | 0 0
  1. private void showInputDetails(InputConfigurationModel ipmodel) {
  2.  
  3. if (ipmodel != null) {
  4. cmbfiletype.setValue(ipmodel.getFiletype().toString());
  5. }
  6.  
  7. public class InputConfigurationModel {
  8.  
  9. public StringProperty filetype = new SimpleStringProperty();
  10. public InputConfigurationModel(String filetype) {
  11.  
  12. this.filetype = new SimpleStringProperty(filetype);
  13. }
  14.  
  15. public InputConfigurationModel() {
  16. }
  17.  
  18. public String getFiletype() {
  19. return filetype.get();
  20. }
  21.  
  22. public void setFiletype(String value) {
  23. filetype.set(value);
  24. }
  25.  
  26. public StringProperty filetypeProperty()
  27. {
  28. return filetype;
  29. }
  30.  
  31. // @Override
  32. // public String toString() {
  33. // return filetype.toString(); //To change body of generated methods, choose Tools | Templates.
  34. // }
  35. }
  36.  
  37. public void LoadFile() {
  38.  
  39. try {
  40.  
  41. String sql = "select * from EXTENSION";
  42. PreparedStatement ps = conn.prepareStatement(sql);
  43. rs = ps.executeQuery(sql);
  44. while (rs.next()) {
  45. ExtensionModel extModel = new ExtensionModel();
  46. filetypelstupdate_ip = FXCollections.observableArrayList(extModel);
  47. String ext_type = rs.getString("EXT_TYPE");
  48. String ext_name = rs.getString("EXT_NAME");
  49. int ext_id=Integer.parseInt(rs.getString("EXT_ID"));
  50. extModel.setExttype(ext_type);
  51. extModel.setExtname(ext_name);
  52. extModel.setExtid(ext_id);
  53. cmbfiletype.getItems().addAll(filetypelstupdate_ip);
  54.  
  55. cmbfiletype.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<ExtensionModel>() {
  56. @Override
  57. public void changed(ObservableValue<? extends ExtensionModel> observable, ExtensionModel oldValue, ExtensionModel newValue) {
  58. aaa(newValue);
  59.  
  60. }
  61. });
  62.  
  63. catch (Exception ex) {
  64. ex.printStackTrace();
  65. }
  66.  
  67. }
  68. public void aaa(ExtensionModel exm){
  69.  
  70. if(cmbfiletype!=null)
  71. {
  72. txtextid.setText(exm.getExtid().toString());
  73. System.out.println("txtextid"+txtextid);
  74. }
  75.  
  76. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement