Select SWT Library depending on OS - java

How do I ensure when I distribute a JAR-file that the proper SWT-library (either the windows, the linux or mac version) is loaded an ready to use?
It would be very helpful because then you can do one export and your application can run on any platform like Swing apps usually do.
Thanks a lot

This can be done with a loader class as described in this answer: Create cross platform Java SWT Application

You looking for the delta-pack. The delta pack archive contains all the platform specific fragments from the Eclipse SDK.
See http://aniefer.blogspot.com/2009/06/using-deltapack-in-eclipse-35.html

Thanks a lot for the answer.
Sounds like I have to distribute my app per platform.
In comparison to Swing this is a disadvantage, but I love the native widgets ;)

Related

How to prepare a Mac installer for my java swing application

Can anybody give me suggestions about preparing a custom Mac Installer for a Java swing application. I have tried Xcode but of no use. Any suggestions would be really helpful.
Thanks in advance...
Take a look at http://izpack.org.
IzPack-generated installers only require a Java virtual machine to run. It is fully cross-platform and generates a single installer. As such, it is an alternative to native solutions like as platform-specific installers and package managers.
Or for a more Mac-specific option, see this 10-step tutorial:
http://www.centerkey.com/mac/java (Updated for Mac OS X 10.6 — Snow Leopard)
Do you actually need an installer? Unless you need to put files in very specific locations and need admin privileges for that, installers are uncommon on the Mac. Typically, you'd use a disk image with a self-contained application bundle. See my answer to this question. That answer also mentions how to create a standard OS X installer.

Setting value for Publisher, Size, and Version in Win 7's Programs and Features for a Java app

I have a Java application that is running on Windows 7. When I look at the uninstaller inside control panel>Programs and Features I see that other apps have values for Publisher, Size, and Version.
I would like to set these values in my application, but I do not know how.
Could any of you kind people please point me to an article or explain to me how I can accomplish this? I've done a bit of searching but I am not coming up with anything.
Thank you,
Mattimus
I believe another alternative is to add these values directly to the registry.
http://msdn.microsoft.com/en-us/library/aa372105(v=vs.85).aspx
I don't know how "best-practice" this is, but it's basically what the windows installer is doing.
This come from .MSI files, which are Windows Installer files.
If you want your Java application to be visible in Add/Remove programs you have to build an .MSI file. These are usually built by installer tools such as http://www.advancedinstaller.com/ which has Java support.
Microsoft provides free installer tool Wix http://wix.sourceforge.net/ which is slightly harder to use than the one above, but it is free.

How do I distribute a JOGL application?

I've written an application the builds fine on my machine but when I move it to another machine the dependent JOGL libraries cannot be found.
Is it possible to create a build that sets up all the required JOGL files so that you can distribute your Java application with the necessary JOGL libraries?
If someone could explain this in NetBeans that'd be appreciated too.
Thanks,
James
I wrote a tutorial about how to create redistributable JOGL apps for multiple platforms. The tutorial uses Eclipse instead of NetBeans, but the principles should be the same. You can use this system to build JOGL apps that are completely self-contained, so they don't even require the user to have Java installed.
The tutorial is on my blog at http://wadeawalker.wordpress.com/2010/10/24/tutorial-creating-native-binary-executables-for-multi-platform-java-apps-with-opengl-and-eclipse-rcp/.
This usually happens because the libraries are located on your machine somewhere, which is the way that most tutorials recommend that you install JOGL. The key is to add the JOGL libraries inside your project, and point the project to use those rather than the libraries on your machine. You should then be able to package the application.
Note that because the JOGL bindings are platform-dependent, it means (for example) that if you wrote this on a Mac and try to deploy to Windows, it won't work because the native calls aren't available.
We usually distribute our JOGL based applications using Jnlp. This allows the automatic platform detection from the JNLP Launcher to kick in as well as the use of recent versions of Jogl Libraries. If you would like to see how to craft a proper JNLP look at the samples on this page for NASA WorldWind.
You can use Java Webstart to deploy an application using JOGL, it is explained here:
http://jogamp.org/jogl/doc/deployment/JOGL-DEPLOYMENT.html
Look at my own JNLP file if you want:
http://tuer.sourceforge.net/tuer.jnlp
Edit.: I use JNDT now, it works a lot better :)

UI for a Desktop App

I have a desktop application . The functionality is complete, but user interface requires a lot of work. I am looking for UI tools.My current operating system is Windows and application is required to run on both Windows and Linux.
Can you guys recommend any?
The software is customized file management application for a specific client, with future plans of web integration.
Thanks in advance :)
Application Environment
Lang : java,
IDE : Eclipse 3.4,
Target Platforms : Windows Vista-OpenSuse 11
SWT is another option. The advantages are a look-and-feel closer to the native platform, and generally faster execution times. The main disadvantage is that you will have to have different distributions for different target platforms, as SWT depends on platform specific libraries.
With an eye toward the web integration, look at GWT. You write your interface in Java but it gets generated into Javascript and can thus be run in a browser. This may make your deployments easier. On the downside, you lose a bit of the rich client UI, but maybe you don't even need that. It all depends on how complex your UI is.
A word of advice: you mentioned future plans of web integration. Take special care to isolate what logic you can from the UI. Keep the UI as clean as possible, and then you may be able to use the same logic in the web UI either on the client or the server.
If you are just looking for a GUI designer you could check out Netbeans IDE which has a built-in Swing user-interface builder.
Alternatively you could build a front-end in JavaFX. There's not much tooling for FX yet but a new tool was recently previewed at JavaOne 09. Not sure when it's being released.
I've used Qt a few times and find it very good at this sort of thing -
Qt Home Page I'm not sure if it's exactly what you're looking for as your application is complete, however, but it may be worth a look.
Found an excellent fix,
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
SwingUtilities.updateComponentTreeUI(myform);
looks so cool in my vista and suse , its enough for now.
Thanks for everybody for helping out

How to make installer of java desktop application for multi-platform?

How could we made a jar file's installer, which can run on multi-platform. Is there any simple way, because I don't know Java much well.
Balwant
Installer tools for Java have been dealt with in quite many questions on SO, and most options have probably been mentioned already:
What’s the best way to distribute Java applications?
Java Application Installers
What is the best installation tool for java?
See also other questions tagged java+installer.
If a commercial tool is ok, the best multi-platform installer for Java software, to my knowledge, is install4j; I can definitely recommend it (more about my experiences with it).
Nearly half of our BitRock InstallBuilder customers use it for Java deployment. It is multiplatform and runs in all the major platforms such as Windows, Linux, Mac, Solaris, HP-UX (and most of the obscure ones too :)
izPack is pretty nifty and supports multi-platform installations.
If the target audience have access to the web, you could have a look on Java Web Start which allows you to basically do all you need.
It requires the user to click a link and download.
Well the best way is to use InstallAnywhere that is good for install or packagging any of the applicaion in desktop.
here theInstallAnywhere go to site register your self and download one trial verson.

Categories

Resources