Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package javafxapplication1;
- import java.net.URL;
- import java.util.ResourceBundle;
- import javafx.collections.FXCollections;
- import javafx.collections.ObservableList;
- import javafx.event.ActionEvent;
- import javafx.fxml.FXML;
- import javafx.fxml.Initializable;
- import javafx.scene.control.Button;
- import javafx.scene.control.ComboBox;
- import javafx.scene.control.Label;
- import javafx.scene.control.TextField;
- /**
- *
- * @author Guillaume
- */
- public class SampleController implements Initializable {
- @FXML
- private Label lb_config , lb_select , lb_config_act , lb_vit , lb_tps , lb_imp ;
- @FXML
- private TextField tf_vit , tf_tps , tf_imp ;
- @FXML
- private Button bt_visualiser , bt_modif;
- @FXML
- private ComboBox<String> me_sel;
- @FXML
- private void buttonAction(ActionEvent event)
- {
- tf_vit.setText("Value"+me_sel.getValue());
- }
- String item1 = "1";
- String item2 = "2";
- ObservableList<String> list = FXCollections.observableArrayList(
- item1 , item2
- );
- @Override
- public void initialize(URL url, ResourceBundle rb) {
- me_sel.setItems(list);
- // TODO
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment