fxml

JavaFX IllegalAccessException during FXML load()

℡╲_俬逩灬. 提交于 2019-12-03 10:49:55
I have a dialog window that is invoked by the following code ( DialogController is a helper class for using modal dialog windows; it mainly bundles together a controller reference with its window): void handleServicesEdit(ActionEvent event) throws IOException { DCServRecEditor sre = DialogController.<DCServRecEditor>loadFXML( CensusAssistant.RES_FXML_DIALOG_SERVEDIT, CensusAssistant.RES_STRING_SERVEDIT, this.getDialog()); sre.setDialogMode(DB.DBEDIT_MODE_EDIT, tbvService.getItems(), tbvService.getSelectionModel().getSelectedIndex(), m_encCal); sre.showAndWait(); sre.release(); this.updateGUI()

How to make window fullscreen/maximized in Scene Builder?

一个人想着一个人 提交于 2019-12-03 10:43:37
问题 I am making a view in SceneBuilder for my JavaFX application. I want my view to be maximized. How can I achieve this in SceneBuilder or the .fxml file? 回答1: You cannot do that using Scene Builder, since maximize or fullScreen are properties of the Stage and not the layouts set on the scene. You can load and set the .fxml on the scene and later set the scene on the stage. The following methods can be used on the stage : setMaximized(boolean) - To maximize the stage and fill the screen.

How to create skins(fxml) for buttons and other elements in JavaFX 2.0? [closed]

怎甘沉沦 提交于 2019-12-03 09:14:57
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. I am wondering if anyone has or knows a link from where I can learn or see how to create skins for buttons, radio buttons, scrollbars etc. using fxml files in JavaFX 2.0. I have this homework for school and I want it built very well, so I try to do

Javafx open another fxml in the another window with button

守給你的承諾、 提交于 2019-12-03 08:40:46
问题 Is it possible in javafx to open new stages (windows) from another fxml with a button? Thanks for the answers. 回答1: Use the code below on button click: try { FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("Demo.fxml")); Parent root1 = (Parent) fxmlLoader.load(); Stage stage = new Stage(); stage.initModality(Modality.APPLICATION_MODAL); stage.initStyle(StageStyle.UNDECORATED); stage.setTitle("ABC"); stage.setScene(new Scene(root1)); stage.show(); } 回答2: I had to modify the code

FXML, JavaFX 8, TableView: Make a delete button in each row and delete the row accordingly

本小妞迷上赌 提交于 2019-12-03 07:28:24
I am working on a TableView (FXML) where I want to have all the rows accompanied with a delete button at the last column. Here's a video that shows what I mean: YouTube Delete Button in TableView Here's what I have in my main controller class: public Button del() { Button del = new Button(); del.setText("X"); del.setPrefWidth(30); del.setOnAction(new EventHandler<ActionEvent>() { public void handle(ActionEvent event) { int i = index.get(); if(i > -1) { goals.remove(i); list.getSelectionModel().clearSelection(); } } }); return del; } private SimpleIntegerProperty index = new

JavaFX TextField : Automatically transform text to uppercase

泄露秘密 提交于 2019-12-03 07:27:36
I have a JavaFX TextField control on my FXMl that looks like this... <TextField fx:id="input_search" onKeyPressed="#keyListener" prefHeight="25.0" prefWidth="197.0" /> I want to automatically change all characters to uppercase when the user is typing. The code in my controller : public void keyListener(KeyEvent event){ //maybe transform the pressed key to uppercase here... } There are a few ways to achieve this: Override replaceText() TextField textField = new TextField() { @Override public void replaceText(int start, int end, String text) { super.replaceText(start, end, text.toUpperCase()); }

JavaFX Project Structure

耗尽温柔 提交于 2019-12-03 05:46:43
问题 JavaFX's MVC Model by using FXML sounds awesome and all but I'm having trouble find out how to organize my project packages. Every single tutorial i find about JavaFX is way too simple and unorganized: They simply create ONE package and create everything there, every controller, every fxml, every css. I dont want that. I want things to be in their right places. Still, JavaFX's "pathing" seems... "limitive". The use of URLs make it so that if I want to limit my resources to local files, I have

Classpath resolution with hierarchical custom JavaFx components in Scenebuilder

ぐ巨炮叔叔 提交于 2019-12-03 04:04:52
I'm creating custom components using FXML. The custom components are designed in a hierarchical fashion. When I design a custom component B that uses another custom component A, a classpath problem dialog pops up in scenebuilder and I simply fix this by setting the appropriate classpath. However when I create three components, say C containing B containing A, and try to open top-level component C in Scenebuilder it fails. It asks me for classpaths which I duly specify. It finds B but does not find A. The classpath, FXML and the code is correct as the application is able to execute properly.

Using JavaFX controller without FXML

淺唱寂寞╮ 提交于 2019-12-03 04:03:19
Is there a possibility to use a controller with a JavaFX GUI without using FXML. I noticed that the FXML file contains an fx-controller attribute to bind the controller but i don't find it an easy way to work with it. Any ideas about have an MVC arch with JavaFX without using the FXML file or JavaFX Scene Builder ? Your question isn't particularly clear to me: you just create the classes and basically tie everything together with listeners. I don't know if this helps, but here is a simple example that just has a couple of text fields and a label displaying their sum. This is what I regard as

How to make window fullscreen/maximized in Scene Builder?

巧了我就是萌 提交于 2019-12-03 01:13:54
I am making a view in SceneBuilder for my JavaFX application. I want my view to be maximized. How can I achieve this in SceneBuilder or the .fxml file? ItachiUchiha You cannot do that using Scene Builder, since maximize or fullScreen are properties of the Stage and not the layouts set on the scene. You can load and set the .fxml on the scene and later set the scene on the stage. The following methods can be used on the stage : setMaximized(boolean) - To maximize the stage and fill the screen. setFullScreen(boolean) - To set stage as full-screen, undecorated window. As you cannot maximize your