ted40

Controller

May 29th, 2016
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.24 KB | None | 0 0
  1. package javafxapplication1;
  2.  
  3. import java.net.URL;
  4. import java.util.ResourceBundle;
  5. import javafx.collections.FXCollections;
  6. import javafx.collections.ObservableList;
  7. import javafx.event.ActionEvent;
  8. import javafx.fxml.FXML;
  9. import javafx.fxml.Initializable;
  10. import javafx.scene.control.Button;
  11. import javafx.scene.control.ComboBox;
  12. import javafx.scene.control.Label;
  13. import javafx.scene.control.TextField;
  14.  
  15. /**
  16.  *
  17.  * @author Guillaume
  18.  */
  19. public class SampleController implements Initializable {
  20.  
  21.     @FXML
  22.     private Label lb_config , lb_select , lb_config_act , lb_vit , lb_tps , lb_imp ;
  23.    
  24.     @FXML
  25.     private TextField tf_vit , tf_tps , tf_imp ;
  26.    
  27.     @FXML
  28.     private Button bt_visualiser , bt_modif;
  29.  
  30.     @FXML
  31.     private ComboBox<String> me_sel;
  32.    
  33.     @FXML
  34.     private void buttonAction(ActionEvent event)
  35.     {
  36.         tf_vit.setText("Value"+me_sel.getValue());
  37.     }
  38.     String item1 = "1";
  39.     String item2 = "2";
  40.     ObservableList<String> list = FXCollections.observableArrayList(
  41.             item1 , item2
  42.             );
  43.            
  44.            
  45.    
  46.     @Override
  47.     public void initialize(URL url, ResourceBundle rb) {
  48.        me_sel.setItems(list);
  49.         // TODO
  50.     }    
  51. }
Advertisement
Add Comment
Please, Sign In to add comment