javafx-2

How to make a Text content disappear after some time in JavaFX?

岁酱吖の 提交于 2021-02-06 09:31:13
问题 b1.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent e) { try { Class.forName("com.mysql.jdbc.Driver"); connect = DriverManager .getConnection("jdbc:mysql://localhost:3306/project?" + "user=root&password=virus"); statement = connect.createStatement(); preparedStatement = connect .prepareStatement("select * from mark where clsnum = " + txt1.getText() + ""); rs = preparedStatement.executeQuery(); if (rs.next()) { delete(); } else { msg.setText("Student Not

Drag & Drop in JavaFX table?

ε祈祈猫儿з 提交于 2021-01-28 02:01:42
问题 I am using a JavaFX 2 table for some kind of playlist and I want to be able to drag & drop rows in the table, e.g. drag row 3 before row 2, like the drag & drop stuff you know from the playlists in typical media players like e.g. Winamp, AIMP... Is that possible? Any code samples for that? Thank you very much! 回答1: try this one :) @FXML TableView<String> tableView; private ObservableList<String> tableContent = FXCollections.observableArrayList(); //... tableView.setOnMouseClicked(new

Subclassing JavaFX Stage / Scene

萝らか妹 提交于 2021-01-27 23:49:24
问题 Coming from Swing and being new to JavaFX I tried to subclass Java FX Stages and Scenes. However I quickly run into problems, like the init method not being of my subclassed sceen not being found during the initialization. So I was wondering: Are Java FX Stages and Sceens to be subclassed like one would subclass JFrames and JPanels in Swing or is this discouraged? 回答1: You can subclass Scene and Stage and many other FX library classes in pretty much the same way. I'm not sure I'd recommend it

How to set alignment in a JavaFX TextField?

人走茶凉 提交于 2021-01-03 06:36:56
问题 I need to set allignment of the text in a TextField to right. There is no such under TextField. Anybody knows how to set alignment in a textfield in javaFX 2.0 ? Thanks 回答1: In JavaFX 2.0, it may not have been possible, but it is in JavaFX 2.1 and ownward using the alignment property. textField.setAlignment(Pos.CENTER_RIGHT); 回答2: Currently It does not have a support on text field alignment. I reported this issue to javafx jira team and this feature will be added in version 2.1. Here is the

How to set alignment in a JavaFX TextField?

和自甴很熟 提交于 2021-01-03 06:36:44
问题 I need to set allignment of the text in a TextField to right. There is no such under TextField. Anybody knows how to set alignment in a textfield in javaFX 2.0 ? Thanks 回答1: In JavaFX 2.0, it may not have been possible, but it is in JavaFX 2.1 and ownward using the alignment property. textField.setAlignment(Pos.CENTER_RIGHT); 回答2: Currently It does not have a support on text field alignment. I reported this issue to javafx jira team and this feature will be added in version 2.1. Here is the

How to set alignment in a JavaFX TextField?

允我心安 提交于 2021-01-03 06:36:41
问题 I need to set allignment of the text in a TextField to right. There is no such under TextField. Anybody knows how to set alignment in a textfield in javaFX 2.0 ? Thanks 回答1: In JavaFX 2.0, it may not have been possible, but it is in JavaFX 2.1 and ownward using the alignment property. textField.setAlignment(Pos.CENTER_RIGHT); 回答2: Currently It does not have a support on text field alignment. I reported this issue to javafx jira team and this feature will be added in version 2.1. Here is the

JavaFX 2 TreeView Styling - lines from parents to children

落爺英雄遲暮 提交于 2020-12-30 02:22:45
问题 I have a pretty big structure of data, which I want to show in the TreeView. When a lot of branches and sub-branches are opened, it's not clear what belongs to what. Is there a way (CSS?) how to style the TreeView, so it will be showing the lines from parents to children like in Swing? Thank you for any ideas... 来源: https://stackoverflow.com/questions/33297616/javafx-2-treeview-styling-lines-from-parents-to-children

JavaFX 2 TreeView Styling - lines from parents to children

五迷三道 提交于 2020-12-30 02:12:39
问题 I have a pretty big structure of data, which I want to show in the TreeView. When a lot of branches and sub-branches are opened, it's not clear what belongs to what. Is there a way (CSS?) how to style the TreeView, so it will be showing the lines from parents to children like in Swing? Thank you for any ideas... 来源: https://stackoverflow.com/questions/33297616/javafx-2-treeview-styling-lines-from-parents-to-children

JavaFX 2 TreeView Styling - lines from parents to children

情到浓时终转凉″ 提交于 2020-12-30 02:12:02
问题 I have a pretty big structure of data, which I want to show in the TreeView. When a lot of branches and sub-branches are opened, it's not clear what belongs to what. Is there a way (CSS?) how to style the TreeView, so it will be showing the lines from parents to children like in Swing? Thank you for any ideas... 来源: https://stackoverflow.com/questions/33297616/javafx-2-treeview-styling-lines-from-parents-to-children

Is JavaFX complete replacement of Swing?

强颜欢笑 提交于 2020-08-01 09:32:05
问题 I had a Java Desktop Application in which graphical user interface had designed in swing. After we came to know that JavaFX replacing Swing We have replaced graphical user interface with JavaFX. "6. Is JavaFX replacing Swing as the new client UI library for Java SE? Yes. However, Swing will remain part of the Java SE specification for the foreseeable future, and is included in the JRE. On one hand, Swing is widely used in existing Java desktop applications, but relies on an old architecture,