In this repo we will explain how to setup simple/fxml (without/with fxml) JavaFx application using IntelliJ.
- Open IntelliJ > New > Project
- Select Maven in the left pane
- Select (check)
Create from archetype
in the right pane and clickAdd archetype
- In the pop dialog box add the following and click ok
GroupId: org.openjfx
ArtifactId: javafx-maven-archetypes
Version: 0.0.1
- Type a name for the directory of your project
- Expand
Artifacts Coordinates
and enter the following and click Next
GroupId: org.javafx # package name
ArtifactId: javafx-maven # Project Name
Version: 1.0-SNAPSHOT # tar file name
- In the properties we need to change one and add one more properties
- Click archetypeArtifactId and change value to
javafx-archetype-simpe
ORjavafx-archetype-fxml
(for fxml support) and click OK. - Click + button and type name: javafx-version and value: 13/latest and click OK.
- Click archetypeArtifactId and change value to
- Click Next and Finish.
- In the toolbar click
Add configrations
- Select + > Maven > and then type a name
Run
- Expand
Before lanuch
and click + and selectRun Maven Goal
and typejavafx:run
in the Command line, and click Ok. - In the window also type
javafx:run
in the command line, click apply, ok. - Now you will see Run button along with play button in the toolbar.
- Simple: You can expand the External Libraries in the left pane of IntelliJ and notice that it has
javafx-base/controls/graphics
jar files downloaded. - Fxml: You can expand the External Libraries in the left pane of IntelliJ and notice that it has
javafx-base/controls/graphics/fxml
jar files downloaded.