Chris Masters

Greenhorn
+ Follow
since Apr 13, 2001
Merit badge: grant badges
For More
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 Chris Masters

Does anyone have any experince conserting an existing Java 1.1 program to a 1.3 program. My manager proposed doing this and I have only a little experince with Java 1.1. I know that the basic compleixty of the program will affect how diffucult it is but I was wondering how different the language is between the two versions? Thoughts? ideas?
22 years ago
I'v written a javascript that launch a batch file that in turn launches my java application. Mt problem is I need to be able to pass a parameter (the current webpage address) to my application. I am unsure how to do this, any ideas? My webpage code is pasted below:
_________________________________________________________________
<HTML>
<HEAD>
<TITLE>HTML CAPExp Test Page</TITLE>
</HEAD>
<BODY>
If you wish to launch NeuMICS Capacity Expert .<BR>
<SCRIPT>
function exec (command) {
if (document.layers && navigator.javaEnabled()) {
window._command = command;
window.oldOnError = window.onerror;
window.onerror = function (err) {
if (err.indexOf ("User didn't grant") != -1) {
alert('command execution of ' + window._command +
' disallowed by user.');
return true;
}
else return false;
}
iexplorer.security.PrivilegeManager.enablePrivilege
('UniversalExecAccess');
java.lang.Runtime.getRuntime().exec(command);
window.onerror = window.oldOnError;
}
else if (document.all) {
window.oldOnError = window.onerror;
window._command = command;
window.onerror = function (err) {
if (err.indexOf('utomation') != -1) {
alert('command execution of ' + window._command +
' disallowed by user.');
return true;
}
else return false;
};
var wsh = new ActiveXObject('WScript.Shell');
if (wsh)
wsh.Run(command);
wsh.Echo("file:///D:\JProjects\CAPExp\portal_CAPExpDemo.html");
window.onerror = window.oldOnError;
}
}
</SCRIPT>
<A HREF="javascript: void 0"
ONCLICK="exec('cpx'); return false;">
cpx
</A>
<PARAM NAME="capacityServer1" VALUE="my!Complex;usildaml;20330">
<PARAM NAME="capacityServer2" VALUE="ERIC'S_CPXTEST;usildaml;20355">
<PARAM NAME="capacityServer3" VALUE="DAVID's_CPXTEST;usildaml;20345">
<PARAM NAME="capacityServer4" VALUE="TIM's_CPXTEST;usildaml;20335">
</APPLET>
</BODY>
</HTML>
I'm working with some javascript to launcha given application my problem is I don't understand Java well enough to know how make it compatible with both IE and netscape. I've never dealt with Javascript before and the code I'm using is code I copied from another site and then modified as best I could figure.
________________________________________________________________
<HTML>
<HEAD>
<TITLE>HTML CAPExp Test Page</TITLE>
</HEAD>
<BODY>
If you wish to launch NeuMICS Capacity Expert .<BR>
<SCRIPT>
function exec (command) {
if (document.layers && navigator.javaEnabled()) {
window._command = command;
window.oldOnError = window.onerror;
window.onerror = function (err) {
if (err.indexOf ("User didn't grant") != -1) {
alert('command execution of ' + window._command +
' disallowed by user.');
return true;
}
else return false;
}
iexplorer.security.PrivilegeManager.enablePrivilege
('UniversalExecAccess');
java.lang.Runtime.getRuntime().exec(command);
window.onerror = window.oldOnError;
}
else if (document.all) {
window.oldOnError = window.onerror;
window._command = command;
window.onerror = function (err) {
if (err.indexOf('utomation') != -1) {
alert('command execution of ' + window._command +
' disallowed by user.');
return true;
}
else return false;
};
var wsh = new ActiveXObject('WScript.Shell');
if (wsh)
wsh.Run(command);
window.onerror = window.oldOnError;
}
}
</SCRIPT>
<A HREF="javascript: void 0"
ONCLICK="exec('cpx'); return false;"
>
cpx
</A>
</APPLET>
</BODY>
</HTML>
_______________________________________________________________
I figure it has to do with adding some kind of if statement that will detect what type of browser and then will change the the change "iexplorer.security.PrivilegeManager.enablePrivilege" to "netscape.security.PrivilegeManager.enablePrivilege" but I'm not sure how to make that call.
I have a java application that is running in java 1.1.8 jre. I need to be able to parse a document for parameters, and then update a local file with those parameters. I found a class in the help library called HTMLEditorKit, that looks like it would be the way to go. But I am not sure how to implement a parser using this class. Can anybody help? A simple example would be appreciated.
22 years ago
I tried you code and it is working very well thank you. One follow up question is there a good way too implement thes recursive to capture the output continously throughout runtime? There must be perhaps I am supposed to make the class recursive check the output stream throughout runtime. Thank you very much for your help,
22 years ago
I just want to automatically capture the output stream that is being displayed in the dos window. I want to keep it as an execution log for debugging purposes.
22 years ago
Is there away to catch the entire output?
22 years ago
I have a Java application that I've been working on and I wanted to create a function that piped all the console output to a txt file so it could be viewed by the user and used for debugging. Do you have suggestions on how to implement this?
22 years ago
I am currently implementing a class that sends a dynamically generated graph to the printer. The implmentation uses a chart control program that I genrates these dynamically created graphs as a Graphic output that is then formatted and sent to the printer.
My problem is that I need to create a wait() of some sort to pause the program while it preforms this action.
I was looking at my options and since the MediaTracker looked to be the most promising way of pausing the code while it painted the image that was going to the printer. However the MediaTracker would not accept the Graphic output. Is there another method like mediatracker that works with the Graphic class, in the Java 1.1.x package?
22 years ago
Currently I have a program that uses the PrintJob awt class to print a chart. I would like to use the class but disable the landscape option because my chart control illustrates some unusual behavior that is rather unpredictable when the landscape option is selected. Is there a was to disable the properties button on the printJob class dialog?
22 years ago
Thank you I got it working. It has been very educational.
22 years ago
I'm sure you're tired of the newbie questions but hopefully this will be my last. I tried putting the directory name of the html page and it doesn't work. All my documentation on the Runtime class is pretty thin do you want the rules are regarding how you pass a commandline to the runtime class are?
If I wanted to open a html page with the default directory what would that look like?
22 years ago
Thank you for the sample code witha few changes and by adding an addtional frame to the application the simple browser now works. My new problem is that it displays the html page however the links and the frames do not work. I assume I'll have to add a HyperlinkListner to fix the links but how to I go about gettin it to recognize the frames?
It occurs to me it might be easier to simply launch explorer from the application. Unfortunately I'm clueless on how to do that. If you can answer either of these questions Id apprecaite. Take care
22 years ago
I've used the JeditorPane but it generates an error when opening. My code is as follows:
shortname = httpFileName;
setMessage("Invoking HTML file: "+shortname);
try {
JEditorPane htmlPane = new JEditorPane(shortname);
htmlPane.setEditable(false);
this.add(new JScrollPane(htmlPane));
}
catch(IOException ioe){ System.err.println("Error displaying " + httpFileName);}
setCursor(Default_Cursor);
After going through debugging I've confirmed that it does excute the JEditorPane but then it throws the exception. I have confirmed the files are there. Any ideas?
22 years ago