• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Java and activeX ?

 
Ranch Hand
Posts: 285
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Has anyone created an activeX to be used from your java application ?

If so, how did you do that ?
please provide some help.

Thanks
 
Ranch Hand
Posts: 1071
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Do you mean activeX in a JSP web page? I couldn't imagine a reason to try and run activeX in a Java application.

Of course I can't imagine wanting to put activeX into a web page either.
 
Shreya Menon
Ranch Hand
Posts: 285
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The reason is I want to access my windows OS [systray] thru my JSP. When i login to my app, an icon should get displayed on the systray and I heard an activeX control can insert an icon on systray.

So now, have anyone created or used ActiveX from Java/Jsp ?

Thanks
 
Shreya Menon
Ranch Hand
Posts: 285
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Urgent: I need some solutions here, if any one can help..
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you can find such an ActiveX control, then all you have to do is embed it in the HTML of the JSP page. This has nothing at all to do with Java -- the appropriate tags to embed this on the page can be in the static part of the JSP, and there's no interaction between the ActiveX control and the Java code in the JSP at all.

Now, the problem you face is that you need to find (or write) this ActiveX control, and learn how to embed it in HTML. You're not going to find the answers to these questions at JavaRanch -- you're going to have to go to a Microsoft site someplace.

Finally, in the future, can you please refrain from posting the same question in so many different threads, in so many different forums at the Ranch? I'm sure people have given you some of this information before, but none of the posters have been able to build on anything anyone else has said, because you keep starting new threads!
 
Shreya Menon
Ranch Hand
Posts: 285
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you can find such an ActiveX control, : yes there are ActiveX controls available, but not written in Java.

Finally, in the future, can you please refrain from posting the same question in so many different threads, in so many different forums at the Ranch? I'm sure people have given you some of this information before, but none of the posters have been able to build on anything anyone else has said, because you keep starting new threads!

Regarding this: I HAVENT asked anything about ActiveX anywhere. I posted the question in Ranch, but didnt get a response. Now by going to so many places[other forums] I found out that an activeX can be used. But I am not familiar with how to integrate ActiveX with JSP. Thats why I opened a new thread[hope to get some replies], Moving threads here and there happens, but if u look, no significant help has been received. I dont know why it is like this ?
 
Ernest Friedman-Hill
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Shreya Menon:
yes there are ActiveX controls available, but not written in Java.



Of course, that's the whole point. Java can't put things in the Windows system tray, any more than a cow can drive a BMW.

But I am not familiar with how to integrate ActiveX with JSP.



You don't, and you can't, but it doesn't matter. Slap that control on your web page, and you're done. Now you just have to find the control.
 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This may not help much but you might be able to use JNI the Java Native Interface to do this.

In a nutshell, the JNI can call library functions in a dll. I've done this with a stand alone application but not from a web page. Java security in an applet may prevent you from using JNI.

If you are able to use JNI, you need to write your own dll, probably in C or C++ and will need to call the windows library call Shell_NotifyIcon. Here are the required definitions, but if you are familiar with windows programming in C you won't have any problem with the tray icon.

Private Const NIF_ICON = &H2
Private Const NIF_MESSAGE = &H1
Private Const NIF_TIP = &H4
Private Const NIM_ADD = &H0
Private Const NIM_DELETE = &H2
Private Const NIM_MODIFY = &H1

Private Type NOTIFYICONDATA
cbSize As Long
hwnd As Long
uId As Long
uFlags As Long
uCallBackMessage As Long
hIcon As Long
szTip As String * 64
End Type

Private Declare Function Shell_NotifyIcon Lib "shell32.dll" _
Alias "Shell_NotifyIconA" (ByVal dwMessage As Long, _
lpData As NOTIFYICONDATA) As Long

I've never put an icon in a tray from C, but I have from VB and it's easy enough.

All in all, it's not a quicky solution.
 
Shreya Menon
Ranch Hand
Posts: 285
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you David for your suggestion. will take a look at it,...

BTW, Ernest
I was reading this article:
http://www-128.ibm.com/developerworks/library/os-activex/

Again it talks about integrating an application.. But since its a nice article thought of sharing in the ranch
 
Ernest Friedman-Hill
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by David M Fairchild:
This may not help much but you might be able to use JNI the Java Native Interface to do this.



Shreya has been advised already about JNI being an option, but rejected it because it would require installation on the client machine. The nice thing about the ActiveX version is that it can be downloaded as part of the web app.

The article you link to, Shreya, is about integrating ActiveX controls into desktop applications, where the Java code is running on the desktop machine. You're talking about a Web application, a JSP application, in which the Java code runs entirely on the server, on a different machine altogether. There's no comparison.

Shreya, can you explicitly spell out your requirements for us? Tell us exactly what you can and can't do, here. Does it have to be zero-install? Does it have to be JSP? What else?
 
author
Posts: 23951
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Of course, that's the whole point. Java can't put things in the Windows system tray, any more than a cow can drive a BMW.



I have an issue with any analogy that refers to Java as a cow, while at the same time, refers to Windows as a BMW ...

Henry
 
Shreya Menon
Ranch Hand
Posts: 285
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ernest,

The article you link to, Shreya, is about integrating ActiveX controls into desktop applications, where the Java code is running on the desktop machine.
Correct: I just forwarded, in case if helps

Shreya, can you explicitly spell out your requirements for us? Tell us exactly what you can and can't do, here. Does it have to be zero-install? Does it have to be JSP? What else?

Thanks for asking, first time some one asked what I want, apprecaired:

Requirements:
Insert an icon to the systray when users log in to the web application using a URL.

Yes, If possible our clients dont want anything to be installed on the client machines. Right now our app is client/server based. We install client on all client machines . When clients log in to the client, an icon gets displayed on systray.

Because of the whole world moving towards web, clients are asking whether we can convert our app to web based.[ have all code installed on a server] so that clients can go to a URL and access the app. But they want the same icon to get displayed when they succesfully login to the app.

Purpose of this icon: This icon flashes right now, when a new work comes to the users. Even if the window which they are accessing is minimised, by seeing the icon they can understand that a new work is waiting for them.
Now when the users log out of the system/close browser, this icon should disappear from systray.


Thanks and hopefully I will get some help..
 
Ernest Friedman-Hill
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Henry Wong:


I have an issue with any analogy that refers to Java as a cow, while at the same time, refers to Windows as a BMW ...

Henry



Actually, I usually get myself into trouble by contrasting "Windows machines" on one hand with "actual computers" on the other.
 
Ernest Friedman-Hill
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Shreya Menon:

Purpose of this icon: This icon flashes right now, when a new work comes to the users. Even if the window which they are accessing is minimised, by seeing the icon they can understand that a new work is waiting for them.
Now when the users log out of the system/close browser, this icon should disappear from systray.



OK. Now, there is only one way that this could possibly function: one way or another, that icon has to be attached to a client program running on the user's desktop. That client is going to have to communicate with the server to receive information about new work units.

This client could be (among other things!):

1) A signed applet plus a native-code DLL. The user would have to download and install that DLL. They would have to have the Java Plugin installed.

2) A JavaWebStart application with a native-code DLL. The DLL could actually be included in the Java Web Start application and installed automatically. But the user would have to have Java Web Start installed.

3) An ActiveX control. This would be downloaded automatically, with zero install for the user. The downside, of course, is that this is not written in Java.

Now, regardless of what the client is, it has to talk to the web application somehow to find out about available work. Again, there are many possibilities:

1) It could simply poll a special URL within the web app. This is the simplest and works with all three client architectures. The downside is that the icon wouldn't know immediately when it was supposed to disappear.

2) It could use RMI. This would only work with 1) and 2) and can be complicated to set up, but could be bidirectional -- no polling.

3) It could use a socket connection. This would work with all architectures, and be bidirectional but is perhaps the most fragile, and could have firewall problems.

No matter how you slice it, this is a hell of a lot of work. You need to do a cost-benefit analysis before you decide to proceed.
 
Shreya Menon
Ranch Hand
Posts: 285
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ernest,



This client could be (among other things!):

1) A signed applet plus a native-code DLL. The user would have to download and install that DLL. They would have to have the Java Plugin installed.

2) A JavaWebStart application with a native-code DLL. The DLL could actually be included in the Java Web Start application and installed automatically. But the user would have to have Java Web Start installed.

3) An ActiveX control. This would be downloaded automatically, with zero install for the user. The downside, of course, is that this is not written in Java.



REgarding the client, the client can be a jsp with either an applet or an activeX [if possible] embedded in it, right ?

Thanks
 
Ernest Friedman-Hill
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The Java code in a JSP runs on the server, and it runs before the user ever sees the page. By the time the user sees the web page, the Java code has run and returned. Therefore the Java code in a JSP page with an applet or ActiveX control embedded in it can not communicate with that applet or JSP. They are separated in both time and space.

The point is that yes, the client can be an applet or ActiveX control, as I said, but whether the applet or control is embedded in a JSP page or a static HTML page doesn't matter at all.

Do you understand the point I'm trying to make? It's important, and I think several people have already given up trying to get you to understand it.
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
One point that I would mention on top of everything else, is that you said that when the browser closes you want the icon to disappear from the systray. Now that will be a big trick since it is basically impossible to know when the user closes the browser.

Maybe you should look into using Swing and Java Web Start so that you don't have to go to each client and install the application. And you can use Sockets to connect to the Server and have nice flashies.

Even in Visual Basic, we create a way that you wouldn't have to re-install it on the client when an upgrade occurs, it would update itself automatically.

OK, I think I stirred the Wasp's nest enough.

Mark
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
But Mark, you make good points. I think a point of focus is the gab between a webapp and a desktop app. It sounds like the clients want the best of both worlds. That's fine, but they are going to be seperate.
 
Shreya Menon
Ranch Hand
Posts: 285
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

Is something gping wrong with javaranch ? I remember there were 23 replies in my post, now I can see only 17. whatever posted on friday has vanished!!! what happened ? Has any one noticed this !!!
 
Ernest Friedman-Hill
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
See this explanation.
 
Shreya Menon
Ranch Hand
Posts: 285
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hoo, Luckily I saved couple of last suggestions to my PC..

well, I am experimenting with JWS. I have a DLL with me which creates an icon on my systray. Now I am going to put my DLL thru JWS to another computer. Thats where I am ..

Thanks
 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There is a new Tray Icon API project that I saw on java.net. Check it out!

Tray Icon API

There is a JWS demo, and it works just fine on my Win2k machine. This may not help you now, but in the future it might be an option.
 
Shreya Menon
Ranch Hand
Posts: 285
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ernest,

Before trying JWS with DLL, I thought of trying JDIC tray.jar with JWS. I created a jnlp file and trying to invoke that jnlp thru a link. Now, does JWS always need to launch an application. I donot want to launch this app. I just want to install my jar file/DLL using JWS. Looks like JWS inserts jar to its own cache and automatically launches the app [That means, I need to have an application-desc tag with a main-class in jnlp file.

Have you or anyone tried to use JWS and just install jar/DLL ?

Thanks
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Shreya Menon:
Ernest,

Before trying JWS with DLL, I thought of trying JDIC tray.jar with JWS. I created a jnlp file and trying to invoke that jnlp thru a link. Now, does JWS always need to launch an application. I donot want to launch this app. I just want to install my jar file/DLL using JWS. Looks like JWS inserts jar to its own cache and automatically launches the app [That means, I need to have an application-desc tag with a main-class in jnlp file.

Have you or anyone tried to use JWS and just install jar/DLL ?

Thanks



That's not what it is for. JWS is for running java applications but launching them via the web. After the application runs the first time, any future attemp to run the application just checks for updates. If there are not, it runs. If there are updates, it downloads the new updates and then runs.

Do some reading Shreya. The JWS is full of docuemntation. You should know from reading that what JWS is used for. It's not just an installer. If you want to just install some JAR files and DLL's then use InstallShield or something designed for that.
 
Shreya Menon
Ranch Hand
Posts: 285
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just wanted to let everyone know that I am succesful in displaying my icon through a web app.

I created a DLL and called the functions implemented using JNI in my web app.

Thanks Ernest and Greg

Shreya
 
reply
    Bookmark Topic Watch Topic
  • New Topic