当前位置: 首页>>代码示例>>Java>>正文


Java JFXButton类代码示例

本文整理汇总了Java中com.jfoenix.controls.JFXButton的典型用法代码示例。如果您正苦于以下问题:Java JFXButton类的具体用法?Java JFXButton怎么用?Java JFXButton使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


JFXButton类属于com.jfoenix.controls包,在下文中一共展示了JFXButton类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: showInfoDialog

import com.jfoenix.controls.JFXButton; //导入依赖的package包/类
public void showInfoDialog(){
    JFXDialogLayout content = new JFXDialogLayout();
    content.setHeading(new Text("Information"));
    content.setBody(new Text("We are going to open your default browser window to let \n" +
            "you choose the gmail account , allow the specified permissions\n" +
            "and then close the window."));
    JFXDialog dialog = new JFXDialog(myController, content, JFXDialog.DialogTransition.CENTER);
    JFXButton button = new JFXButton("Okay");
    button.setOnAction(new EventHandler<ActionEvent>() {
        @Override
        public void handle(ActionEvent event) {
            dialog.close();
            SplashWaitController.startBackgroundTasks();
            myController.setScreen(AmailMain.splashWaitId);

        }
    });
    content.setActions(button);
    dialog.show();
}
 
开发者ID:ashoknailwal,项目名称:desktop-gmail-client,代码行数:21,代码来源:SplashGuideController.java

示例2: show

import com.jfoenix.controls.JFXButton; //导入依赖的package包/类
public void show() {
	textArea = new JFXTextArea(bodyText);
	
	JFXDialogLayout content = new JFXDialogLayout();
	content.setHeading(new Text(headingText));
	content.setBody(textArea);
	content.setPrefSize(dialogWidth, dialogHeight);
	StackPane stackPane = new StackPane();
	stackPane.autosize();
	JFXDialog dialog = new JFXDialog(stackPane, content, JFXDialog.DialogTransition.LEFT, true);
	JFXButton button = new JFXButton("Okay");
	button.setOnAction(new EventHandler<ActionEvent>() {
		@Override
		public void handle(ActionEvent event) {
			dialog.close();
		}
	});
	button.setButtonType(com.jfoenix.controls.JFXButton.ButtonType.RAISED);
	button.setPrefHeight(32);
	button.setStyle(dialogBtnStyle);
	content.setActions(button);
	pane.getChildren().add(stackPane);
	AnchorPane.setTopAnchor(stackPane, (pane.getHeight() - content.getPrefHeight()) / 2);
	AnchorPane.setLeftAnchor(stackPane, (pane.getWidth() - content.getPrefWidth()) / 2);
	dialog.show();
}
 
开发者ID:Seil0,项目名称:cemu_UI,代码行数:27,代码来源:JFXTextAreaInfoDialog.java

示例3: start

import com.jfoenix.controls.JFXButton; //导入依赖的package包/类
@Override
public void start(Stage s) throws IOException, InterruptedException
{ 
    root = FXMLLoader.load(getClass().getResource("gui.fxml"));
    guisc = new Scene(root, 600, 400);
    s.setScene(guisc);
    s.setTitle("Plasmoxy::ThunderLord/DafuqFX");
    s.setResizable(false);
    s.sizeToScene();
    s.show();

    JFXButton blyat = (JFXButton) guisc.lookup("#blyat");
    blyat.setText("ASDASDASDASDASDASD");
    
    main.init(this, guisc);
    main.go();
    
}
 
开发者ID:Plasmoxy,项目名称:AquamarineLake,代码行数:19,代码来源:App.java

示例4: addFileChoosers

import com.jfoenix.controls.JFXButton; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public WizardStepBuilder addFileChoosers(final String fieldName, final String fileChooseLabel,
        final String startDir, final FileChooser.ExtensionFilter... filters)
{
    final WizardStep current = this.current;
    final HBox box = new HBox();
    final JFXButton button = new JFXButton(fileChooseLabel);
    button.setStyle("-fx-text-fill: BLACK;-fx-font-size: 18px;-fx-opacity: 0.7;");
    final FileChooser fileChooser = new FileChooser();
    fileChooser.setTitle(fileChooseLabel);
    fileChooser.setInitialDirectory(new File(startDir));
    fileChooser.getExtensionFilters().addAll(filters);
    this.current.getData().put(fieldName, new SimpleSetProperty<File>());

    button.setOnAction(e -> current.getData().get(fieldName)
            .setValue(fileChooser.showOpenMultipleDialog(MineIDE.primaryStage)));

    final Label label = new Label(fieldName);
    GridPane.setHalignment(label, HPos.RIGHT);
    GridPane.setHalignment(button, HPos.LEFT);
    this.current.add(label, 0, this.current.getData().size() - 1);

    final JFXTextField text = new JFXTextField();
    text.setEditable(false);
    ((SimpleSetProperty<File>) this.current.getData().get(fieldName))
            .addListener((SetChangeListener<File>) change ->
            {
                text.setText("");
                change.getSet().forEach(file -> text.appendText(file.getAbsolutePath() + ", "));
                text.setText(text.getText().substring(0, text.getText().length() - 2));
            });

    box.getChildren().addAll(text, button);
    this.current.add(box, 1, this.current.getData().size() - 1);
    return this;
}
 
开发者ID:Leviathan-Studio,项目名称:MineIDE,代码行数:37,代码来源:WizardStepBuilder.java

示例5: show

import com.jfoenix.controls.JFXButton; //导入依赖的package包/类
public void show() {
	JFXDialogLayout content = new JFXDialogLayout();
	content.setHeading(new Text(headingText));
	content.setBody(new Text(bodyText));
	content.setPrefSize(dialogWidth, dialogHeight);
	StackPane stackPane = new StackPane();
	stackPane.autosize();
	JFXDialog dialog = new JFXDialog(stackPane, content, JFXDialog.DialogTransition.LEFT, true);
	JFXButton button = new JFXButton("Okay");
	button.setOnAction(new EventHandler<ActionEvent>() {
		@Override
		public void handle(ActionEvent event) {
			dialog.close();
		}
	});
	button.setButtonType(com.jfoenix.controls.JFXButton.ButtonType.RAISED);
	button.setPrefHeight(32);
	button.setStyle(dialogBtnStyle);
	content.setActions(button);
	pane.getChildren().add(stackPane);
	AnchorPane.setTopAnchor(stackPane, (pane.getHeight() - content.getPrefHeight()) / 2);
	AnchorPane.setLeftAnchor(stackPane, (pane.getWidth() - content.getPrefWidth()) / 2);
	dialog.show();
}
 
开发者ID:Seil0,项目名称:cemu_UI,代码行数:25,代码来源:JFXInfoDialog.java

示例6: showDialog

import com.jfoenix.controls.JFXButton; //导入依赖的package包/类
public void showDialog() {
    JFXDialogLayout jfxDialogLayout = new JFXDialogLayout();
    jfxDialogLayout.setHeading(new Text(header));
    jfxDialogLayout.setBody(new Text(content));
    JFXDialog jfxDialog = new JFXDialog(stackPane, jfxDialogLayout, JFXDialog.DialogTransition.CENTER);
    JFXButton okay = new JFXButton(buttonLabel);
    okay.setPrefWidth(110);
    okay.setStyle("-fx-background-color: #F39C12; -fx-text-fill: white;");
    okay.setButtonType(JFXButton.ButtonType.RAISED);
    okay.setOnAction(event -> {
        jfxDialog.close();
        stackPane.setVisible(false);
    });
    stackPane.setOnMouseClicked(event -> stackPane.setVisible(false));
    jfxDialogLayout.setActions(okay);
    jfxDialog.show();
}
 
开发者ID:victorward,项目名称:recruitervision,代码行数:18,代码来源:MaterialDialog.java

示例7: build

import com.jfoenix.controls.JFXButton; //导入依赖的package包/类
public Button build(String name, Association association) {

        EventBus eventBus = toolBox.getEventBus();

        Button button = new JFXButton(name);
        button.setUserData(association);
        button.getStyleClass().add("abpanel-button");
        button.setOnAction(event -> {
            ArrayList<Annotation> annotations = new ArrayList<>(toolBox.getData().getSelectedAnnotations());
            eventBus.send(new CreateAssociationsCmd(association, annotations));
        });
        button.setTooltip(new Tooltip(association.toString()));

        ContextMenu contextMenu = new ContextMenu();
        MenuItem deleteButton = new MenuItem(toolBox.getI18nBundle().getString("cbpanel.conceptbutton.delete"));
        deleteButton.setOnAction(event ->
                ((Pane) button.getParent()).getChildren().remove(button));
        contextMenu.getItems().addAll(deleteButton);
        button.setContextMenu(contextMenu);

        return button;

    }
 
开发者ID:mbari-media-management,项目名称:vars-annotation,代码行数:24,代码来源:AssocButtonFactory.java

示例8: start

import com.jfoenix.controls.JFXButton; //导入依赖的package包/类
@Override
public void start(Stage primaryStage) throws Exception {
    MediaService mediaService = DemoConstants.newMediaService();
    AnnotationService annotationService = DemoConstants.newAnnotationService();

    Label label = new Label();
    Button button = new JFXButton("Browse");
    Dialog<Media> dialog = new SelectMediaDialog(annotationService,
            mediaService, uiBundle);
    button.setOnAction(e -> {
        Optional<Media> media = dialog.showAndWait();
        media.ifPresent(m -> label.setText(m.getUri().toString()));
    });

    VBox vBox = new VBox(label, button);
    Scene scene = new Scene(vBox, 400, 200);
    primaryStage.setScene(scene);
    primaryStage.show();

    primaryStage.setOnCloseRequest(e -> {
        Platform.exit();
        System.exit(0);
    });

}
 
开发者ID:mbari-media-management,项目名称:vars-annotation,代码行数:26,代码来源:SelectMediaDialogDemo.java

示例9: valueSetter

import com.jfoenix.controls.JFXButton; //导入依赖的package包/类
private void valueSetter(JFXButton btn, int serial) { //Will Change Button Appearance on click
    if (!clicked[serial]) {
        clicked[serial] = true;
        edges[serial].setDisable(false);
        edges[serial].setText("1");

        btn.setStyle("-fx-background-color: " + colors[serial]
                + "; -fx-border-color: #FF0000; -fx-border-width: 3;"
                + " -fx-background-radius: 10 10 10 10;"
                + "; -fx-border-radius: 10 10 10 10;");
    } else {
        clicked[serial] = false;
        edges[serial].setDisable(true);
        edges[serial].setText("∞");
        btn.setStyle("-fx-background-color: " + colors[serial]
                + "; -fx-border-color: #000000;"
                + " -fx-background-radius: 10 10 10 10;"
                + "; -fx-border-radius: 10 10 10 10;");
    }
}
 
开发者ID:afifaniks,项目名称:FloydWarshallSimulation,代码行数:21,代码来源:ManualInputController.java

示例10: setDialouge

import com.jfoenix.controls.JFXButton; //导入依赖的package包/类
public static void setDialouge(JFXButton applyButton , String heading , String text , Node ob) {
	
	JFXButton button = applyButton;
	
	content.setHeading(new Text(heading));
	content.setBody(new Text(text));
	
	JFXDialog dialoge = new JFXDialog(pane, content, JFXDialog.DialogTransition.CENTER);
	button.addEventHandler(MouseEvent.MOUSE_CLICKED, (e6) -> {
		dialoge.close();
	});
	
	content.setActions(ob, button);
	
	// To show overlay dialougge box
	dialoge.show();
}
 
开发者ID:badarshahzad,项目名称:Jfx-Browser,代码行数:18,代码来源:Main.java

示例11: showMaterialDialog

import com.jfoenix.controls.JFXButton; //导入依赖的package包/类
public static void showMaterialDialog(StackPane root, Node nodeToBeBlurred, List<JFXButton> controls, String header, String body) {
    BoxBlur blur = new BoxBlur(3, 3, 3);

    JFXDialogLayout dialogLayout = new JFXDialogLayout();
    JFXDialog dialog = new JFXDialog(root, dialogLayout, JFXDialog.DialogTransition.TOP);
    
    controls.forEach(controlButton->{
        controlButton.getStyleClass().add("dialog-button");
        controlButton.addEventHandler(MouseEvent.MOUSE_CLICKED, (MouseEvent mouseEvent) -> {
            dialog.close();
        });
    });

    dialogLayout.setHeading(new Label(header));
    dialogLayout.setBody(new Label(body));
    dialogLayout.setActions(controls);
    dialog.show();
    dialog.setOnDialogClosed((JFXDialogEvent event1) -> {
        nodeToBeBlurred.setEffect(null);
    });
    nodeToBeBlurred.setEffect(blur);
}
 
开发者ID:afsalashyana,项目名称:Library-Assistant,代码行数:23,代码来源:AlertMaker.java

示例12: createMainMenuButtton

import com.jfoenix.controls.JFXButton; //导入依赖的package包/类
private JFXButton createMainMenuButtton() {
	// TODO find out why this does not work:
	// RfxPrimaryButton mainMenuButton = new
	// RfxPrimaryButton(FontAwesomeIconName.BARS);
	// mainMenuButton.setOnAction(this::onMainMenuButton);
	// return mainMenuButton;

	JFXButton button = new JFXButton();
	FontAwesomeIcon icon = new FontAwesomeIcon();
	icon.setIcon(de.jensd.fx.glyphs.fontawesome.FontAwesomeIconName.BARS);
	icon.setSize("17px");
	String iconStyle = icon.getStyle() + ";" + new RfxStyleProperties()
			.setFill(MaterialColorSetCssName.PRIMARY.FOREGROUND1()).toString();
	icon.setStyle(iconStyle);

	// RfxFontIcon icon=new RfxFontIcon(FontAwesomeIconName.BARS, 16,
	// Color.WHITE);
	button.setGraphic(icon);
	button.setPadding(new Insets(8, 16, 8, 17));
	// button.getStyleClass().add("button-flat");
	button.setOnAction(this::onMainMenuButton);
	return button;

}
 
开发者ID:ntenhoeve,项目名称:Introspect-Framework,代码行数:25,代码来源:RfxAppButtonBar.java

示例13: initVariables

import com.jfoenix.controls.JFXButton; //导入依赖的package包/类
private void initVariables(){
    componentParent = new StackPane();
    subjectLabel = new Label();
    toFromLabel = new Label();
    dateLabel = new Label();
    messageDisplay = new WebView();
    messageEngine = messageDisplay.getEngine();
    messageEngine.setJavaScriptEnabled(true);
    attachments = new JFXButton("Attachments");
    messageTextArea = new TextArea();
    replyButton = new JFXButton("Send");
    editDraft = new JFXButton("Edit");
    forwardSent = new JFXButton("Edit");
    restore = new JFXButton("Restore");
    deleteInboxMessage = new JFXButton();
    deleteSentMessage = new JFXButton();
    ImageView deleteImage = new ImageView(new Image(getClass().getResourceAsStream("/delete.png")));
    deleteImage.setFitWidth(20);
    deleteImage.setFitHeight(20);
    deleteInboxMessage.setGraphic(deleteImage);
    deleteSentMessage.setGraphic(deleteImage);
    zoomMail = new JFXButton("Zoom");
    setButtonStyle(zoomMail);
    forwardInbox = new JFXButton("Forward");
    setButtonStyle(forwardInbox);
}
 
开发者ID:ashoknailwal,项目名称:desktop-gmail-client,代码行数:27,代码来源:ScreenComponent.java

示例14: buyClicked

import com.jfoenix.controls.JFXButton; //导入依赖的package包/类
public void buyClicked(MouseEvent mouseEvent) {
    JFXButton button = (JFXButton) mouseEvent.getSource();
    JFXRadioButton selectedRadio = (JFXRadioButton)group.getSelectedToggle();
    String launderingTool = selectedRadio.getText();
    if ((button).getText().equals("Buy!")){
        for(int i = 0; i < crimeSize; i++)
        {
            if(selectedRadio.getText().equals(GameEngine.getCrimes.get(i).getDescription()))
            {
                GameEngine.purchaseAsset(GameEngine.getCrimes.get(i));
            }
        }
    }
}
 
开发者ID:gokcan,项目名称:Mafia-TCoS-CS319-Group2A,代码行数:15,代码来源:LaunderingController.java

示例15: addFileChooser

import com.jfoenix.controls.JFXButton; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public WizardStepBuilder addFileChooser(final String fieldName, final String fileChooseLabel, final String startDir,
        final FileChooser.ExtensionFilter... filters)
{
    final WizardStep current = this.current;
    final HBox box = new HBox();
    final JFXButton button = new JFXButton(fileChooseLabel);
    button.setStyle("-fx-text-fill: BLACK;-fx-font-size: 18px;-fx-opacity: 0.7;");
    final FileChooser fileChooser = new FileChooser();
    fileChooser.setTitle(fileChooseLabel);
    fileChooser.setInitialDirectory(new File(startDir));
    fileChooser.getExtensionFilters().addAll(filters);
    this.current.getData().put(fieldName, new SimpleObjectProperty<File>());

    button.setOnAction(
            e -> current.getData().get(fieldName).setValue(fileChooser.showOpenDialog(MineIDE.primaryStage)));

    final Label label = new Label(fieldName);
    GridPane.setHalignment(label, HPos.RIGHT);
    GridPane.setHalignment(button, HPos.LEFT);
    this.current.add(label, 0, this.current.getData().size() - 1);

    final JFXTextField text = new JFXTextField();
    text.setEditable(false);
    this.current.getData().get(fieldName).addListener(
            (ChangeListener<File>) (observable, oldValue, newValue) -> text.setText(newValue.getAbsolutePath()));

    box.getChildren().addAll(text, button);
    this.current.add(box, 1, this.current.getData().size() - 1);
    return this;
}
 
开发者ID:Leviathan-Studio,项目名称:MineIDE,代码行数:32,代码来源:WizardStepBuilder.java


注:本文中的com.jfoenix.controls.JFXButton类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。