JavaFX: Cross-platform UI development in Java on desktop, mobile and embedded clients

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments

I have to say though, it kind of annoys me that the guys from Gluon promote native image so hard even though I haven't seen a single non trivial JFX application that's been compiled AoT via Graal yet. If it really works as they claim it would, they should provide a native image of Scene Builder or something :).

👍︎︎ 8 👤︎︎ u/UtilFunction 📅︎︎ Feb 07 2021 🗫︎ replies

I really don't understand why JavaFX would get dropped from the standard library but Swing remains. The fact that Intellij was built on Swing blows my mind, because any Swing application usually works and feels like a program straight out of 1999.

👍︎︎ 2 👤︎︎ u/Hatefiend 📅︎︎ Feb 06 2021 🗫︎ replies
Captions
hi everyone thanks for joining us for the session today i'm your host mala gupta today i am pleased to welcome johan wars java champion author co-founder gluon colleague for open gfx international speaker conference organizer and much more hi johann it's a pleasure to have you present today hi thanks for having me johan will talk about java fx what is it and why you need it its structure components the roadmap of the openjfx project he'll also cover and demonstrate how you can use javafx for development of ui in java on desktop mobile and embedded clients before i let johan take this stage let me share some quick housekeeping details please use the youtube chat to post your questions i anna gauslava and trisha ji from the jetbrain stream will answer your questions as you post them johan will take quick breaks while presenting to you to answer your questions so you don't really have to wait until the end of the presentation to ask them and the session will be recorded and hosted to intellij ideas youtube channel so johan i'll let you take the stage now thank you very much mara for the nice introduction and welcome all uh to the session about cross-platform ui development in java some quick words about me i've been working with java since uh 1995 as part of the blackdown team porting java to linux i'm the colleague of the openglx project where java has been javafx is being developed and implemented i'm also the lead of the open jdk mobile project i'm a java champion and author of the java vex book that you can see on the screen there i'm the co-founder of gluon java vx company by and for java developers i have a phd in physics and i'm also out of a quantum computing book for java upcoming quickly about a glue on the company that i co-founded a couple of years ago we are sort of the javafx steward so we contribute heavily to the javafx platform we drive it forward we make the distributions and do the maintenance releases and long-term support releases we invest heavily in open source for example open jfx but also the ecosystem around it the plugins for maven and gradle we are the maintainer and distributor of gluon scene builder and we have a bunch of other open source projects our main products are glow mobile which enables you to make applications in java and run them on mobile devices in in a very um shiny way and with all the tools that you would expect from mobile devices and glue on cloud link that allows you to connect mobile desktop embedded applications to the cloud we prefer provide commercial support for java vex 11 long term support releases for companies that want stability and we do project and consulting and you can find more information on twitter or on the website so what we'll recover today so first of all i will give a brief introduction in what actually is java fx then i will show some code on how you can use java fx in intellij id then we will talk a bit about the javafx ecosystem and how the javafx specification and everything around it is being developed and finally we'll go into a little bit detail on how javafx's structure how it achieves this what is it architecture and what are the most important future plans at least the ones that we know currently so first of all what is javafx and it's difficult to to come up with a unique definition of javafx so this is just my personal definition javafx contains the java apis for the client development in general and for ui development in particular as part of the java platform it is developed under the open jdk umbrella in a project called opengfx it is part of the open jdk umbrella but it is not part of the open jdk project and there we go already with some of the confusion but i hope that by saying this before i start a presentation that it is clear that we are part of the openjdk let's call it foundation but the java vxcode itself is not integrated in the java code base we use the javafx namespace so the packages that you use as a javafx developer or javafx application java vaccine and so on and it is more or less the successor of awt swing which were the first ui toolkits in in java and javafx is a modern graphical toolkit and it combines hardware acceleration which was not very widely available in the in the first days of java when awt and swing were created but now gpus are everywhere so javafx takes advantage of that but also takes advantage of the of the typical java characteristics like security maturity performance and of course the large ecosystem so the javafx stack that we typically imagine for a javafx application is that you have a javafx application on top of some libraries can be open source or commercial libraries and those are built on top of the javafx platform which is then integrating with the hardware underneath that platform to deliver the highly optimized and high performance rendering so that is more or less the the typical stack um what are the components then in that stack so at the top we have the user interface components the layout containers the controls and so and these are the foundation for developers application developers or um and or library developer sorry for creating their libraries framework applications they use the java apis for example they can programmatically declare a button with the classical java style they can also use fxml if they want to declaratively declare a user interface and typically developers are using scene builder for this we will talk about scene builder and i will show sim builder later in this presentation and finally they typically use css to style the components so css is a technology that we sort of inherit from what is very often used in web design and it is actually also applicable to java and you can style different components the same way that you would style web components what is the relation between java fx and java this is a food for lots of discussion and uh especially a lot of confusion and as i said already java vx openjdk and opengfx are two separate projects but they are under the same umbrella which means that we share some of the infrastructure we share the gyra issue tracker we share most of the policies and the structure about the different roles in between older committee contributor reviewer project lead so that's all shared between open jdk and open jfx but the code base is completely separate and as most of you probably know there was a time that the oracle jdk contained the javafx jar in its distribution and it was in the x folder there was a file named jfxrt.jar that contained javafx but that was a bit an awkward solution um because not everyone needs java fx and also with a couple of javafx very light tightly to to java and what we have today is in my opinion much more flexible javafx has its own set of modules and you can decide to bundle them with your application or you can create your own gre or they can be bundled in an sdk so by default you should not assume that the java sdk that you are using has the java fx modules but the java vex platform assumes that it is loaded via a module so the the javafx graphics module should be part of your runtime somehow and therefore we created a plugin for maven and a plugin for gradle that takes away the hassle for configuring the module path when you're writing javafx applications we created a website opentfx.io where this is explained and where clean samples are available for developing using maven or gradle or any ide so before i switch to an id i will show the typical hello world application in javafx just to make sure that you can see that this is a java application like any other java application so we have we import the packages the java fx classes that i talked about before javafx application javafx scene and so and our class hellofx extends the javafx application and it overrides the start method this method is called when the javafx runtime starts our application and as a consequence we are also provided with a stage object which is the root of object of our javafx application and then we can do many things with that stage object we mainly construct a scene and we assign different ui elements and layout uh controls and so to that scene and then we display the scene and the result of this application is what you see um in the uh right right part of this of this slide so how can you use um javafx in in intellij let me switch to intellij and let me start with actually what i'm going to show now is also what you can find on open jfx does io but i'll start with a fresh application we we create a new application a new project and we will start from an archetype because that's actually the easiest way i already have this archetype in my list in case you don't have it you can add archetype it's org.openjfx and you can find this information on openglx.io but i already have it here it's a openjfx javafx maven archetype zero zero five we give this a name for example intellij demo and we can now tune some of the parameters the one that we need to tune here is let me see the archetype arc defect id we have two archetypes that are supported by this uh uh archetype plugin and uh the the simple one is java vx archetype that's simple so that's the one that we want to have um and maybe we also want to specify the javafx version we want to have the latest version 1501 there we go and now the project is being created and you should see that immediately meanwhile let me see if there are questions okay so the project is created and as you can see um we have a we have a pom file uh now that uh contains the information that we actually supplied in the artifact id so we can see here that we're using the javafx controls module and um we are using the javafx zero zero four we're actually at zero zero five but that's okay and our main clause is uh the org example up so this is created for us by the artifact idea by the artifact archetype sorry and that's just the pom file we are of course interested in the application that's created so a demo application called app is created and this looks very similar to what we saw in the on the slide so this is a simple application with start method and it will show the stage that we were given and it will render a scene that contains stack pane which is one of the layout containers which contains a label which is one of the javafx controls which contain a text and the version of java and javafx now if we want to run this remember that this is a maven archetype so we go to the maven tool window and then you can see on the application that we just created that we have in the plugin we have here a javafx extension and there's a javafx run task and that is actually how the application is started so if we run this maven build so that is actually the run command should be mapped to the to this maven uh run command and then the application is shown uh in a separate window which um hopefully you can see on the stream so this is showing a java vx1501 because that is actually the version that we were using and um it's running on well yeah i'm using an older java version here but that is um how the hello world of java fx is being created uh built and executed so if you follow these procedures if you follow the uh the recommendations it's actually easy i do realize that most of the questions about uh well issues with uh javafx that we have is that um if you're running trying to run java x application not on the with the java x modules not on the module path but on the class path it might work but it also might not work so therefore i cannot stress this uh enough if it's highly recommended to use the uh plugins that will configure the module path and a class path for you so you don't need to do anything else you don't need to install a javafx sdk and so if you're using the maven archetype everything is taken care of uh for you um let me quickly go back to the um to the code here and um let's just uh um add something um oh yeah the template is using the var here um i'm old-fashioned and not used to it yet um so let's create a button um the javafx button where we have click me for example and so this is another java face control that i quickly add now and um i don't want to give a course in java x in this short session but just to give an idea about how javafx development typically goes there are lots of single abstract method classes in javafx which were created before lambda expressions were a thing but which were very easily converted into lambda expressions for example if this button is clicked we can invoke the set on action handler which we can then use to for example let's set text uh um in the text on this uh uh this uh label that we created so if this button is now clicked the text in the label will be changed um let's now also instead of the stack pane let's um create a vbox where we can uh vertically stack different components it's going to be ugly because um we don't we're not styling it nice the only thing that i want to show now is how you can easily add a control in java fx and add it to the stage and um is that still running so let's restart the application now and it should be up immediately so as expected um we now have the ugly uh vertical box completely unstyled but we have a click me button uh under the label and if we click it you see that the text changes in click me so that is very briefly how you can create a java fx application using intellij and using the artifacts and it's a very very small but it's a i think it's it's it's good to start this way let me see if there are um questions that need answering now mala do we have questions that you think should be answered uh johanna i think you can proceed because uh as i mentioned anna and tricia are already answering the questions so their new show stoppers as of now great thanks so that was the hello world um that was um ugly and um it's um it's i'm not doing a favor to java by showing my ui skills i'm i i really have no design skills and so but i can uh i'm fortunate uh enough to to know some great projects for example this is a deep space trajectory explorer created by ai solutions it's been used by nasa to visualize orbits um around moon earth or in any kind of uh orbits and this this uses lots of computations and visualizations that need to be updated very often and very uh uh very fast so it this really stresses um the system that it is running on and there the hardware accelerated rendering of javafx is is really key so this i think um um everyone will agree that this is a slightly more impressive than the hello world application that i showed but it is the same the same language so you should be able to do to create this as well this is a medical software um created by carl zeiss or used by coral zeiss also using a java veggie different components so so this gives you an idea about uh what you can ultimately do with java fx so just to convince you that it doesn't stop at hello world or hello fx but it's just the same the same ideas it's also important to stress that you don't you're not limited to desktop alone so what you see here are two screenshots one from an embedded device on a raspberry pi with a touchscreen uh running a mirrorhead a little lamb application from stephen chin and the right one is a screenshot from an iphone i think use running the devoxx conference scheduler which is also written in javafx so if you write your java fx application in java it runs on desktop but also mobile and embedded and i'll come back to that later because there's often a question how comes you can run on ios because it's not allowed to have a java virtual machine we'll answer that question near the end or telematics application with uh mops this one's with a very high frame rate so that is also telematics and embedded and edge devices are really very good areas for java vx because of the hardware accelerated rendering okay so let's talk a bit now about the javafx ecosystem and the development of um javafx and the development of the ecosystem so remember this presentation uh this uh stack from uh the beginning of the presentation we typically discuss the javafx platform and the there's a huge ecosystem that's leveraging this platform where libraries are created and on top of those libraries applications are created it's uh um typically those applications are created by uh consulting companies or employees of a company and so on they use free or commercial libraries and then they use the uh open open gfx distribution and it's important to mention here that uh gluon provides so the open gfx code base itself is mainly developed by gluon and oracle with uh lots of help from individuals and very clever developers and gluon provides long-term support for java vex 11 and we will provide and well we we make sure that if your company wants to use a stable mature version that's maintained then you can use this long-term support and then you don't have to update to every new major release so the uh the core of the java vx application itself is also supported so this is not something that is um that might go away soon we have real long-term commitments with opengfx so your investment in java vx if you're an application developer is secured also this long-term support helps funding the development that this is actually how we can allow assign people to it and have people working on opengfx and paying them which is i think very important for an open source project so one of the most useful tools and the slides will be published so you can look at the urls later it's a scenic view which is a tool that i use very often for debugging javafx applications when there's something related to the ui that doesn't match my expectations then we've seen a few you can attach scenic view to your running application and it will inspect the elements and then you can see for example i expected some some padding here but it was uh no there was no padding how comes so you can inspect all the properties uh and see live updates to the to the elements so that's a real-time visual inspector and that's available for um javafx 8 and uh and 11 plus a quick note about that as i saw there was a question about it too there's actually java fx 8 and then there's java vx beyond 8. so the pre-modularized java vx is in java x 8 and then when we switch to modules some of the apis were slightly changed so your application if you have a java x8 application it might require some changes before you can run it on the javafx uh 9 10 11 12 13 14 15 platform so that's why you will see for a number of those libraries that there are two editions eight and what we call 11 plus controls of x another project where we have uh two kinds of distributions the eight based and the eleven based controls of x is also an open source project uh by volunteers where additional controls are created that um that give that that make it easier for application developers to create um shiny applications so the java effect controls contain the basic information the basic controls sorry but um they should also be very general because it's very hard to maintain a platform that contains too many niche controls or specific site elements but therefore controls fx contains a bunch of additional controls that you can use in your application and those are high quality they are typically created by people that also contribute to the javafx controls um then we have tiles fx from garrett it's just one of his projects that's a set of widgets that contain typical tiles that you can see in that are very useful in many of the typical applications on desktop but also and i think especially here on embedded devices where you want to check temperature and so so all of these tiles are available in the tiles of x very popular application fx gl from almas is a game engine uh that allows you to create java fx uh applications uh in java or koplin uh on top of a java fx um and it's uh it's it's it's making lots of progress it's actually uh uh pretty recent but the development is going very rapid and i saw some 3d uh animations uh uh with fx shield that um um yeah were very very impressive so if you're in a game development you definitely need to check this link because uh you will get a head start if you're if you base your game on on this uh library um derek lemmerman creates a bunch of business uh applications and uh controls and uh uh libraries for example calendar fx is such an application he has open source and he has uh commercial applications so there are lots of libraries available if you want to create javafx applications and if you want to move beyond the hello world that i demonstrated so this is actually one of the main advantages of of of the java ecosystem that there's a huge set of libraries that you can use in reuse and that is also the case in javafx there are so many great java developers individuals and companies to be honest mainly individuals because many companies are using java fx in mission critical or security intensive applications in the financial world for example uh and they don't want to um those applications are very often not open source or they they they contain some secret information so they are typically not shared but the foundations then the building blocks of the applications are often developed in the open source or in the wider community scene builder finally is the probably the most used tool for creating javafx applications it allows you to create a user interface by simply drag and drop application uh controls and layouts into your page and it generates fxml which is which integrates very well with the javafx application so i will quickly show a demo of scene builder and how it integrates with intellij id unless there might be some questions first that are blocking but i i see a bunch of questions that are interesting that i will take uh uh at the end so i will switch to the demonstration of uh same builder applications uh now unless mala do you think there are questions that i need to take now um so johan there are a lot of questions some um you can just decide whether you want to ask answer them now or later so first of all is how does java fx compare to swing yep okay yeah so so i'll um i will quickly answer that one um so uh it is as i said in the beginning it's sort of the successor of swing but um and many of the people or at least a bunch of people that uh wearing the java vx team were also in the original swing team and i spoke to some of them and they uh it's it's actually um the the new version of uh of swing if they would create swing again now it would be javafx that's what someone from the original uh team uh told me so it is it is very related but this there are some important con conceptual changes for example javix uses a retained mode which means that we describe the user interface instead of [Music] trigger ui changes and so so it's more modern i will when i talk about architecture of javafx i will talk about that in more detail so it is separate there uh the one thing that i want to mention now is that you can in theory mix swing and javafx because there's a swing note in javafx and you can also run javafx nodes in swing in practice it's um i personally don't recommend it because you need to take care about the threading issues uh so there's one other question i would quickly ask you and then i would let you uh continue with the presentation it is about automated testing uh is there something similar to selenium for web with available for javafx um yes so there are a number of test frameworks uh test fx for example uh and uh those uh are indeed uh similar to to selenium um so test of x is a uh uh one of them um i'll i'll make a note so that we can uh share the link later as well and actually um inside the open jfx platform there's a component well there's a robot api that allows you and and then the testing frameworks use this api that allows you to to do what for example selenium is doing as well so you can move the cursor programmatically and so so yes that that does exist and that's that's an important thing okay i'll let you go continue with the presentation okay thanks um so we are going to create a new um project uh similar to what we had before but this time we uh so we will once again create an artifact uh create a project from an archetype sorry and this time we are using um [Music] demo with fxml for example and this time we are going to use the not the simple archetype but the javafx archetype fxml which is more or less uh apart from that more or less uh the same as the uh as a simple one but now we will have um an fxml file created for us already and this project will by default come with two two views so it demonstrates how you can switch between views so the project is created again you see the the the pom file that's been uh created and um and again we have the um so this is similar to what i showed before as you can see now we have the application which looks slightly different from what we had before the start method which we still overwrite is now very short it is actually just a scene where we load some fxml and the fxml here is called primary now let's look at the resources that we have we can see here that we have a file called primary.fxml and if we click on it we see it in text uh form and you see that this is some declarative um thing that describes a label and a button and uh uh and padding and so so this is actually and you can edit this if you if you prefer to really declaratively declare without any ui tool you can you can do this manually but you can also use a a scene builder to um to edit this there's a built-in scene builder in intellij id but i'm using the um i'm using the latest one which you can download from the uh glue on site this is a very very popular uh tool and this has so we actually released this version last week and with fxml we can open [Music] the fxml files that are part of our project the only thing is i now need to remember the dna oh yeah that was demo with fxml and we have the fxml files it's a bit small uh to see probably on the screen there but um the file let's let's let's take this primary.fxml file there we go what we see here is actually um the declaratively declared user interface that we showed uh before oh actually i don't think i i i didn't run the application yet so i'll probably do that first so i go back to intellij and again so this is a maven project it's a very similar to what we had before so we go to the maven settings and we look at the plugin to javafx1 this one again will compile and run the javafx application and and it will show the two windows if everything goes all right so here we have the application um with a primary view and if we click on this button then we switch to the secondary view which just contains secondary view and we can go back to the primary view so that's a very simple application but now you know that this primary view with the button uh to go to the second review is actually what that primary view contains so if we go back to scene builder we see this primary view and switch to secondary view what we can do now for example is um um let's say for example at the color picker which is one of the controls which is completely useless in this application but it's um it's easy to uh to show so this is a control that contains a bunch of properties that you can see on the right uh it's a bit small but you can check it out yourself for example the value is by default white but i can change that value to whatever and i can change lots of other uh values also layout properties i can change them and change the width and the height also change the behavior and integrate it with the code i'm not going to do that now because it's if i do that i prefer to take more time for it so let's keep that now um i've saved this uh view now and if we go back to [Music] our code you will see that this um let me make this smaller you will see that the fxml is changed now see the color picker is there and if we run this application again then you will see that the change that we made to the fxml file is shown in the [Music] in the application that we created so we have again switch to secondary view but here we have the color picker which is the javax control that we talked about um i will show just one one more thing about this fxml structure and i'm getting out of time so i will do that quickly you see that for example here primary button is and what intellij tells us or suggests is that we can create a field primary button so if we click on that a field is created in the controller which is the java counterpart of the fxml file that we have here so the fxml file where you declaratively declare your user interface is linked to the java in a file which contains the controller how is this link realized well you see that there's an um in the uh fxml file if you look at the at the declaration you see that there's an fx controller tech which points to org example example primary controller which is actually the class that we have here so that is how those are linked uh the linking also contains for example here we have an on action tag which might invoke a method on this class so that is how you combine declarative development using scene builder with programmatic control with with your java classes so that's a um scene builder um going back then to the community uh and and all of the community in in java x the unofficial homepage of javafx is actually opengfx.io this is where i mentioned it the number of times already but this is where you can get started with javafx it contains the very basic information on how to run using maven gradle or the ids and it is it is actually it doesn't contain that much information but the the main point for us is that we want this to be relevant so we want to update this whenever javafx is updated so we rather have less information that's always correct and up to date instead of lots of information so it is open so the this website is developed is automatically created based on the github repository that is open source and we very much welcome pull request to uh to to open gfx.io and we're actually looking for people to contribute for this but maintaining really takes lots of time so it's not that you can simply say hey i have a good tip here because what do we need to do with that advice uh in in in in in the next release or so so this is really something where community involvement is important and um comes with responsibility so about the community and the um and the uh well and the product names java fx and opengfx are often used um in a mixed way and uh javafx is what i think uh at least my the way that i explain it is javaxx is a product and opengfx is a code and the project where javax is being developed and that's the openjdk project hosted on github with gpl and class part exception as a [Music] similar to the open jdk there was a question about uh um isn't the uh javafx too tightly uh coupled to um uh to to to glue them um i'm actually uh flattered by uh by that um but um i don't think so it's just that um gluon is uh together with oracle the main contributor to open jfx and we um so kevin from oregon myself are the projects leads we follow the same strategy as the open jdk where everyone can contribute and if if you follow the rules where you can first create an issue then create a pull request it's being discussed it can be discussed on the mailing list and then it's a it's integrated so it's it's very uh much developed in the open gluon also releases uh builds um the distributions but that's totally done on this open source code so others can build it as well um i think it's we we contribute a lot so i think we we have some knowledge uh um that that well you only get by contributing but that's um it's not that gluon owns uh java vex so we do create the uh the builds and we follow the same rescans as the java sdk uh we're now at 15 or 115.2 will be out soon then we have 16. we typically release um in the same week as as as java and we also have um similar to uh to the java as the uh three types of builds so the regular builds 15 now 1501 i actually don't recommend those the early access builds that we are doing are more important to developers for example 16 ea 6 i think is the the latest version this is not just some experimental version this is really what goes in production soon because the quality bar of any open jdk project is pretty high so nothing comes in an early access release unless it follows the same procedures as the open jdk project so that is what i recommend developers to use and then the long-term supported builds is what i recommend companies to use if they want to have stability and security so that is what we distribute to our java x11 lts customers so the government i think i covered that already so um no need to uh talk that uh talk about that soon um then i um i will very very briefly go over the structure of the javax platform but i will skip most of this because i think i i prefer to spend more time in showing how to get started in ide instead of talking about the structure of of java vex itself so the java vx platform contains the java fx apis on the top and at the bottom it integrates with the low level rendering and the low level windowing system of the operating system and the the link between those is done by the internal implementation so typically the top api the javafx apis that's all that developers uh uh see but the the and and this is actually so the stage with the scene and uh and the nodes so for example every control is a bunch of nodes um and and that is the um the scene graph based model that we have here here we see uh actually the answer to how is javafx different from swing java vx is uh using retained mode so the developer declares the state of the node he says for example this needs 20 pixels padding and so and then the rendering pipeline will look into the specifications and will do the rendering so that's actually a separate system so those are two different uh components of the system so the rendering will use platform dependent optimization when possible and will fall back to software if needed and there are pipelines for different desktop systems mobile and embedded systems finally so this is the last part of the presentation it's about the future and we learned a lot over the past 25 years in uh in java and one of the things that have evolved is the the mobile landscape java was originally designed for mobile and embedded but it was a very hard market to get in these days because it was hard to bundle the java runtime with mobile devices or embedded devices because the manufacturers want to have control about the device and today we have app stores and the concept of the app store is something that's interesting not only for mobile but also for embedded 10 desktop and native applications for the mobile devices they bundle everything that is needed and that is something that we can do with java as well on the desktop the biggest hurdle that we heard from users in the past was about java on the desktop i do need to update this java whatever thing it is every way too often and it's uh and it's annoying um actually one of the times that i uh traveled to the us for java one um at the border the uh officer asked me um what are you going to do and i said i'm going for a conference about java and he became a bit angry with me and he said java that's this thing that i don't know what it is for but i have to update my computer so often for it so so that that was really a showstopper for many users this is already now sort of fixed if you use jlink in java packaging you can bundle your application with a runtime but we are going one step further now and we compile the java fx application with all the dependencies ahead of time and this is something that it's it's nice on desktop but it's actually a requirement on ios we cannot have a jit compiler on ios so we need pre-compiled code on ios so how do we do this we compile the java byte code include including the java x byte code to native code ahead of time and the native code that's needed for the hardware accelerated rendering but also for the java core libraries are compiled to the specific target as well and this is where we're using call vm native image which allows you to compile your java application into native codes and the java runtime itself is also compiled into native code so all the functionality that your java application needs threading and so is compiled to native codes and the native flips come from uh open jdk mobile so this then leads to this architecture where we have uh gluon substrate which is a plugin or which is invoked by a plugin that gluon distributes as well it's again open source and this one translates your java application javafx application all the dependencies that you have with call vm native image it will include the sdk required for the target it will include the java fx sdk and it will make sure that if if you want to have the glue on commercial add-ons for creating nice shiny applications and so or access to the device-specific functionality it will include those as well and then you can create applications for you can have native applications that run on desktop on mobile or embedded and you can even use github actions that automated this for you and the first examples are now i'm seeing reports from people that are using this to create applications and upload them to the app store and the play store so this is actually i think very exciting and this is what i think the future of uh java on the client is is very very bright and it goes uh of course desktop it's very important to have desktop but also to um any other client platform so in summary um java vx provides the uh ui platform and the apis for java leveraging all of the good things that we know from java and it allows these applications to be deployed to desktop mobile and embedded there's a huge ecosystem and it's developed in an open development model the open jfx repository and it allows you to create native applications on desktop mobile and embedded devices so i think that's uh um that's uh uh my uh presentation i'm looking at the questions now um and unless uh mal if you think there's something that i really should answer i will quickly go over them and choose an order yes first of all thank you so much johan it was amazing i loved the screenshots that you had for where you are using uh javafx to create the applications especially the ones which was which is being used by nasa uh so this there were multiple questions regarding uh working with java fx with different versions of java with different build tools like cradle maven and i think we have covered most of them we also mentioned the link to javafx dot io which has the steps to go on with creating uh applications with those combinations i think we are done with that part one question that has been repeatedly asked is the the support of java fx in android studio um yes so so uh those are two different things if you want to create a java application in uh uh for android you don't use android studio you use your java id you can use intellij id or you can use netbeans or eclipse because if you're creating an android application um and and it might be confusing because when we started doing mobile development we were using the android java virtual machine but now that we are using core vm we are not using the android java we're using the the real java so the open jdk java so it is um it does it is very different from uh creating an android application it might be possible uh to to do it but what um uh the the what our tools are doing and actually it's just maven and gradle extension so you invoke those in your ide what also doing is invoking the same commands that android studio would invoke under the hood to create an apk out of your application so it is using the command line the same command lines as android studio is doing but it's not um doing uh it's it's it's a different uh ide actually okay the next question uh i'm not sure whether you answer this question uh this is the plan for supporting embedded clients with hardware acceleration right now the rendering pipeline using opengl es2 through uh i think answer that yes no i didn't answer that but it's actually a very good question so um um uh depending on the uh on the embedded uh on embedded devices there are different types of gpus and different type of uh graphical drivers so what we make sure is that the software rendering is working uh on all systems because that is not dependent on the uh on the gpu but we also have a bunch of uh builds for embedded systems for example the raspberry pi 3 the raspberry pi 4 32-bit 64-bit with ubuntu with raspbian where we have hardware accelerated rendering and that's uh that's amazing i see the the performance really boosting um but those um those are not generic if we have for example java vx4 for uh for for mac os that works on all uh mac os systems of course but for um uh uh embedded we have we were using drm uh for the hardware exploration on the uh on the raspberry pi which is getting more standardized so and and and and there um it's actually based on customer demand so we we have a few things like that we always support like the raspberry pi but then companies come to us with a specific device with specific ui driver and then we leverage the that ui that you might have to benefit from the hardware exploration uh there's another question which is is there a plan to integrate egl with prison es2 uh yes and that's actually um so what uh it's uh it's in the code base since uh a month or so so it will be part of a 16 where um we have monocle which is one of the rendering pipelines uh which um uh uh which has an egl uh front end so uh well front end or uh binding and um that is that is the thing that we use to um to bind the javafx rendering pipeline with the drm kernel system using egl so egl is one of the supported sub-platforms of monocle so that is that is integrated in the sense that those things are actually next to each other so prism es2 is uh uh is used on mac linux and some of the embedded devices and on the embedded devices uh egl is one of the things that is supported there and of course thank you so much uh a lot of viewers are comparing java fx swing and electron so one of the question is the resource usage of java fx application compared to swing or electron a similar question is embedded swing into java fx does that causes an issue with rendering and third one again a related question is javafx is really hope for today's desktop gluon doing great work to support it what is memory footprint in comparison with electron and qt56 yeah that those are very good questions and um i think at this moment um we um well or at least before let's say until a year ago we had the overhead of the jvm and uh that adds uh to the footprint and that is um yeah that that makes a java application typically heavier than a real native application but what we're seeing now is now that we're using call vm native image to compile aggressively compile the application and knowledge dependencies into a native application we see that the footprint decreases um drastically and uh performance especially startup uh increases a lot so um i'm [Music] i don't have official benchmarks yet and it's of course difficult to compare a java fx application and an electron application but i'm convinced that um we're doing much better there especially thanks to carl vm native image so the the resources that are now used by javafx and the memory consumption at runtime is is much slower than it used to be and it's actually one of the killer differentiators of a java fx in combination with with garvium native image right the other one is it's about oh yes just does javafx use hardware acceleration on rendering um yes so that is uh um well it is whenever uh what i said whenever it's possible to use hardware accelerated rendering javafx will use hardware accelerated rendering if it is not possible for example we do some checks if there's a broken gpu or a not supported driver on your system java x will fall back to software rendering but um it's by default used uh uh it's by default using javafx okay so i'm not following uh this question um sorry i'm not following the releases of javafx i'm unsure whether um what is the answer to this question so uh we are asked that i noticed that since java jdk8 which was released sometime in 2013 now it was 2014 no new features have been added to java fx unlike the core java language uh so when can they see more features coming to javafx yes so uh the question about the world map is uh um uh is something that we uh often get and i do know that if uh well one of the things that are often asked is uh uh can you create a um an html uh text editor for example but the the thing is we and it's it's it's it's not good marketing for me but we don't want java vex to be the most shiny uh library we want this to be useful for library developers and application uh developers so new features by for example new controls that is something that um you make the platform more heavy and it's uh it needs to be maintained so if there are really new features we we rather look at support for um new pipelines for example there will be support for metal coming soon in java fx and um we make sure that we keep supporting new versions of operating systems and so new features is nice if there's really the need for a new feature and then we will do it but um it's not that we want to to have a contest with other uh component with other frameworks where we want to have as much new features as possible if you look at the list of issues um that are fixed in every java vx release i think it's pretty impressive and we rather work on stability than on adding new features i also think that for example the integration with rvm native image and boosting the performance there is is is more important than new features which are actually typically created in um community projects like controls of x uh for example or um um the game engine and so those are really cool features and they are available and what we typically do also in javafx is we we let them incubate a while in third-party frameworks and when they're um very good and when everyone agrees this should be in the core then we can integrate them in the core but it's um we really focus on the quality uh first uh right so johan we are running out of time we have a lot of questions but i'll take just the last question so one of the viewers mentioned that you mentioned while you were presenting that uh no i think that was on twitter that a new product that will come out so is that related to javafx um yes so that's a short answer that's uh uh that's all i can say for now yes but it is related to javax yes okay so i i would recommend uh the one who uh asked the questions to follow johan on twitter if you are already not doing that so that you get more updates uh when the product is out probably doesn't want to talk about it now and follow uh glue on uh uh on twitter of course google hq yes uh so thank you uh johan that uh i i learned a lot from uh today's session thank you so much and if you want to have any closing remarks no well thank you very much for organizing this i really appreciated that and i'm i'm really glad that i could do this and i hope that there are many people now knowing that they can use intellij id to create shiny java applications for desktop mobile and embedded thank you so much uh thanks everyone for asking the questions uh and for attending the session and uh do keep an eye on the next set of webinars live streams that we have planned for intellij idea the next one is on 10th of february which would be using maven with intellij idea so thanks again and bye everyone you
Info
Channel: IntelliJ IDEA by JetBrains
Views: 18,839
Rating: undefined out of 5
Keywords: JavaFX, cross-platform development, OpenJFX, intellij idea, java
Id: JbITM8xapIQ
Channel Id: undefined
Length: 64min 44sec (3884 seconds)
Published: Wed Jan 20 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.