javafx-8

scenebuilder layer classnotfound

一笑奈何 提交于 2019-12-02 12:06:48
I'm having problem. I used SceneBuilder and JavaFX. When I used layer in SceneBuilder and I tried to load it in java. I've got the error message below: javafx.fxml.LoadException: /C:/Projects/des_project2/target/classes/view/user/UserMainView.fxml at javafx.fxml.FXMLLoader.constructLoadException(FXMLLoader.java:2601) at javafx.fxml.FXMLLoader.importClass(FXMLLoader.java:2848) at javafx.fxml.FXMLLoader.processImport(FXMLLoader.java:2692) at javafx.fxml.FXMLLoader.processProcessingInstruction(FXMLLoader.java:2661) at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2517) at javafx.fxml.FXMLLoader

JavaFX : TableView inside Dialog has duplicate items

大憨熊 提交于 2019-12-02 11:04:20
I have an issue with my TableView and its items. I have created a small Dialog window to display warnings about my app, and inside the Dialog I have a TableView which displays the name of the warning and some information about it upon clicking on a button. I have created a WarningUtil class ( Singleton pattern) just to open / close the Dialog . The relevant code follows. The constructor of the WarningUtil class (called once only) : private WarningUtil(RootCtrl rootCtrl) { this.rootCtrl = rootCtrl; warnings = new HashMap<>(); setupWarningCallbacks(); // not relevant setupTable(); setupColumns()

What the easiest way to animate a Path as an object traverses it?

社会主义新天地 提交于 2019-12-02 10:48:20
问题 Consider a rectangle traversing a long, linear path. It would be useful to figure out where the shape had gone earlier in the animation. Displaying the entire path before the shape moves is not what I want. That is easily done by adding the path to the pane. I want a trailing line behind the shape representing the path that the shape has traversed through so far. Does anyone know how to do this in Javafx? I am using Path and PathTransition to animate my object along a path. 回答1: There are

Java fxml app not working - Cannot find symbol error

橙三吉。 提交于 2019-12-02 10:45:18
i downloaded a java fxml app from https://github.com/HassanAlthaf/AlarmApplication and when i try to run it a get a "cannot find symbol" error from the MainView.java class. Here is the code from the Mainview.java file import java.net.URL; import java.util.ResourceBundle; import javafx.event.ActionEvent; import javafx.fxml.FXML; import javafx.fxml.Initializable; import javafx.scene.control.Alert; import javafx.scene.control.Alert.AlertType; import javafx.scene.control.TextField; public class MainView implements Initializable { @FXML private TextField hoursField; @FXML private TextField

In JavaFX how to add combobox with data in table view

两盒软妹~` 提交于 2019-12-02 10:39:12
I have tried a lot but not able to populate all values in the data base into my combo box table cell. Controller.java public class controller { GetConnection gc = new GetConnection(); PreparedStatement pst; ResultSet rs; Statement st; private ObservableList<Users> datas = FXCollections.observableArrayList(); public controller() { } @FXML private TableView<Users> table; @FXML private TableColumn<Users, String> c1; @FXML private void editable() { List<String> names = new ArrayList<String>(); try { ObservableList<Users> datas = FXCollections.observableArrayList(); String sql = "select * from

dynamically populate ChoiceBox from editable column in TableView

…衆ロ難τιáo~ 提交于 2019-12-02 10:25:33
Basically the question title says it all. I have a column of strings (called type ) in a tableview and a corresponding column of numbers (called size ), each row representing an object CargoItem , which has the two properties type and size . Both columns are editable. The TableView is associated with the corresponding observable list of CargoItem , called cargoList . A ChoiceBox is initially set to the observable list. I have a listener attached to the ChoiceBox, so it can update a TextField with the corresponding size attribute. This works OK: if you type a new value into a cell in the size

JavaFX 8, ListView with Checkboxes scrollpane issue

偶尔善良 提交于 2019-12-02 10:14:19
I am using cell factory for listview with checkboxes like: listView.setCellFactory(CheckBoxListCell.forListView(new Callback < Bean, ObservableValue < Boolean >> () { @Override public ObservableValue < Boolean > call(Bean item) { BooleanProperty observable = new SimpleBooleanProperty(); observable.addListener((obs, wasSelected, isNowSelected) -> { if (isNowSelected) { if (!beanChoices.contains(item.toString())) { beanChoices.add(item.toString()); observable.setValue(true); //listView.scrollTo(listView.getItems().size() - 1); } } else if (wasSelected) { if (beanChoices.contains(item.toString())

How to show a list on table column, with few fields of list items

ε祈祈猫儿з 提交于 2019-12-02 10:02:10
UPDATE : This qustion moved to TableColumn should only show one specific value of a complex data type because it's more specific I want to populate a table with a complex data type Person containing name , id and a List<Person> . At the moment I get a table with the correct name , id and a third column with the whole information of other Person s but it should only show the name of the Persons s. Is there any way that my third column shows only the Person.getName() values? Keywords, solutions welcome! Thank you very much! Edit: Code Person.class public class Person { String id; String name;

Show context menu using keyboard for TreeCell

我的未来我决定 提交于 2019-12-02 09:31:31
问题 I've tried everything. I think they made a big mistake not giving any reference to the indexed cell in anything. I can get my menu, but not in the right place. Right click is fine. In my TreeView I can use get KeyReleased but I don't know where to put the menu. setOnKeyReleased((KeyEvent t) -> { switch (t.getCode()) { case CONTEXT_MENU: getSelectionModel().getSelectedItem().setGraphic(new Label("hi")); //showMenu just calls show on my ContextMenu of my subclass TreeNode ((TreeNode

Wait() & Sleep() Not Working As Thought

旧时模样 提交于 2019-12-02 08:48:15
Using JavaFX 8.0 and JRE 1.8.0 u45 in IntelliJ, I created a basic pixel editor app. I have two windows(stages). One is a 32x128 matrix of Circle Objects placed in a Grid Pane and the other, a Tools widow; I have one Controller.java . Using the mouse, the Tools window provides tools to draw lines, rectangles, etc. and a menu for Setup, Files and Playlists. The Files menu presents the user with Open, SaveAs and Delete. To view a saved pixel art file, the user clicks Open and via the JFileChooser , the selected file is opened and each Circle’s assigned color is displayed using the following