Posts

Showing posts with the label javafx

Javafx How to display image captured from web cam in imageview in another scene

Image
Javafx How to display image captured from web cam in imageview in another scene I have this fxml layout. When I click on take photo it opens a screen for me to take a picture using web cam Dialog layout to take pic from web cam I want the picture captured on the web cam to replace the dummy image on the fxml layout beside take photo button.Here are my files: FXML layout containing dummy image and take photo button <HBox prefHeight="79.0" prefWidth="232.0" spacing="30.0"> <children> <VBox prefHeight="100.0" prefWidth="100.0"> <children> <ImageView fx:id="profilePic" fitHeight="99.0" fitWidth="118.0" nodeOrientation="INHERIT" pickOnBounds="true"> <image> <Image url="@../images/profile_photo.png" /> </image> </ImageView> </chil...

java.lang.IllegalStateException: Location is not set

java.lang.IllegalStateException: Location is not set I am getting the following error. I have attached my code. Caused by: java.lang.IllegalStateException: Location is not set. at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2459) at javafx.fxml/javafx.fxml.FXMLLoader.load(FXMLLoader.java:2435) at com.John.Smith.Cars.Main.start(Main.java:31) at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:919) at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$11(PlatformImpl.java:449) at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$9(PlatformImpl.java:418) at java.base/java.security.AccessController.doPrivileged(Native Method) at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:417) at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96) at javafx.graphics/com.sun.glass.ui.win.WinApplication....

Web Runtime alternatives to Electron/nw.js for Centos 6?

Web Runtime alternatives to Electron/nw.js for Centos 6? I know my title sounds crazy, as right now the popular practice is to use something like Electron or nw.js for desktop applications written using web stack technologies, but here's why I'm searching for alternative desktop web runtime solutions: So, to minimize code paths and maximize compatibility, my options appear to be: Has anyone else tried to bridge this gap to consolidate desktop apps and web apps when unfortunately Electron/nw.js aren't viable? Or does the simplification I'm searching for simply not exist? Can you run Electron in a Docker container on your Centos machine? That might be a possible cross-platform solution for you. Perhaps this would be helpful: stackoverflow.com/questions/39930223/… – Matt Morgan Jul 2 at 0:29 Thanks...

java.lang.IllegalArgumentException: Children: duplicate children added: parent = VBox@872be7

java.lang.IllegalArgumentException: Children: duplicate children added: parent = VBox@872be7 Am trying to read some values from MySQL database and display it in a Menu in JavaFX. My code is below. Previously I used Buttons instead of Menu. It worked fine, but I don't felt better with Buttons, so I decided to use Menu. I got the exception mentioned in the heading when I Ran this code. private VBox userSelection() throws ClassNotFoundException, SQLException { VBox vb1 = new VBox(); vb1.setPadding(new Insets(40, 150, 20, 200)); vb1.setSpacing(20); MenuBar menuBar = new MenuBar(); Menu menuFile1 = new Menu("CHOOSE YOUR ACCOUNT"); menuFile1.setStyle("-fx-border-color: green; -fx-font-size: 14pt; " + "-fx-font-family: Comic Sans MS; -fx-padding: 1 10 1 1"); Text scenetitle2 = new Text("Choose Your Account"); scenetitle2.setFont(Font.font("Tahoma", FontWeight.BOLD, 20)); scenetitle2.setUnderl...

TornadoFX filechooser

TornadoFX filechooser I am looking solution for javafx FileChooser (in Kotlin). I stuck on this, I cannot pass root View, because Window! is expected: FileChooser Window! button("open some file") { setOnAction { val fileChooser = FileChooser(); val file = fileChooser.showOpenDialog(???) ... } } What should I pass in this case? Although Ruckus gave you the correct answer below (use the chooseFile and chooseDirectory functions in TornadoFX), I just wanted to point out that you can access the stage via the primaryStage property. If your View is opened using openModal or openWindow you can access your stage via the modalStage property of the View . Stage inherits from Window . – Edvin Syse Nov 22 '16 at 8:19 ...