Package javafx.scene.control

Examples of javafx.scene.control.Button


  @Override
  public void start(Stage stage)
  {
    HBox lHBox = new HBox(5.0);
    lHBox.add(new Button("grow"), new HBox.C().hgrow(Priority.ALWAYS));
    lHBox.add(new Button("margin 5 grow"), new HBox.C().margin(new Insets(5.0)).hgrow(Priority.ALWAYS));
    lHBox.getChildren().add(new Button("old style"));
    lHBox.add(new Button("margin 20 nogrow"), new HBox.C().margin(new Insets(20.0)));
    lHBox.add(new Button("grow maxheight 50"), new HBox.C().hgrow(Priority.ALWAYS).maxHeight(50.0));

        // setup scene
    Scene scene = new Scene(lHBox, 800, 200);
   
        // create stage
View Full Code Here


   *
   */
  public Parent getRootNode()
  {
    hbox = new HBox(5.0);
    hbox.add(new Button("grow"), new HBox.C().hgrow(Priority.ALWAYS));
    hbox.add(new Button("margin 5 grow"), new HBox.C().margin(new Insets(5.0)).hgrow(Priority.ALWAYS));
    hbox.getChildren().add(new Button("old style"));
    hbox.add(new Button("margin 20 nogrow"), new HBox.C().margin(new Insets(20.0)));
    hbox.add(new Button("grow maxheight 50"), new HBox.C().hgrow(Priority.ALWAYS).maxHeight(50.0));

    return hbox;
  }
View Full Code Here

   *
   */
  public Parent getRootNode()
  {
    vbox = new VBox(5.0);
    vbox.add(new Button("short"), new VBox.C().vgrow(Priority.ALWAYS));
    vbox.add(new Button("medium length"), new VBox.C().vgrow(Priority.ALWAYS));
    vbox.add(new Button("a longer description in order to test things"), new VBox.C().vgrow(Priority.ALWAYS));
    vbox.add(new Button("margin 5 grow"), new VBox.C().margin(new Insets(5.0)).vgrow(Priority.ALWAYS));
    vbox.getChildren().add(new Button("old style"));
    vbox.add(new Button("margin 20 nogrow"), new VBox.C().margin(new Insets(20.0)));
    vbox.add(new Button("grow maxwidth 150"), new VBox.C().vgrow(Priority.ALWAYS).maxWidth(150.0));

    return vbox;
  }
View Full Code Here

        lCircularPane.add(c);
      }
      lHBox.add(lCircularPane);
    }
   
    Button lButton = new Button("out");
    lButton.setOnAction( (actionEvent) -> {
      lCircularPane.animateOut();
    });
    lCircularPane.setOnAnimateOutFinished( (event) -> {
      lCircularPane.setVisible(false);
      Platform.runLater(() -> {
View Full Code Here

    setLabel("isClickedThrough");
   
    // create underlying button
    AtomicInteger underlyingClickAtomicInteger = new AtomicInteger();
    TestUtil.runThenWaitForPaintPulse( () -> {
      Button lUnderlyingButton = new Button("click me but a bit longer");
      lUnderlyingButton.setId("UnderlyingButton");
      stackPane.getChildren().add(1, lUnderlyingButton); // index = 1: below menu, above label
      lUnderlyingButton.setOnAction((actionEvent) -> {
        underlyingClickAtomicInteger.incrementAndGet();
      });
    });

    // click underlying button
View Full Code Here

    setLabel("isClickedThrough");
   
    // setup
    AtomicInteger underlyingClickAtomicInteger = new AtomicInteger();
    TestUtil.runThenWaitForPaintPulse( () -> {
      Button lUnderlyingButton = new Button("click me");
      lUnderlyingButton.setId("UnderlyingButton");
      stackPane.getChildren().add(lUnderlyingButton);
      lUnderlyingButton.setOnAction((actionEvent) -> {
        underlyingClickAtomicInteger.incrementAndGet();
      });
     
      cornerMenu = new CornerMenu(CornerMenu.Location.TOP_RIGHT, this.stackPane, true)
        .withAnimationInterpolation(null)
View Full Code Here

            .withEditable(true)
            .withStringConverter(StringConverterFactory.forInteger())
            ;
        lSpinner.setStyle("-fxx-value-alignment:CENTER_RIGHT;");
       
        Button lButton = new Button("change CSS");
        lButton.onMouseClickedProperty().set(new EventHandler<MouseEvent>()
        {
          @Override
          public void handle(MouseEvent arg0)
          {
            //lSpinner.setStyle("-fxx-arrow-position:SPLIT;");
View Full Code Here

      toggleGroupValue.add(lButton, "value" + idx);
      toggles.add(lButton);
      box.getChildren().add(lButton);
      idx++;
    }
    box.getChildren().add(new Button("focus helper"));
   

    // make sure that the listspinner fits with arrows in both directions
    box.setPrefSize(100, 100);
   
View Full Code Here

   
    VBox box = new VBox();

    spinner = new ListSpinner<String>("a", "b", "c");
    box.getChildren().add(spinner);
    box.getChildren().add(new Button("focus helper"));
   

    // make sure that the listspinner fits with arrows in both directions
    box.setPrefSize(100, 100);
   
View Full Code Here

    Locale.setDefault(Locale.ENGLISH);
   
    HBox box = new HBox();
    calendarTextField = new CalendarTextField();
    box.getChildren().add(calendarTextField);
    Button lButton = new Button("focus helper");
    lButton.setId("focusHelper");
    box.getChildren().add(lButton);

    return box;
  }
View Full Code Here

TOP

Related Classes of javafx.scene.control.Button

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.