Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

swing classes in browser

Status
Not open for further replies.

cmmrfrds

Programmer
Feb 13, 2000
4,690
US
I have created an applet that uses swing classes, specifically, JApplet. I looked under the netscape directory structure and did not find a jar file for the swing classes so I copied swing.jar into the classes directory under netscape. I still get a no class def found error for javax/swing/JApplet. I also have IE but I don't know where it looks for the jar files so I couldn't copy the swing.jar under IE. It gets the same error in not finding javax/swing/JApplet. Maybe I am doing something else wrong but I can run the class from JBuilder and it produces the output I expect. Is using swing classes going to be a problem in rolling out and application that can be used on the more prevalent browsers???
 
An additional question. I read that netscape in windows expected the jar files to zip files. Is this the case? If so, where can I download the swingall.zip file from or can I just unjar the file I have and zip it up myself, or am I completely on the wrong track.<br><br>Thank you
 
why not update the VM for your browsers? Download it from the browser's page, or from Sun. If that's not an option, maybe I don't understand your question fully. <p>Liam Morley<br><a href=mailto:lmorley@wpi.edu>lmorley@wpi.edu</a><br><a href=] :: imotic :: website :: [</a><br>"light the deep, and bring silence to the world.<br>
light the world, and bring depth to the silence.
 
When you say update the VM are you talking about the jdk. I have jdk1.2.1 installed on my PC. When I install the jdk is there something specific I need to do with the browser? I am hestitant to download another 20 meg file since I have such a slow modem. I have been looking for a faster modem but no cable available, no DSL, and I have dishnet satellite. My satellite vendor didn't seem to know anything about setting up a modem. <br><br>Jerry
 
JDK is the developer's kit- VM is virtual machine. I'm not sure if it helps to keep the jdk updated, but if it does, you might as well pick up jdk1.2.2 (start the connection overnight, see if it's done by morning?).<br><br>Now I'm not 100% sure, but this is what I think. The VM is basically the browser's ability to understand Java. (Keep in mind, you don't need the JDK to view Java in your browser.)<br><br>You have different options- download the browser all over again (and you know how long that takes) which is sure to have the newest VM (which will probably take care of the files/classes you're missing). Or, just download the VM for your browser. For IE5, you can probably get it from <A HREF=" TARGET="_new"> (just look for the links that say &quot;Microsoft VM and Debug Classes&quot;). I'm not sure about Netscape- I looked around, but couldn't find anything. Best of luck! :eek:) <p>Liam Morley<br><a href=mailto:lmorley@wpi.edu>lmorley@wpi.edu</a><br><a href=] :: imotic :: website :: [</a><br>"light the deep, and bring silence to the world.<br>
light the world, and bring depth to the silence.
 
Thanks Liam. I downloaded both the VM for IE and the new netscape 4.73, which was about 3.5 hours of download time and no problems with the downloads. They are both installed and running. I still get the same error but there was some additional information in the IE java console. It seems to indicate that I have a security problem. Do I need a securitymanager in my applet?<br><br>My applet goes after an access database on my PC. The applet runs okay if I run it from JBuilder, but not when I invoke it from an HTML file in the browsers.<br><br>Jerry
 
hmmm... that could be a problem. This is my theory: JBuilder can grant your applet security access to your database with no problem because it knows that you're running the applet on your PC- you couldn't run a web applet in JBuilder, so JBuilder can grant security. However, applets from browsers have a much stricter security issue- it's dangerous for an applet on the web to access a file on your pc and have read/write access. Java applications have more rights, usually because they're not associated with the web as much as applets are (there are probably better reasons, but none that I can think of off the top of my head).<br><br>Have you tried uploading both of these files to a web server and away from your home PC? If the access database is not on your personal hard drive, the browser might be more likely to grant the applet access.<br><br>There might be additional problems with running a database that's not on a database server- I'm not sure.. and if your server isn't MS, I'm not sure if that's a problem at all (seeing as how it's only Java that's accessing it, there's little interaction between the server and the database)... but try that out and see how it works. Best of luck! <p>Liam Morley<br><a href=mailto:lmorley@wpi.edu>lmorley@wpi.edu</a><br><a href=] :: imotic :: website :: [</a><br>"light the deep, and bring silence to the world.<br>
light the world, and bring depth to the silence.
 
Hi,<br><br>If you are applet tags, it will not work anymore. <br><br>You have to download &quot;htmlconverter&quot; from Sun's Java site. With this you can convert your html pages with applet tags to the pages that work with new java plugins. <br><br>Also you don't need to download the entire jdk ! you get plugins for different browsers, download them and install them. Make sure that you have html converter for the same plugin you are using.<br><br>-Amol<br><br>ps. This should solve the Security problem also. <p> <br><a href=mailto: > </a><br><a href= this site for debugging...This is a good one !
 
Thank you for the help. I need some basic information about the html converter. I went to the javasoft site and I can't find anything that refers to the html converter, although, there are lots of questions on the Forum that talk about the html converter but none says where to find it. Can you give me the name and site for the download?? I will keep looking.<br><br>Also, I have jdk 1.2.1 installed. I downloaded and ran the install for the plug ins j2rel_3_0-win.exe. It ran and gave me a message that it installed okay.<br><br>Jerry
 
 
I found the html converter and downloaded. I ran the html converter on my html file and&nbsp;&nbsp;several other html files that were examples in a book I have. All of the html I run get the message in IE &quot;applet not initialized&quot; and in Netscape &quot;applet notinited&quot;. Am I missing something else??<br><br>Thank you,<br>Jerry
 
I have made some progress in the netscape browser. I have some simple programs that don't do file access that now run in the browser. The program that does database access still does not run but it is a runtime permission problem. I got a tip to go to the&nbsp;&nbsp;Control Panel in the Java Plug-in and enable the Java Console, which now gives me a descriptive error message. I had been looking in the Java Console on the Browser, but apparently that does not give information about the plug-in.<br><br>I get the same error on my database programs in the IE and Netscape browsers, but the simple programs still don't run in the IE browser. They just hang and the Java Console doesn't give me any information. I will try and read up on permissions to see there is a way around the permission problem. Otherwise, I will load IIS on an NT machine I have and see if I can access the program from that PC. Any ideas to short cut this process are appreciated.<br><br>Thank you,<br>Jerry
 
Permissions will work with an applet on your PC, but permissions are set in a policy file in the jdk directory (or probably wherever your VM is). Look for a C:\jdk1.2.2\jre\lib\security\java.security file (it might not be in that directory, it might be in a different tree). Open it in Notepad; if you find weird characters (carriage returns), copy everything, paste it into WordPad or MS Word, and then paste it back into Notepad.<br><br>This lists what files have what permissions. The problem with this document is it's on your hard drive- an applet's on the web. If somebody else accesses your applet, their permissions won't be the same. You can look into signed applets, but I don't know much about that.<br><br>One question is... if you're only concerned about this on your PC, could you make it an application instead of an applet and therefore grant yourself more security priviledges?<br><br>Best of luck.. <p>Liam Morley<br><a href=mailto:lmorley@wpi.edu>lmorley@wpi.edu</a><br><a href=] :: imotic :: website :: [</a><br>"light the deep, and bring silence to the world.<br>
light the world, and bring depth to the silence.
 
Java applets work inside a &quot;sandbox&quot;- kind of a restricted area. If you want to change the rules governing the sandbox, try the &quot;policytool&quot; program in your jdk1.2.2\bin directory. There you can loosen the restrictions on a specific applet- say one embedded in the URI:<br><br><A HREF=" TARGET="_new"> <br><br>If you want to write to your drive or connect to a URI dissimilar from the URI you downloaded the applet from, you need policytool.<br><br>Hope this helps<br>Mattias
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top