Results 1 to 19 of 19
- 04-10-2008, 12:13 PM #1
Member
- Join Date
- Apr 2008
- Posts
- 9
- Rep Power
- 0
Generate an event to another java application
I'm not an advanced user but this question is directed to advanced users
I have an already created java application, which code i can't modify. My purpose is create another application which can control the first one.
I mean, the first one have a button called RUN and an actionPerformed method associated to it. Then i have to do that this event is called from the other application whitout clicking this button in the first one.
I´m spanish so my english is no so good. Sorry!
- 04-10-2008, 12:16 PM #2
Are you using a web application or else. Please give some more details about your question.
sanjeev
- 04-10-2008, 08:12 PM #3
Member
- Join Date
- Apr 2008
- Posts
- 9
- Rep Power
- 0
No. The application that i'm trying to "control" is a .jar file, is not a web application, you can run it in your computer just having Java Virtual Machine and executing the .jar file.
My purpose is to know if is possible to control one application already created from other application.
If you need more details please tell me
- 04-11-2008, 07:17 AM #4
Can you send that jar.. so that i can check what exactly it is.
sanjeev
- 04-11-2008, 07:42 AM #5
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Are you trying to execute a jar file from a button event? I think because of the jar you say that in the first post,
Is that right. If not correct me.I have an already created java application, which code i can't modify.
- 04-14-2008, 02:43 PM #6
Member
- Join Date
- Apr 2008
- Posts
- 9
- Rep Power
- 0
No, Eranga.
I need to execute a button of an application from another different application. It means, i need to generate the onClick button event from my application to annother one.
- 04-16-2008, 08:40 AM #7
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
What you mean generate onClick button event? I'm not clear what you say here pal.
Again, did you want to generate a onClick button event on a application by another application?
- 04-16-2008, 01:35 PM #8
Member
- Join Date
- Apr 2008
- Posts
- 9
- Rep Power
- 0
Yes. I want to generate an event to one application from another one.
The first application has a Botton which has associated an actionPerformed event. I'll need to call this event from the other application.
I think it must be possible but i don't know how!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!
HELP!!!
- 04-16-2008, 01:43 PM #9
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
- 04-16-2008, 02:26 PM #10
Member
- Join Date
- Apr 2008
- Posts
- 9
- Rep Power
- 0
I'm working with jBuilder.
- 04-16-2008, 02:27 PM #11
Member
- Join Date
- Apr 2008
- Posts
- 9
- Rep Power
- 0
but i can work with any other java IDE if it's better
- 04-16-2008, 02:40 PM #12
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
No no, I'm not worried about your IDE. My question is that, when you create a actionPerformed method, what is the access modifier of it? I think it is private.
- 04-16-2008, 02:48 PM #13
Member
- Join Date
- Apr 2008
- Posts
- 9
- Rep Power
- 0
OK!
The application that has the button is already created and i can't modify it. But i saw its code decompiling with an application called JAD.
Then, it has a class named MyActionListener which catch all events and watches which is the event type.
The code of this class is
private class Osejs$MyActionListener
implements ActionListener
{
public void actionPerformed(ActionEvent _evt)
{
String cmd = _evt.getActionCommand();
if(cmd.equals("New"))
{
if(!isEmersionConnected() && isApplet)
{
Args[0] = cmd;
if(htmlWindow != null)
htmlWindow.call("ejsCommand", Args);
}
if(readOnly)
{
JOptionPane.showMessageDialog(Osejs.access$500(Ose js.this), Osejs.access$600().getString("Osejs.ReadOnly.Messa ge"), Osejs.access$600().getString("Osejs.ReadOnly.Title "), 1);
return;
and continuous. So, i need from the other application, to generete an event that this class can capture and treat it
- 04-16-2008, 02:50 PM #14
Member
- Join Date
- Apr 2008
- Posts
- 9
- Rep Power
- 0
If i don't explain right in english please tell me and i'll try do it better
- 04-16-2008, 02:53 PM #15
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Ok, Here what happened is, that ActionLitener deals with the ActionEvent. As you can see in the above code it's get the action command, that is the text of your control. So try to do the same thing on the other class and check it on this class. If you pass the test, simply call the correct functions. I don't think you can generate the code there.
- 04-16-2008, 02:58 PM #16
Member
- Join Date
- Apr 2008
- Posts
- 9
- Rep Power
- 0
you say that
So try to do the same thing on the other class and check it on this class.
But it implies to change the code of the program. And i can't do it. I only can create another program to controll it. You know what i mean????? Maybe is possible that i don´t understand you too.
- 04-23-2008, 06:03 PM #17
You have to bypass the whole GUI code in the jar file. If you are lucky enough the classes that do the job when the button is clicked are public and have public interfaces. In that situation you can call them directly from your application and use the jar file as a library. If the API is not public you might still stand a chance by declaring your classes in the same packages as the classes you want to call. Hope this helps.
Daniel @ [www.littletutorials.com]
Language is froth on the surface of thought
- 05-12-2008, 01:55 PM #18
Member
- Join Date
- May 2008
- Posts
- 4
- Rep Power
- 0
yes. i am using web application. i want pagination in jsp.
- 05-12-2008, 01:57 PM #19
Member
- Join Date
- May 2008
- Posts
- 4
- Rep Power
- 0
Similar Threads
-
addActionListener(java.awt.event.ActionListener) in java.awt.Button cannot be applied
By mathias in forum Java AppletsReplies: 3Last Post: 03-26-2009, 10:31 PM -
difference btwn java.awt.* and java.awt.event.*
By ahdus in forum New To JavaReplies: 5Last Post: 11-17-2007, 06:07 PM -
How to generate random number in java
By fernando in forum New To JavaReplies: 1Last Post: 08-01-2007, 07:32 PM -
How can I generate MsWord from java?
By simon in forum Advanced JavaReplies: 2Last Post: 08-01-2007, 04:40 PM -
JBoss and Java 6:Exception occurred during event dispatching
By Ed in forum Advanced JavaReplies: 2Last Post: 07-04-2007, 05:23 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks