Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!

Charlie Boss

Ranch Hand
+ Follow
since May 22, 2001
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Charlie Boss

My applet uses the java 1.3 plugin so instead of using the <applet></applet> tags on the html page it uses <object></object>
now i've been reading on how to use javascript to talk to my applet however all the examples i've seen so far call applet methods like so:
document.applets[0].appletMethodName();
how do i do this in the new java plugin since i'm not using the applets array but the new object tags. Help please.
19 years ago
hello,
is there a way i can use javascript to check whether a certain applet is already loaded into the JVM memory?? code examples please.
19 years ago
Hi i'm also interested in this answer. Heres my scenario. A user clicks on a link to my applet and it opens another window which holds my applet. My applet is also in a frame.
I currently call window.close() from my applet. However whenever the user goes back to click on the applet link (the previous window) the applet never reloads..
I partially solved this by calling System.exit(0/1) before i called the window.close().. my applet exited AND i had no problem clicking on the applet link to reload it.. HOWEVER the applet browser will still be open.. (my applet is in its own frame)..
when call System.exit(0/1) after i call the window.close() then both windows close.. the browser window holding my applet AND the browser window containing my applet link.
i want to be able to call window.close() so it closes my applet browser window and also call system.exit() so i can reload my applet.
19 years ago
i don't know about using eval.. but this is how i call show an alert..
Object[] arguments = {"test"};
arguments[0] = "No Information retrieved from database.";
win.call("alert", arguments);
19 years ago
I have an applet that talks to my servlet. My servlet retrieves and stores database information. My problem is that at random, emphasis on random, my applet opens up with no database information populated. This happens even when my tomcat service is still on. I usually re-start the service and my applet gets populated.
Have any of you come accross this tomcat behaviour?? i don't think the problem is from my applet.
19 years ago
I have these params in my applet html file:
<PARAM NAME="cache_option" VALUE="Plugin">
<PARAM NAME="cache_archive" VALUE="tsapplet.jar">
So i'm caching my applet in the jvm for faster applet downloads. I have one html file with a link to the applet which opens in another window. I get a problem when i do the ff steps:
1) I click the applet link and it opens my applet html file in another window. "no problem"
2) I click close on my applet which calls a javascript window.close on the window containing my applet. "no problem"
3) I click on my applet link again (as in step 1). This time the window containing my applet freezes up. Nothing happens. "problematic"
Question: Is there a way i can unload the applet from the plugin when i destroy my applet, is there any other cleanups my applet destroy method should do so when i click on the applet link (2nd time) my window opens up the applet instead of freezing.
19 years ago
sorry not yet.. luckily i didn't have to use the MS jvm. I'm interested in the answer though.
19 years ago
you have to include the -alias option
19 years ago
This is the listener for my selection box. When its selected i'm checking to make sure we have a transaction selected already. If theres no transaction selected, i show a dialog box which says: "You have to select a Transaction first." simple enuf huh.. my problem is the dialog box that pops up refuses to go away even after you click its "ok" button a guzzilion times.. its stuck on the applet and i can't do anything else till i get rid of it.. leaving my applet in a frozen state.. NOT GOOD.. have any of you experienced "frozen" dialogs and how can i remedy this. Thanks in advance.
cCabinet.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e){
JComboBox cb = (JComboBox)e.getSource();
cabinet = (String)cb.getSelectedItem();
//make sure we have a transaction
if ( cboTransaction.getSelectedIndex() != -1 ){
} else {
cCabinet.setSelectedIndex(-1);
JOptionPane.showMessageDialog(null, "You have to select a Transaction first.", "Warning: Required field not present.", JOptionPane.ERROR_MESSAGE);
}
}
});
19 years ago
ok so i give up.. I'm way over the deployment deadline so i'm going to use a hack for now - till i figure out why i cant print from my applet..
since i can print from the command line with no problem this is my proposed hack..
The client downloads the applet.. the applet has been given priviledge to install/copy a class file at say c:\temp_reports\PrintDocument.class. How can i send messages to this class to 1) initiate the display 2) print from the command line
is this hack even possible..
19 years ago
check your debug level and set it to 0 in the console.. otherwise use an earlier plug-in
19 years ago
how can i make our internal CA a trusted CA/source in the cacerts file.
19 years ago
hi srikanth,
I used javascript to achieve this and its easier than it seems.
Here are the steps:
import netscape.javascript.*;
//in the actionlistener for the "close" button call destroy()
//in destroy after doing all your cleanup call
JSObject.getWindow(this).eval("javascript:shutDown()");
//the above code will call the javascript function shutDown which should be defined in the <head></head> of your html containing your applet tags.. hope this helps
oh yeah.. in your applet tags you must have this parameter..
<PARAM NAME="MAYSCRIPT" VALUE="true">


[This message has been edited by Charlie Boss (edited July 06, 2001).]
19 years ago

Originally posted by Amit Agarwal:
Good news guys,
I have checked the usage of trusted applets with Java(TM) Plug-in: Version 1.3.0rc1-T using JRE version 1.3.0rc1 Java HotSpot(TM) Client VM. It seems sun has solved the problem of not looking at the IE repository. Now, you can simply give a link to the certificate on your web page, and ask the user to install it in their browser. Once the certificate is installed your applet's signature will be verified against the IE repository and the user will be asked if he would like to grant the applet privileges.
You no longer need to manually import the certificate in the cacerts file. Although, it may be required for some users who might be using some particular sub version java plugin 1.3, but they can simply upgrade to a newer version.
Amit


hey Amit,
how do you do that
19 years ago