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
Printable View
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
:confused:
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.
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.
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. :)
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.
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.
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.
I tried look for anything related to <applet code in the view source, no luck :(
<applet id=tetris_applet height="100%" width="100%" code=y.vp.0 name=tetris_applet mayscript>
is y.vp.0 the file name?
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.
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.
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.