|
-
May 26th, 2004, 01:47 AM
#1
Thread Starter
Lively Member
javaapplet / vb question
when the webrowser loads the webpage with javaapplet. how do you send data to the javaapplet's textbox? OR how to setfocus on the textbox in javaapplet
Julie Luvs

-
May 26th, 2004, 10:49 AM
#2
Thread Starter
Lively Member
Julie Luvs

-
May 26th, 2004, 12:42 PM
#3
Fanatic Member
humm.. I am not exactly sure how to do this. I think I did something similar some years ago. What you can do is this:
Find out how to comunicate with the applet via JavaScript... then with VB obtain the IExplorer object and execute the javascript you need.
Sorry i can't help further.
"The difference between mad and genius is the success"
-
May 26th, 2004, 02:35 PM
#4
Frenzied Member
I write Java applets for some of my web pages and communicate with them using JavaScript. Perhaps I can help you.
To get any data into the applet's textbox, there must be a method that you can call to pass the data to the applet. The method must then contain the necessary code to move the data to the textbox.
Who wrote the applet? There should be some sort of document on its usage.
-
May 27th, 2004, 12:17 AM
#5
Thread Starter
Lively Member
I dont know who wrote the java applet, but any help would be very much appreciated, but if you can post an example that would be even better.
Julie Luvs

-
May 27th, 2004, 08:45 AM
#6
Frenzied Member
Calling a method (Sub or Function) in the Java applet is no different than doing it in VB.
What does this applet do? Do you have any documentation for it? What is the name of the applet's class file? Perhaps I can search for it and see what I can find.
-
May 27th, 2004, 10:52 AM
#7
Thread Starter
Lively Member
It's a game with chat. I don't have any documentaton. I am not sure what is the name of the applet's class file. but I got this <applet id=tetris_applet in the view source.
Julie Luvs

-
May 27th, 2004, 12:27 PM
#8
Fanatic Member
typically, the Code parameter is used in the applet tag to reference the class file which will have a .class extension. Once you locate this file, you could download a Java decompiler, and decompile the .class file into a .java file, at which point you could see the source code. Parameters are typically passed from the html page like so:
<applet code=Animator.class width=64 height=64>
<param name=imagesource value="images/SimpleAnimation">
<param name=endimage value=2>
<param name=soundsource value="audio">
alt="Your browser understands the <APPLET> tag but isn't running the applet, for some reason."
Your browser is completely ignoring the <APPLET> tag!
</applet>
The param tag is used to pass any parameter to the Applet. Inside the .java file, these values are easilly retrieved using a method provided by the Applet class called getParameter. A textbox value is set using a method called setText (Swing class), so if the text box is already there, it would be easy to create a little method that sets the textbox value to a parameter provided by the html (which of course could be passed from vb script). If you need examples of Applets, download the currrent J2SE from the Sun website - it has lots of free examples. hope that helps.
cheers.
"Knowledge is gained when different people look at the same information in different ways"
- Louis Pasteur
-
May 27th, 2004, 01:13 PM
#9
Thread Starter
Lively Member
I tried look for anything related to <applet code in the view source, no luck
Julie Luvs

-
May 27th, 2004, 01:32 PM
#10
Thread Starter
Lively Member
<applet id=tetris_applet height="100%" width="100%" code=y.vp.0 name=tetris_applet mayscript>
is y.vp.0 the file name?
Julie Luvs

-
May 27th, 2004, 01:48 PM
#11
Frenzied Member
I've completely ignored the fact that you are looking for the applet name by doing a View Source. This implies that you are not the author of the web page and that you are loading it from some other system.
Since you apparently don't have access to the source (html, Java and whatever scripting language is being used) how are you planning to make the modifications that would allow you to populate the textbox in the applet?
Can you provide any of the source, or a link to the web page for us? It would really help me to see what we are discussing.
-
May 28th, 2004, 10:10 AM
#12
Thread Starter
Lively Member
Actually I think you misunderstood my question 
I am not trying to modify the java applet. The textbox is for user to input the text whatever they want to say. What I am trying to do is set the text into the textbox instead of me typing in there. I am sure if this explaination is clear enough.
Julie Luvs

-
May 28th, 2004, 11:25 AM
#13
Frenzied Member
If the textbox is an object within the applet, you will not be able to access it directly. There must be some method in the applet that you can use to pass it the string and that method must then move the text into the textbox. I think you are out of luck.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|