本文整理匯總了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();
}
示例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();
}
示例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();
}
示例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;
}
示例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();
}
示例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();
}
示例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;
}
示例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);
});
}
示例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;");
}
}
示例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();
}
示例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);
}
示例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;
}
示例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);
}
示例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));
}
}
}
}
示例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;
}