Package javafx.scene.control

Examples of javafx.scene.control.Button


       
        Label separator1 = new Label(":");
        Label separator2 = new Label(":");
        Label msSeparator = new Label(",");
       
        Button cancelButton = new Button("Cancel");
        cancelButton.setOnAction(new EventHandler<ActionEvent>() {

            @Override
            public void handle(ActionEvent t) {
                primaryStage.close();
            }
        });
       
        Button okButton = new Button("OK");
        okButton.setOnAction(new EventHandler<ActionEvent>() {

            @Override
            public void handle(ActionEvent t) {
                okButtonListener();
                approveOption = true;
View Full Code Here


    public void start(Stage primaryStage) {
        Label movieNameLabel = new Label("Movie Name:");
        Label languageLabel = new Label("Language:");
        movieNameField = new TextField();
        languageCombo = new ComboBox();
        searchButton = new Button("Search");
       
        initComboBox();

        languageCombo.setMaxWidth(Double.MAX_VALUE);
       
        GridPane.setHgrow(movieNameField, Priority.ALWAYS);
        GridPane.setHgrow(languageCombo, Priority.ALWAYS);
        GridPane topPane = new GridPane();
        topPane.setHgap(5);
        topPane.setVgap(10);
        topPane.setPadding(new Insets(10, 25, 15, 25));
        topPane.add(movieNameLabel, 1, 1);
        topPane.add(languageLabel, 1, 2);
        topPane.add(movieNameField, 2, 1, 2, 1);
        topPane.add(languageCombo, 2, 2);
        topPane.add(searchButton, 3, 2);
       
        HBox.setHgrow(topPane, Priority.ALWAYS);
        HBox topBox = new HBox();
        topBox.getChildren().add(topPane);
       
       
        table = new TableView<Subtitle>();
        table.setEditable(false);
        table.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);
        table.setItems(data);
       
        TableColumn idCol = new TableColumn("ID");
        idCol.setCellValueFactory(new PropertyValueFactory<Subtitle, String>("id"));
        TableColumn titleCol = new TableColumn("Title");
        titleCol.setCellValueFactory(new PropertyValueFactory<Subtitle, String>("name"));
        TableColumn uploadedCol = new TableColumn("Uploaded");
        uploadedCol.setCellValueFactory(new PropertyValueFactory<Subtitle, String>("uploadedDate"));
        TableColumn yearReleasedCol = new TableColumn("Year Released");
        yearReleasedCol.setCellValueFactory(new PropertyValueFactory<Subtitle, String>("year"));
        TableColumn kindCol = new TableColumn("Kind");
        kindCol.setCellValueFactory(new PropertyValueFactory<Subtitle, String>("kind"));
        TableColumn seasonCol = new TableColumn("Season");
        seasonCol.setCellValueFactory(new PropertyValueFactory<Subtitle, String>("season"));
        TableColumn episodeCol = new TableColumn("Episode");
        episodeCol.setCellValueFactory(new PropertyValueFactory<Subtitle, String>("episode"));
       
        table.getColumns().addAll(idCol, titleCol, uploadedCol, yearReleasedCol, kindCol, seasonCol, episodeCol);
       
       
        linkField = new TextField("Download Link");
        mountButton = new Button("Mount");
        downloadButton = new Button("Download");
       
        linkField.setEditable(false);
       
        HBox.setHgrow(linkField, Priority.ALWAYS);
        HBox bottomBox = new HBox(5);
View Full Code Here

                        splineEditorControl.getControlPoint2y());
            }
        });
        GridPane.setConstraints(codeLabel, 0, 10, 1, 1
                , HPos.CENTER, VPos.CENTER, Priority.ALWAYS, Priority.ALWAYS);
        Button copyButton = new Button("Copy Code");
        copyButton.getStyleClass().add("big-button");
        copyButton.setOnAction(new EventHandler<ActionEvent>() {
            @Override public void handle(ActionEvent t) {
                Clipboard.getSystemClipboard().setContent(
                        Collections.singletonMap(DataFormat.PLAIN_TEXT,(Object)codeLabel.getText()));
            }
        });
View Full Code Here

     * {@inheritDoc}
     */
    @Override
    protected void initView() {

        this.defaultCommand = new Button("Trigger a default Command into JIT");
        this.uiCommand = new Button("Trigger an UI Command into JAT");
        this.pooledCommand = new Button("Trigger a pooled Command into JTP");

        getRootNode().setCenter(
                LabelBuilder.create()
                        .text("JRebirth Sample")
                        .build()
View Full Code Here

     * {@inheritDoc}
     */
    @Override
    protected void initView() {

        this.undoButton = new Button("Undo");
        this.redoButton = new Button("Redo");

        this.addCircleButton = new Button("Add Circle");
        this.addSquareButton = new Button("Add Square");
        this.addRectangleButton = new Button("Add Rectangle");

        getRootNode().setTop(FlowPaneBuilder.create()
                .children(this.undoButton, this.redoButton, this.addCircleButton, this.addSquareButton, this.addRectangleButton)
                .build());

View Full Code Here

     * {@inheritDoc}
     */
    @Override
    protected void initView() {

        this.openButton = new Button("Open");
        HBox.setHgrow(this.openButton, Priority.ALWAYS);
        this.openButton.setMaxWidth(Double.MAX_VALUE);

        this.unloadButton = new Button("Unload");
        this.unloadButton.setDisable(true);
        HBox.setHgrow(this.unloadButton, Priority.ALWAYS);
        this.unloadButton.setMaxWidth(Double.MAX_VALUE);

        this.playPauseButton = new Button("Play");
        this.playPauseButton.setDisable(true);
        HBox.setHgrow(this.playPauseButton, Priority.ALWAYS);
        this.playPauseButton.setMaxWidth(Double.MAX_VALUE);

        this.backwardButton = new Button("<<");
        this.backwardButton.setDisable(true);
        HBox.setHgrow(this.backwardButton, Priority.ALWAYS);
        this.backwardButton.setMaxWidth(Double.MAX_VALUE);

        this.forwardButton = new Button(">>");
        this.forwardButton.setDisable(true);
        HBox.setHgrow(this.forwardButton, Priority.ALWAYS);
        this.forwardButton.setMaxWidth(Double.MAX_VALUE);

        this.stopButton = new Button("Stop");
        this.stopButton.setDisable(true);
        HBox.setHgrow(this.stopButton, Priority.ALWAYS);
        this.stopButton.setMaxWidth(Double.MAX_VALUE);

        getRootNode().getChildren().addAll(
View Full Code Here

     * {@inheritDoc}
     */
    @Override
    protected void initView() {

        this.defaultCommand = new Button("Trigger a default Command into JIT");
        this.uiCommand = new Button("Trigger an UI Command into JAT");
        this.pooledCommand = new Button("Trigger a pooled Command into JTP");

        getRootNode().setCenter(
                LabelBuilder.create()
                        .text("JRebirth Sample")
                        .build()
View Full Code Here

    @Override
    public void start(final Stage primaryStage) {
        final StackPane root = new StackPane();
        final FileChooser fileChooser = new FileChooser();
        final Button btn = new Button();
        final Button open1 = new Button();
        final Button open2 = new Button();
        final Text route1 = new Text();
        final Text route2 = new Text();
        final VBox vBox = new VBox();

        open1.setText("Open first file");
        open1.setOnAction(new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent actionEvent) {
                File file = fileChooser.showOpenDialog(primaryStage);
                if (file != null) {
                    try {
                        bufferedImage1 = ImageIO.read(new File(String.valueOf(file)));
                        route1.setText(file.toString());
                    } catch (IOException e) {
                        e.printStackTrace()//To change body of catch statement use File | Settings | File Templates.
                    }
                }
            }
        });

        open2.setText("Open second file");
        open2.setOnAction(new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent actionEvent) {
                File file = fileChooser.showOpenDialog(primaryStage);
                if (file != null) {
                    try {
                        bufferedImage2 = ImageIO.read(new File(String.valueOf(file)));
                        route2.setText(file.toString());
                    } catch (IOException e) {
                        e.printStackTrace()//To change body of catch statement use File | Settings | File Templates.
                    }
                }
            }
        });

        primaryStage.setTitle("Image Comparison Requirements");

        btn.setText("execute'");
        btn.setOnAction(new EventHandler<ActionEvent>() {

            @Override
            public void handle(ActionEvent event) {

                if (bufferedImage1 != null && bufferedImage2 != null){

                    int startX = -1;
                    int startY = -1;
                    int endX = bufferedImage1.getWidth();
                    int endY = bufferedImage1.getHeight();
                    long col1;
                    long col2;
                    long percent;

                    final BufferedImage newBufferedImage = new BufferedImage(bufferedImage1.getWidth(),
                            bufferedImage1.getHeight(), BufferedImage.TYPE_INT_RGB);
                    Graphics g = newBufferedImage.createGraphics();
                    g.setColor(red);

                    for (int x = 0; x < bufferedImage1.getWidth() - 1; x++) {
                        for (int y = 0; y < bufferedImage1.getHeight() - 1; y++) {
                            col1 = bufferedImage1.getRGB(x, y);
                            col2 = bufferedImage2.getRGB(x, y);
                            percent = col1 * 100 / col2;
                            if (percent > 110 || percent < 90) {
                                if (x > endX + 10) {
                                    g.drawRect(startX, startY, endX - startX, endY - startY);
                                    startX = -1;
                                    startY = -1;
                                    endX = bufferedImage1.getWidth();
                                    endY = bufferedImage1.getHeight();
                                }
                                if (startX == -1) {
                                    startX = x;
                                }
                                if (x <= startX) {
                                    startX = x;
                                }
                                if (startY == -1) {
                                    startY = y;
                                }
                                if (y <= startY) {
                                    startY = y;
                                }
                                if (endX == bufferedImage1.getWidth()) {
                                    endX = x;
                                }
                                if (x >= endX) {
                                    endX = x;
                                }
                                if (endY == bufferedImage1.getHeight()) {
                                    endY = y;
                                }
                                if (y >= endY) {
                                    endY = y;
                                }

                                newBufferedImage.setRGB(x, y, bufferedImage2.getRGB(x, y));
                            } else {
                                newBufferedImage.setRGB(x, y, bufferedImage2.getRGB(x, y));
                            }
                        }
                    }
                    g.drawRect(startX, startY, endX - startX, endY - startY);
                    System.out.println("Готово!");

                    Image image = SwingFXUtils.toFXImage(newBufferedImage, null);
                    ImageView iv1 = new ImageView();
                    iv1.setImage(image);
                    iv1.setFitHeight(500);
                    iv1.setFitWidth(800);
                    vBox.getChildren().add(iv1);

                    Button save = new Button();
                    save.setText("Save file");
                    save.setOnAction(new EventHandler<ActionEvent>() {
                        @Override
                        public void handle(ActionEvent actionEvent) {
                            FileChooser fileChooser = new FileChooser();
                            fileChooser.setTitle("Save Image");
                            File file = fileChooser.showSaveDialog(primaryStage);
View Full Code Here

      @Override
      public Void call(final Appointment appointment)
      {
        // create popup
        final Popup lPopup = new Popup();
        Button lButton = new Button("Close custom popup");
        lButton.setPrefWidth(lImageView.getImage().getWidth());
        lButton.setPrefHeight(lImageView.getImage().getHeight());
        lButton.setOnAction(new EventHandler<ActionEvent>()
        {
          @Override
          public void handle(ActionEvent evt)
          {
            lPopup.hide();
View Full Code Here

  @Override
  public void start(Stage stage)
  {
    VBox lVBox = new VBox(5.0);
    lVBox.add(new Button("short"), new VBox.C().vgrow(Priority.ALWAYS));
    lVBox.add(new Button("medium length"), new VBox.C().vgrow(Priority.ALWAYS));
    lVBox.add(new Button("a longer description in order to test things"), new VBox.C().vgrow(Priority.ALWAYS));
    lVBox.add(new Button("margin 5 grow"), new VBox.C().margin(new Insets(5.0)).vgrow(Priority.ALWAYS));
    lVBox.getChildren().add(new Button("old style"));
    lVBox.add(new Button("margin 20 nogrow"), new VBox.C().margin(new Insets(20.0)));
    lVBox.add(new Button("grow maxwidth 150"), new VBox.C().vgrow(Priority.ALWAYS).maxWidth(150.0));
       
        // setup scene
    Scene scene = new Scene(lVBox, 300, 400);
   
        // create stage
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.