本文整理汇总了Java中javafx.stage.Stage.setTitle方法的典型用法代码示例。如果您正苦于以下问题:Java Stage.setTitle方法的具体用法?Java Stage.setTitle怎么用?Java Stage.setTitle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.stage.Stage
的用法示例。
在下文中一共展示了Stage.setTitle方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: showAndWait
import javafx.stage.Stage; //导入方法依赖的package包/类
public static void showAndWait(String url,
Predicate<WebEngine> loginSuccessTest,
Consumer<WebEngine> handler) {
try {
FXMLLoader loader = new FXMLLoader(LoginController.class.getResource("/fxml/login.fxml"));
Stage stage = new Stage();
stage.setScene(new Scene(loader.load()));
LoginController controller = loader.<LoginController>getController();
controller.setUrl(url);
controller.setLoginSuccessTest(loginSuccessTest);
controller.setHandler(handler);
stage.setTitle("Login...");
stage.initModality(Modality.APPLICATION_MODAL);
stage.showAndWait();
} catch (IOException ex) {
throw new RuntimeException(ex);
}
}
示例2: start
import javafx.stage.Stage; //导入方法依赖的package包/类
public void start(Stage primaryStage, Pane rootLayout) throws Exception {
ourStage = primaryStage;
createTrayIcon(primaryStage);
firstTime = true;
Platform.setImplicitExit(false);
primaryStage.setTitle("Fantasy World Manager Web Service - " + App.worldFileUtil.getWorldName());
primaryStage.getIcons().add(new javafx.scene.image.Image(App.retGlobalResource("/src/main/webapp/WEB-INF/images/icons/server/64.png").openStream()));
Scene myScene = new Scene(rootLayout);
myScene.getStylesheets().add(App.retGlobalResource("/src/main/ui/jettyWindowStylesheet.css").toString());
primaryStage.setScene(myScene);
primaryStage.show();
started = true;
showAddress();
showPassword();
radio10.setSelected(WorldConfig.getRad10());
radio15.setSelected(WorldConfig.getRad15());
radioShowAll.setSelected(WorldConfig.getShowAll());
setScene(myScene);
visPasswordVar.toBack();
if(AppConfig.getDarkMode())
{
setDark(true);
}
}
示例3: createDatabaseItemModificationStage
import javafx.stage.Stage; //导入方法依赖的package包/类
/**
* Creates a new JavaFX stage for adding/editing/deleting a {@link DatabaseItem}
*
* @param viewPath the path to the xml file representing the view
* @param stageTitle the title to be shown at the top of the stage
*/
private void createDatabaseItemModificationStage(String viewPath, String stageTitle) {
try {
FXMLLoader loader = new FXMLLoader(getClass().getResource(viewPath));
Stage newStage = new Stage();
newStage.setTitle(stageTitle);
newStage.setScene(new Scene(loader.load()));
DatabaseItemModificationController databaseItemModificationController = loader.getController();
databaseItemModificationController.setNewLogEntryTabController(this);
databaseItemModificationController.setStage(newStage);
newStage.initModality(Modality.APPLICATION_MODAL);
newStage.show();
} catch (IOException e) {
createErrorStage();
e.printStackTrace();
}
}
示例4: openHelp
import javafx.stage.Stage; //导入方法依赖的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();
}
}
});
}
示例5: start
import javafx.stage.Stage; //导入方法依赖的package包/类
@Override
public void start(Stage stage) {
stage.setTitle("Vokabeltrainer");
Scene scene = new Scene(new VBox(), 400, 350);
scene.setFill(Color.OLDLACE);
MenuBar menuBar = new MenuBar();
// --- Menu File
Menu menuFile = new Menu("Vokabeln");
MenuItem sample = new MenuItem("Sample");
sample.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event) {
// Do stuff here
}
});
menuFile.getItems().add(sample);
// --- Menu Edit
Menu menuEdit = new Menu("Abfragemodus");
// --- Menu View
Menu menuView = new Menu("Statistik");
menuBar.getMenus().addAll(menuFile, menuEdit, menuView);
((VBox) scene.getRoot()).getChildren().addAll(menuBar);
stage.setScene(scene);
stage.show();
}
示例6: goToSettings
import javafx.stage.Stage; //导入方法依赖的package包/类
public void goToSettings(double positionX, double positionY) {
try {
Stage SettingsStage = new Stage();
Parent root = FXMLLoader.load(getClass().getResource("/view/Settings.fxml"));
Scene scene = new Scene(root,800,550);
SettingsStage.setScene(scene);
SettingsStage.setResizable(false);
SettingsStage.getIcons().add(new Image(getClass().getResourceAsStream("/imges/purse.png")));
SettingsStage.setTitle("Settings");
SettingsStage.setX(positionX);
SettingsStage.setY(positionY);
SettingsStage.show();
} catch(Exception e) {
e.printStackTrace();
}
}
示例7: start
import javafx.stage.Stage; //导入方法依赖的package包/类
@Override
public void start(Stage mainWin) throws IOException {
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
DEFAULT_HEIGHT = screenSize.height - 100;
DEFAULT_WIDTH = screenSize.width - 100;
teamTabs = new TabPane(); // Initialize the pane with for the tabs
setUpHelp = new GUIHelper(this); // Initialize the GUI helper class
info = setUpHelp.createTextBox("Server not configured!"); // Initialize the textbox
menuBar = setUpHelp.getMenu(info); // Initialize the menubar and the menus
elementSect = new StackPane(); // Initialize the element stackpane
elementSect.getChildren().add(teamTabs); // Add the tabs from teamtabs there
borderPane = new BorderPane(); // Add the border pane
borderPane.setTop(menuBar); // Add stuff to the borders
borderPane.setCenter(elementSect); // But the elementSect in the middle
borderPane.setBottom(info); // Put the textpane in the bottom
Scene scene = new Scene(borderPane, DEFAULT_WIDTH, DEFAULT_HEIGHT); // Create the scene for the height
mainWin.getIcons().add(new Image(ICON_LOC)); // Set the icon as the CyberTiger icon
mainWin.setTitle("CyberTiger Scoreboard"); // Get the window name
mainWin.setScene(scene); // Set the window
mainWin.show(); // Show the window
refreshData(); // Refresh the data since this creates the rest of teh GUI
Timeline scoreboardRefresh = new Timeline(new KeyFrame(Duration.seconds(REFRESH_TIMEOUT), (ActionEvent event) -> {
try {
refreshData(); // Put the refresh method in this method to autorefresh every minute
} catch (IOException ex) { // Catch the exception from the database conn
info.setText("Error refreshing scores! " + ex); // Show the errors
}
}));
scoreboardRefresh.setCycleCount(Timeline.INDEFINITE); // Set the number of times to run
scoreboardRefresh.play(); // Run the timer
}
示例8: GUIController
import javafx.stage.Stage; //导入方法依赖的package包/类
public GUIController(Stage primaryStage) {
try
{
//Load persistent data
artataweDatabase = new DataController();
}
catch (IOException e)
{
//If there was some error loading the data
//Exit early
System.err.println(e.getMessage());
return;
}
this.primaryStage = primaryStage;
primaryStage.setTitle(TITLE);
primaryStage.setScene(new Scene(new LoginScene(artataweDatabase).getPane(),
GUIConstants.LOGIN_WIDTH,GUIConstants.LOGIN_HEIGHT));
primaryStage.show();
centerize();
}
示例9: start
import javafx.stage.Stage; //导入方法依赖的package包/类
@Override
public void start(Stage primaryStage) throws Exception {
primaryStage.setTitle("2DTree Demo");
Group root = new Group();
Canvas canvas = new Canvas(XSIZE, YSIZE);
gc = canvas.getGraphicsContext2D();
canvas.addEventHandler(MouseEvent.MOUSE_CLICKED, new EventHandler<MouseEvent>() {
@Override
public void handle(MouseEvent e) {
gc.fillOval(e.getX(), e.getY(), 3, 3);
double[] coords = { e.getX() / XSIZE, e.getY() / YSIZE };
instance.insert(new HyperPoint(coords));
instance.draw();
}
});
root.getChildren().add(canvas);
Scene sc = new Scene(root);
primaryStage.setScene(sc);
primaryStage.show();
}
示例10: start
import javafx.stage.Stage; //导入方法依赖的package包/类
@Override
public void start(Stage primaryStage) throws Exception{
// Create a new database file if one does not currently exist
DatabaseHelper.createDatabase();
// Creates the main view of the application
FXMLLoader root = new FXMLLoader(getClass().getResource("/view/mainTabPane.fxml"));
primaryStage.setTitle("Recordian");
primaryStage.setScene(new Scene(root.load()));
primaryStage.setOnCloseRequest(event -> Platform.exit());
MainTabPaneController mainTabPaneController = root.getController();
mainTabPaneController.setCurrentStage(primaryStage);
primaryStage.show();
}
示例11: start
import javafx.stage.Stage; //导入方法依赖的package包/类
@Override
public void start(Stage stage) throws Exception {
XYDataset dataset = createDataset();
JFreeChart chart = createChart(dataset);
ChartViewer viewer = new ChartViewer(chart);
stage.setScene(new Scene(viewer));
stage.setTitle("JFreeChart: TimeSeriesFXDemo1.java");
stage.setWidth(700);
stage.setHeight(390);
stage.show();
}
示例12: start
import javafx.stage.Stage; //导入方法依赖的package包/类
@Override public void start(Stage stage) {
VBox pane = new VBox(10, matrixHeatMap1, matrixHeatMap2);
pane.setPadding(new Insets(10));
Scene scene = new Scene(pane);
stage.setTitle("MatrixHeatMap");
stage.setScene(scene);
stage.show();
timer.start();
}
示例13: start
import javafx.stage.Stage; //导入方法依赖的package包/类
@Override
public void start(Stage primaryStage) {
System.setProperty("javax.net.ssl.trustStore", "trustStore" + File.separatorChar + "truststore.jks");
System.setProperty("javax.net.ssl.trustStorePassword", "storePassword");
Scene scene = new Scene(new MainWindow(primaryStage));
scene.getStylesheets().add(getClass().getResource(".." + File.separator + "styles" + File.separator + "Style.css").toExternalForm());
primaryStage.setTitle("FileSender");
primaryStage.setScene(scene);
primaryStage.getIcons().add(new Image(getClass().getResourceAsStream(".." + File.separator + "images" + File.separator + "logo.png")));
primaryStage.setResizable(false);
primaryStage.show();
}
示例14: start
import javafx.stage.Stage; //导入方法依赖的package包/类
@Override
public void start(Stage primaryStage) throws Exception {
primaryStage.setTitle("Train Simulator 2017");
primaryStage.setScene(view.getScene());
primaryStage.show();
view.reset();
}
示例15: start
import javafx.stage.Stage; //导入方法依赖的package包/类
@Override
public void start(Stage primaryStage) {
try {
AnchorPane root = (AnchorPane)FXMLLoader.load(getClass().getResource("LogInScreen.fxml"));
Scene scene = new Scene(root, 340, 370);
scene.getStylesheets().add(getClass().getResource("application.css").toExternalForm());
primaryStage.setTitle("QuickNote Plus - Log in");
primaryStage.setScene(scene);
primaryStage.setResizable(false);
primaryStage.show();
} catch (Exception e) {
e.printStackTrace();
}
}