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


Java ActionEvent类代码示例

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


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

示例1: show

import javafx.event.ActionEvent; //导入依赖的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

示例2: handleSaving

import javafx.event.ActionEvent; //导入依赖的package包/类
@Override
public void handleSaving(ActionEvent event) {
    String name = tfName.getText();
    String projectName = tfProjectName.getText();

    if (StringUtils.isNotEmpty(name)) {
        if (!handler.isGroupNameUnique(name)) {
            Utils.showWarningDialog("Invalid group name", "Group names must be unique. There is already another group with name: \n\n" + name);
            return;
        }

        group = new Group(name, projectName, memberToStringList(tableData), catalogueName);
        if (StringUtils.isNotEmpty(tfExportFileName.getText())) {
            group.setExportFileName(tfExportFileName.getText());
        }
        dismiss();
    } else {
        String msg = "";
        if (!StringUtils.isNotEmpty(name)) {
            msg += "Group name is missing.\n";
        }
        Utils.showWarningDialog("Mandatory field(s) missing", msg);
        return;
    }
}
 
开发者ID:dbisUnibas,项目名称:ReqMan,代码行数:26,代码来源:GroupPropertiesScene.java

示例3: buildExpressionMenuMRU

import javafx.event.ActionEvent; //导入依赖的package包/类
private void buildExpressionMenuMRU() {

        openRecentExpressionFileMenu.getItems().clear();
        List<String> mruExpressionList = squidPersistentState.getMRUExpressionList();
        for (String expressionFileName : mruExpressionList) {
            MenuItem menuItem = new MenuItem(expressionFileName);
            menuItem.setOnAction((ActionEvent t) -> {

                if (!loadExpressionFromXMLFile(new File(menuItem.getText()))) {
                    squidPersistentState.removeExpressionFileNameFromMRU(menuItem.getText());
                    squidPersistentState.cleanExpressionListMRU();
                    openRecentExpressionFileMenu.getItems().remove(menuItem);
                }
            });
            openRecentExpressionFileMenu.getItems().add(menuItem);
        }
    }
 
开发者ID:CIRDLES,项目名称:Squid,代码行数:18,代码来源:SquidUIController.java

示例4: refreshList

import javafx.event.ActionEvent; //导入依赖的package包/类
@FXML
public void refreshList(ActionEvent event) throws IOException {

    problems.getItems().clear();

    try {
        String query = "select * from problem";
        result = statement.executeQuery(query);

        while (result.next()) {
            String description = result.getString("title");
            items.add(description);
        }
    } catch (SQLException ex) {
        System.out.println(ex);
    }

}
 
开发者ID:ioaktheo,项目名称:community-In-Action,代码行数:19,代码来源:FXMLDocumentController.java

示例5: connectToPhone

import javafx.event.ActionEvent; //导入依赖的package包/类
@FXML
public void connectToPhone(ActionEvent event) {
    String address = phoneAddress.getText();
    String code = securityCode.getText();
    preferences.setPhoneAddress(address);
    final ConversationService conversationService = 
            ConversationService.getInstance();

    conversationService.setPhoneAddress(address);
    Optional<String> token = conversationService
            .getAuthorization(code);
    if (token.isPresent()) {
        preferences.setToken(token.get());
        closeDialog(event);
    }
}
 
开发者ID:PacktPublishing,项目名称:Java-9-Programming-Blueprints,代码行数:17,代码来源:ConnectToPhoneController.java

示例6: onCloseRequest

import javafx.event.ActionEvent; //导入依赖的package包/类
private void onCloseRequest() {
    final char borderSign = Properties.getPropertyForTestdataApplication(KEY__TESTDATA_APPLICATION__BORDER_SIGN).charAt(0);
    final String message = Properties.getPropertyForTestdataApplication(KEY__TESTDATA_APPLICATION__MESSAGE_STOP);
    final String title = Properties.getPropertyForTestdataApplication(KEY__TESTDATA_APPLICATION__TITLE);
    LoggerFacade.getDefault().message(borderSign, 80, message + title);
    
    try {
        TestdataFacade.getDefault().shutdown();
    } catch (InterruptedException e) {
    }
    
    Injector.forgetAll();
    DatabaseFacade.getDefault().shutdown();
    
    final PauseTransition pt = new PauseTransition(LITTLE_DELAY__DURATION_125);
    pt.setOnFinished((ActionEvent event) -> {
        Platform.exit();
    });
    pt.playFromStart();
}
 
开发者ID:Naoghuman,项目名称:ABC-List,代码行数:21,代码来源:TestdataApplication.java

示例7: openHelp

import javafx.event.ActionEvent; //导入依赖的package包/类
@FXML
public void openHelp(ActionEvent event) throws IOException {
    Parent root = FXMLLoader.load(getClass().getResource("/fxml/helpPopup.fxml"));
    final Scene scene = new Scene(root);
    final Stage stage = new Stage();
    stage.setTitle("Help");
    stage.setScene(scene);
    stage.show();
    stage.setResizable(false);
    stage.centerOnScreen();

    root.setOnKeyPressed(new EventHandler<KeyEvent>() {
        public void handle(KeyEvent ke) {
            if (ke.getCode() == KeyCode.ESCAPE) {
                System.out.println("Key Pressed: " + ke.getCode());
                stage.close();
            }
        }
    });
}
 
开发者ID:dewarian,项目名称:FYS_T3,代码行数:21,代码来源:homepageController.java

示例8: openHome

import javafx.event.ActionEvent; //导入依赖的package包/类
@FXML
public void openHome(ActionEvent event) throws IOException {
    MyJDBC.createTestDatabase("shabo");
    Node node = (Node) event.getSource();
    final Stage stage = (Stage) node.getScene().getWindow();
    Parent root = FXMLLoader.load(getClass().getResource("/fxml/Homepage.fxml"));
    Scene scene = new Scene(root);
    stage.setScene(scene);
    stage.show();
    stage.centerOnScreen();

    final Parent home = FXMLLoader.load(getClass().getResource("/fxml/Homepage.fxml"));
    final Scene hScene = new Scene(home);
    root.setOnKeyPressed(new EventHandler<KeyEvent>() {
        public void handle(KeyEvent ke) {
            if (ke.getCode() == KeyCode.ESCAPE) {
                System.out.println("Key Pressed: " + ke.getCode() + " Made by ShaMaster");
                stage.setScene(hScene);
            }
        }
    });
}
 
开发者ID:dewarian,项目名称:FYS_T3,代码行数:23,代码来源:contactController.java

示例9: buildProjectMenuMRU

import javafx.event.ActionEvent; //导入依赖的package包/类
private void buildProjectMenuMRU() {
    openRecentSquidProjectMenu.setDisable(false);

    openRecentSquidProjectMenu.getItems().clear();
    List<String> mruProjectList = squidPersistentState.getMRUProjectList();
    for (String projectFileName : mruProjectList) {
        MenuItem menuItem = new MenuItem(projectFileName);
        menuItem.setOnAction((ActionEvent t) -> {
            try {
                openProject(menuItem.getText());
            } catch (IOException iOException) {
                squidPersistentState.removeProjectFileNameFromMRU(menuItem.getText());
                squidPersistentState.cleanProjectListMRU();
                openRecentSquidProjectMenu.getItems().remove(menuItem);
            }
        });
        openRecentSquidProjectMenu.getItems().add(menuItem);
    }
}
 
开发者ID:CIRDLES,项目名称:Squid,代码行数:20,代码来源:SquidUIController.java

示例10: autoUpdateToggleBtnAction

import javafx.event.ActionEvent; //导入依赖的package包/类
@FXML
void autoUpdateToggleBtnAction(ActionEvent event) {
	if (isAutoUpdate()) {
		setAutoUpdate(false);
	} else {
		setAutoUpdate(true);
	}
	saveSettings();
}
 
开发者ID:Seil0,项目名称:cemu_UI,代码行数:10,代码来源:MainWindowController.java

示例11: runProcessHandler

import javafx.event.ActionEvent; //导入依赖的package包/类
@FXML
public void runProcessHandler(final ActionEvent event) {
    final TextInputDialog inputDlg = new TextInputDialog();
    inputDlg.setTitle("Run command...");
    inputDlg.setContentText("Command Line:");
    inputDlg.setHeaderText(null);
    inputDlg.showAndWait().ifPresent(c -> {
        try {
            new ProcessBuilder(c).start();
            processListUpdater.updateList();
        } catch (IOException e) {
            new Alert(Alert.AlertType.ERROR, "There was an error running your command.").show();
        }
    });
}
 
开发者ID:PacktPublishing,项目名称:Java-9-Programming-Blueprints,代码行数:16,代码来源:Controller.java

示例12: kaydetButonuTiklandi

import javafx.event.ActionEvent; //导入依赖的package包/类
@FXML
  private void kaydetButonuTiklandi(ActionEvent event) throws IOException
  {
int kacGun=Integer.parseInt(maksimumGun.getText());
double ceza=Double.parseDouble(cezaGun.getText());
String kadi=kullaniciAdi.getText();
String pass=sifreAdi.getText();

  	Secimler secimler=Secimler.getSecimler();
  	secimler.setMaksimumGunSayisi(kacGun);
  	secimler.setGunBasiCeza(ceza);
  	secimler.setKullaniciadi(kadi);
  	secimler.setPassword(pass);
  	
  	secimler.writeToFile(secimler);
  }
 
开发者ID:mevlanayalcin,项目名称:KutuphaneOtomasyonSistemi,代码行数:17,代码来源:AyarlarController.java

示例13: saveSpotNameAction

import javafx.event.ActionEvent; //导入依赖的package包/类
@FXML
private void saveSpotNameAction(ActionEvent event) {
    if (saveSpotNameButton.getUserData() != null) {
        ((PrawnFile.Run) saveSpotNameButton.getUserData()).getPar().get(0).setValue(selectedSpotNameText.getText().trim());
        squidProject.processPrawnSessionForDuplicateSpotNames();
        squidProject.generatePrefixTreeFromSpotNames();
        shrimpFractionList.refresh();
        shrimpRefMatList.refresh();
        shrimpConcentrationRefMatList.refresh();

        // refresh textbox in case "DUP" is removed or created
        selectedSpotNameText.setText(((PrawnFile.Run) saveSpotNameButton.getUserData()).getPar().get(0).getValue());
    }
}
 
开发者ID:CIRDLES,项目名称:Squid,代码行数:15,代码来源:SpotManagerController.java

示例14: handleExportGroups

import javafx.event.ActionEvent; //导入依赖的package包/类
@Override
public void handleExportGroups(ActionEvent event) {
    if (!evaluatorHandler.isGroupLoaded()) {
        return;
    }
    evaluatorHandler.exportAllGroups();
}
 
开发者ID:dbisUnibas,项目名称:ReqMan,代码行数:8,代码来源:MainHandler.java

示例15: mnuBankSettings

import javafx.event.ActionEvent; //导入依赖的package包/类
@FXML
private void mnuBankSettings(ActionEvent event) {
	(new TabAccess()).setTabName("tabBank");
	Stage AboutStage = (Stage) btnSignOut.getScene().getWindow();
	(new GoToOperation()).goToSettings(AboutStage.getX(), AboutStage.getY());
	AboutStage.close();
}
 
开发者ID:krHasan,项目名称:Money-Manager,代码行数:8,代码来源:AboutController.java


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