Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

swing & internet explorer  RSS feed

 
auden james
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Okay, so I have a swing application that I would like to use in 2 ways.

First, I would like to be able to create an icon on my desktop so that I can simply click on the icon and it runs my application. Is this possible?

Second, I would like to be able to access this application from my website. Is there a way to do this?

I have looked extensively at sun's website and all over the web, but can't find any useful information.

Also, is there a way to keep my application on top of all other application running?

Please help !!!
James
[ May 03, 2005: Message edited by: auden james ]
 
Jared Cope
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

You can create an icon for your application in the following way:

1. Create your java command and put it in a text file.
2. When you are happy with the command, change the file extension to .bat and move this file to the desktop.
3. Then just double click the .bat file as you would any other application icon (you can even change the icon picture if you like).


Second, I would like to be able to access this application from my website. Is there a way to do this?


Not quite sure what you mean here. Are you talking about running your application inside a browser (Java applet)? Or do you mean downloading your jar files from your own website and then having them run on the client machine with little to no effort of the end user (Java webstart)?

If you have something else in mind, can you give a description of the scenario?


Also, is there a way to keep my application on top of all other application running?


I've never tried, but maybe you could catch the minimize or defocus event on your JFrame, and then just throw your frame back into focus.

Though you had better have a good reason for this kind of application behaviour, otherwise it might disturb some of your users that want to use other applications at the same time.

Cheers, Jared.
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Second, I would like to be able to access this application from my website. Is there a way to do this?

Applets are old school. Use Java WebStart

Also, is there a way to keep my application on top of all other application running?

The short answer is no. The long answer is the one Jared gave but it won't be pretty when it's done. You will actually see your frame go away and come back. Lots of flicker. And until Mustang, you will probably get the gray screen syndrome.
 
auden james
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the help guys. I tried adjusting my frame to keep it on top, but you were right. It doesn't look very good.

James
 
Mike Rainville
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you want an actual Java application then what you are looking for is Java WebStart; if a web application would do then you would create a servlet on a Tomcat server and create a link that started a web browser with a URL that pointed to the port and directory of your application.
 
Kai Witte
Ranch Hand
Posts: 356
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello,

use Window#setAlwaysOnTop to keep your JFrame always on top.

Conan
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!