making swing application to launch from desktop

G

gwlucas07

I been looking into ways of making a Swing application act like a
conventional program under windows. I'd like the user to launch the
thing by double clicking an icon on the desktop, see it on his start
window, etc. I'd also like it to run without opening up a console
window when it does. In other words, the user should neither care no
know that he is running a Java application rather than anything else.

As a bonus, I'd also like to be able to do the same thing under Linux
and Mac's

Anyway, I'm not having much luck with web searches (I guess I haven't
thought of the right keywords). Can anyone offer some pointers on how
to do this?

Thanks

Gary

P.S. Happy halloween
 
M

Mark Space

I been looking into ways of making a Swing application act like a
conventional program under windows. I'd like the user to launch the
thing by double clicking an icon on the desktop, see it on his start
window, etc. I'd also like it to run without opening up a console
window when it does. In other words, the user should neither care no
know that he is running a Java application rather than anything else.

As a bonus, I'd also like to be able to do the same thing under Linux
and Mac's

I think you want a Java installer -- that is, something to install Java
on a variety of platforms. I don't know if Java WebStart (sp? look for
"JWS") will work this way -- I think it will. However you can also
compare what an installer will do for you too. There are a few Java
installers out there.

The double click thing, on Windows just make a shortcut. Start window
and such, your installer needs to copy the shortcut to the right folder.
Other platforms besides Windows I'm not sure about.
 
R

RedGrittyBrick

I been looking into ways of making a Swing application act like a
conventional program under windows. I'd like the user to launch the
thing by double clicking an icon on the desktop, see it on his start
window, etc. I'd also like it to run without opening up a console
window when it does. In other words, the user should neither care no
know that he is running a Java application rather than anything else.

As a bonus, I'd also like to be able to do the same thing under Linux
and Mac's

Anyway, I'm not having much luck with web searches (I guess I haven't
thought of the right keywords). Can anyone offer some pointers on how
to do this?

* Create a suitable jar file. Copy to user's PC.

* Make sure the PC has JRE installed in the normal way.
* On the desktop & start-menu, create a shortcut to the jar.

Doing the last two steps ought to be doable by any reasonably IT-aware
person. There are many commercial and free installers that can be used
to produce Windows executable install files that do all or some of the
above for the end user.
 
G

gwlucas07

Thanks. I've been trying to do something like this (with the main
class
indicated in the Manifest within the jar), but at start up either Java
or Windows creates a console window which I'd prefer not to be seen.
Is there a setting I can use to suppress this?

G.
 
G

gwlucas07

Thanks for the Java Web Start idea. I hadn't considered it because I
wasn't really interested in "starting from the web", but just starting
from the desktop. But it sound to me like it might have broader
applicability than its name suggests. I'll take your suggestion and
look into it.

g.
 
T

Thomas Kellerer

Then the JRE was not installed properly. Usually jar files should be linked to
javaw.exe (in the registry). If you are seeing a console, they are opened using
java.exe

Thomas
 
M

Mark Space

Thanks for the Java Web Start idea. I hadn't considered it because I
wasn't really interested in "starting from the web", but just starting
from the desktop. But it sound to me like it might have broader
applicability than its name suggests. I'll take your suggestion and
look into it.

I use a Java app (written by someone else). It's distrubted via JWS via
a link on his website. Not only does JWS download and install his app,
and add a link on my desktop, JWS also updates the app on my hard disc
when he pushes out a new version. I haven't used JWS myself, but it
seems darn convenient.
 
L

Lew

A: Trim-and-inline posting.
Q: What should one do instead?
A: It makes the conversation confusingly hard to read.
Q: Why is it bad?
A: Placing answers to quoted material above the material quoted.
Q: What is top-posting?
 
A

Andrew Thompson

I been looking into ways of making a Swing application act like a
conventional program under windows.

Java WebStart is probably the way to go.

Although JWS can install desktop shortcuts, I would
generally recommend against them, but instead offer
a menu item to start the program.

The problem with JWS based desktop shortcuts is a
serious bug that, should the user drag a file on top
of the shortcut (JWS can also add 'file associations'
for an application), the runtime will irretrievably
*delete* the dragged file. It further does not matter
if the file was ever associated with that program
(imagaine a user going to drag a Word document onto
the MSOffice start icon, but they drop it short, onto
a JWS desktop shortcut - bye, bye, Word file).

I doubt the same problem affects either the other
suggested method of creating a desktop shortcut
(right click drag the main jar to the desktop,
and choose 'shortcut' when prompted) or generic
installers such as InstallAnywhere.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top