This question already has answers here:
How to make an executable JAR file?
(5 answers)
Closed 6 years ago.
I've got a bunch of data stored in tables through Mysql on which I've done some analysis and also export microsoft excel to make graphs and such but the customer wants it to be a desktop application which I have never done before. Currently working in Eclipse. What is the simplest (or any really) way to make a desktop application?
EDIT: I don't think I was clear and that is my fault. I know how to make a GUI in Eclipse I just don't know how to make the desktop icon that will bring up the GUI I make.
For beginners you can start with Swing or JavaFx. It's easy to learn plus they have some excellent tutorials or you can look use more mature Java Frameworks such as Apache Struts, Spring MVC etc.
You can also try netbeans IDE. It has native support for building JavaFX Application and Swing application.
Just make sure you install required plugin to setup your environment in eclipse. For JavaFX you'll need JavaFX plugin: e(fx)clipse.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I am planning on starting the development of a desktop app, but until now, for me, desktop = swing. I did a little research about it and found myself under some questions:
I found that there are a lot of JavaFX versions:
There is JavaFX 1.0 that people say is old and outdated;
There is JavaFX 2.X that is very good;
And now JavaFX 8 (is this correct?);
But even with the most recent NetBeans IDE version (8.0) with JDK 8 (1.8.0), when I create a JavaFX application, it starts using JavaFX 2.2 – Is JavaFX 8 really a new JavaFX version or people say it just because they use JavaFX 2.X with JDK 8?
Another question about versions, will applications developed in a version X of JavaFX be compatible with higher versions? Just like a swing application, where if you developed an application in Java 5, it would work even on Java 8.
About development patterns, more specifically about layout creation, I noticed there are two ways for creating layouts: By just coding it in Java, and by creating XML files (FXML) with a Java Class as a controller (More MVC approach) just like a JSF application. Which one should I choose? What are the pros and cons of each one?
Welcome to the world of JavaFX
I am not sure why you are facing such an issue of JavaFX 2.2 with JDK 1.8 because JDK 8 has JavaFX 8 in it and it must be used by default.
Just to give a quick introduction on JavaFX and how it is different from Swing. Please follow the following points:
Instead of following the legacy of building the view/UI in Java code and messing your functional codes with views, you get the opportunity of separating the view with the functionality using the FXML introduced in JavaFX 2.0+
JavaFX has powerful CSS integration which allows you to decorate the view, which was absent in Swing.
The development is quicker, as you have SceneBuilder to back you.
For more differences on Swing and JavaFX please follow (though the answers are old and many things have changed. JavaFX has become bigger and better!)
https://stackoverflow.com/questions/1318645/JavaFX-or-swing
JavaFX 2 vs Swing for a pure Windows desktop app
Difference between JavaFX 1+, 2+ and 8+
JavaFX 1+ was basically a scripting language called as JavaFX script, which was very different from the Java language.
JavaFX 2.0 changed the face of JavaFX. All of JavaFX API was now available as pure Java API. FXML was also introduced during this phase in JavaFX!
JavaFX 8.0 leads to a new face of JavaFX where JavaFX is accepted as an integral part of Java 8.
Compatibility - All JavaFX application is forward compliance, i.e. JavaFX 2.0+ is compatible with Java 7, 8 and above. Though applications made using JavaFX 8 is not compatible with Java 7.
JavaFX 1.3 support has been killed from Java 1.7.
Development Patterns
JavaFX gives a chance to build your application using your choice – i.e. use the legacy method of building the view using pure Java or use FXML.
JavaFX strictly follows MVC pattern, separating your view and its events. The views are created using FXML and the controllers are Java files.
From Oracle docs
From a Model View Controller (MVC) perspective, the FXML file that contains the description of the user interface is the view. The controller is a Java class, optionally implementing the Initializable class, which is declared as the controller for the FXML file. The model consists of domain objects, defined on the Java side, that you connect to the view through the controller.
Some more information and pro's for FXML, please follow:
Which is better way of programming in javafx?
This question already has answers here:
How can I write a Java application that can update itself at runtime?
(9 answers)
Closed 9 years ago.
I'm developing a software which I will patch early & often, so I'm looking into an autoupdater made in Java.
If I google "auto updater java" it gives me the auto updater for Java, not software in general.
EDIT: Java Web Start and JNLP are not viable options since they're buggy and not reliable at all (or such is the general opinion).
Use Java Web Start. It will automatically update your application, when you have an updated version. If properly configured. JNLP works well.
Check out the JnlpDownloadServlet Guide.
Also Check out Andrew Thompson's site.
With jnlp, you can
Add a custom icon.
Install a shortcut on desktop.
Add application in the start menu.
Add a custom splash screen.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I'm going to study java via the Book "Head First: Java".. So im going to use Eclipse, when I was in 3rd year college, we do very basic Java programming, we only used Notepad++ and command prompt for compiling.
I like to know if I can make exe using eclipse and java alone. What about GUIs? I only done application in android, so I code using "button.setText"" things, but what about Java application for desktop, how can I make GUIs? EXEs? Are there other programs I will use?
I would start creating simple PC apps like a calculator. How can I do that?
Launch4j is a cross-platform tool for wrapping Java applications distributed as jars in lightweight Windows native executables. The executable can be configured to search for a certain JRE version or use a bundled one, and it's possible to set runtime options, like the initial/max heap size. The wrapper also provides better user experience through an application icon, a native pre-JRE splash screen, a custom process name, and a Java download page in case the appropriate JRE cannot be found.
I would say launch4j is the best tool for converting a java source code(.java) to .exe file You can even bundle a jre with it for distribution and the exe can even be iconified. Although the size of application increases, it makes sure that the application will work perfectly even if the user does not have a jre installed.
If you only want to use Eclipse and java, then you probably should use SWT and, optionnally, RCP.
SWT is a native widget toolkit allowing you to build applications and RCP adds a framework layer to build complex applications like Eclipse itself and package them as exe (on windows).
But note that building desktop applications as exe is demanding. Before you dive into RCP you might want to look for other solutions, even if they require additional frameworks or tools you don't have in Eclipse.
To make GUIs Eclipse has Window Builder Pro, which allows you to make GUIs easily
https://developers.google.com/java-dev-tools/download-wbpro?hl=pt
For make an executable (jar, in Java case), Eclipse is enough. If you really want to build an ".exe" there are many plugins you can use, such as Launch4j
For making drag and drop GUI, eclipse doesn't provide functionality. For drag and drop GUI, you have to go with Netbeans. For creating .exe, you have to use some third party jar to exe converter tool.
This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
How to write a plugin for eclipse?
I want to implement an Eclipse plugin of my project which is in swt. What is a good tutorial with examples?
I want to run my project in Eclipse when the user clicks my project's (plugin) icon. Which tutorial should I read?
http://vogella.de has a lot of great articles on this. Start with Eclipse Plugin Development Tutorial.
This can be found by googling How to write Eclipse plugin (with animation, but requires JavaScript).
Eclipse has a guide for that too, Your First Plug-in.
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.
Closed 10 years ago.
Most of the desktop application development I do is in Swing, and I'm curious to hear people's thoughts on using JavaFX and/or Adobe Flex for building desktop applications. Have you had success building desktop apps with these? Or would you stick with Swing for now and use tools to help make Swing development more productive?
If you're making desktop apps, I'd stick to Swing. JavaFX/Flex/Silverlight would be more appropriate for RIA - rich internet apps. Although I'd argue that none of them would be a choice for the long term - looks to me like HTML5/CSS3/Ajax are winning the day, but thats a pretty subjective area. But for desktop apps - I'm a big fan of Swing (also Java Web Start is a very underrated technology)
I would say that JavaFX can be seen as a kind of extension of Swing with a new way of developing a Java GUI by using a declarative programming language: the JavaFX Script. JavaFX Script code looks exactly like a JSON script, unlike Adobe Flex or Microsoft Silverlight which uses an XML syntax.
JavaFX Script can interface with Java and therefore can call Swing components easily. It's really a new generation of GUI API, like Swing was for AWT: nice graphical components, new easy ways to manage layouts, really nice features to build dynamic interfaces: bindings, timers (to build animations), etc. Have a look here: http://www.javafx.com/samples/ and to the tutorials and see how fast you can build a kind of Google Picasa application... The API even contains some tools to use easily web services: you can find plenty of samples of GUI built in JavaFX connected to some public web services (like a Weather Forecast tool).
And the best... is the deployment part. You can embed your application within an html page, like an applet, and the user can drag and drop the application to her/his desktop to use it whenever she/he wants (without returning to its browser)!
Really, I think JavaFX, at its early stage though (v1.2), is a really good tool and represents the first step for Java toward the next generation of applications: the Rich Internet Applications (RIA).
Java Swing is an established and mature technology for desktop development. You'll be able to find lots of information online and plenty of sample programs. With that said, however, you might want to consider Adobe AIR. AIR is basically a runtime that lets you run your Flex apps on the desktop, and gives them access to local resources such as the file system. I've written Java Swing apps for 10 years and I am amazed at how much more productive I am using Flex/Adobe AIR. One nice aspect of Flex is that you can create your GUIs declaritively, much like how you use HTML to declare the layout of a webpage. It's a much more concise way to specify a GUI, and much faster and easier to maintain than the reams of Java Swing code you need to do the same thing. I wouldn't recommend JavaFX since it is so late to the party and hasn't really gotten with mainstream developers.
You should try them all and see which one fits best with your requirements. If you want to see what you can do with Flex and how to do it then check out Tour de Flex.
Some of the advantages of Flex are that it is mature (over 5 years old now) and a significant area of investment for Adobe. You can also find numerous examples of AIR apps built with Flex in the Adobe AIR Marketplace.
Swing can look good with Substance L&F.
However, if you are developing alone (as opposed to with a team), trying JavaFX might be a good idea.
Please read the about this, write extremely lightweight swing applications and with the same code base move it to web.
demos
runtime
I had evaluated these for desktop application and finally desided to go for JavaFx . This have very good media library and hardware accelerated graphics and media capabilities . With Jdk 7 update 6 onwards contains JavaFx totally I integrated no separate installation is required . Java swing is very good technology and will be continued but I see JavaFx is the future for GUI and Internet application to some extent. Biggest advantage for me was that JavaFx app could be converted to exe files with native packaging
Also try scenebuilder for drag and drop component designer
I feel that I do not have enough information to answer this question. There are many applications in which an AIR approach is a better choice, other applications use other technologies better. I am primarily an AS3/Flex developer, but I know there are many instances where one of the Java platforms is a better choice. Now that Flex is no longer an Adobe product but rather a Apache product, it will either improve the product as the users will create the roadmap, or kill it off completely.