Amanda Albert

Ranch Hand
+ Follow
since Jun 12, 2006
Amanda likes ...
Eclipse IDE
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 Amanda Albert

I'll try to better re-explain what I'm experiencing now. I noticed that if I open either browser and access my applet as the very first thing, there is no lag. If I access the applet after the browser has already been opened for a few hours and various other sites/applets have been accessed, then there is a lag. When I close the browser, re-open it, and re-access the applet, there is no lag. This changed a little this morning when a co-worker opened the applet as the first thing in his IE browser and experienced the lag; but once he cleaned his cache, and deleted his cookies, there was no lag in the applet.

Perhaps, like you mentioned earlier, this is all irrelevant, and just a coincidence of another problem. That's what I'm trying to figure out. I really don't think it's a problem with my applet's code/processing since the problem doesn't occur all the time and wasn't easy to duplicate at first, until I closed my browser. So what else could it be?

I do appreciate your responses to the matter.
13 years ago
My applet is pretty self contained. On load, it reads from a file once and stores the data in a collection. When the applet needs to perform the bulk of its duty, it accesses the collection, which is fairly large. That's why I initially thought it might be a problem with the efficiency of my code, but I even doubted that because the problem didn't occur all the time or for everyone. Now I'm pretty sure it's a browser cache problem, but I'm wondering if there is something I can do in my program to mitigate against that.
13 years ago
I have a development on this. I noticed the lag occurs when the browser has already been open for a while. The "fix" is to close the browser and reopen it; when I access the applet again, there is no lag.

So this makes me think it's a caching issue. I just did a quick Google and programmatically clearing the cache is frowned upon, if not impossible. Then I found a post where someone suggested adding the following tag to the HTML page:

I realize this will prevent the browser from caching *this* page, but I don't think this solves my problem of an "already full" cache.

Thoughts?
13 years ago
Perhaps this post might be better suited in the Performance forum? I have re-posted there, so perhaps we can close this thread.

Thanks!
13 years ago
The basic gist of my applet is this: the user clicks a button, moves the mouse in a blank area, after a certain number of data points are collected, the applet performs some functions, then displays the results in a JList. I had several people access the web page all at once. Some people experienced a lag in Internet Explorer, but never in Firefox. The IE lag was inconsistent; some people experienced it, others did not. The lag occurs after the final data point is collected, and before the results are displayed. The lag was up to 15 seconds.

I've made some tweaks to the code, but since the lag doesn't occur in Firefox, and no errors are generated, I can't determine the issue. Here is the information I know:

IE version = 7
FF version = 3.5.5
JVM version = 1.6.17

I hope this isn't a too open-ended question. I was hoping someone would have generic thoughts on why the performance would be different between the two browsers. Also, I was going to try using the Executor interface so I can generate threads that return the calculations to the applet. Perhaps this will help as well.

I appreciate your thoughts.
13 years ago
So I have my applet running, and I had several people access the web page all at once. Some people experienced a lag in Internet Explorer, but never in Firefox. The IE lag was inconsistent; some people experienced it, others did not. The basic gist of the applet is this: the user clicks a button, moves the mouse in a blank area, after a certain number of data points are collected, the applet performed some functions, then displays the results in a JList. The lag occurs after the final data point is collected, and before the results are displayed. The lag was up to 15 seconds.

I've made some tweaks to the code, but since the lag doesn't occur in Firefox, I can't determine the issue. Here is the information I know:

IE version = 7
FF version = 3.5.5
JVM version = 1.6.17

I hope this isn't a too open-ended question. I was hoping someone would have generic thoughts on why the performance would be different between the two browsers.

I appreciate your thoughts.
13 years ago

Paul Clapham wrote:One option is to put it into the Applet.jar file, then access it like this:

That's assuming it's in the root of the jar. If it's in some subdirectory, then specify that as part of the path.



Thank you Paul, it totally worked. I still had to keep a copy of the file in bin/classes, in order to run the program in Eclipse.

Thank you soo much!

Amanda
13 years ago
Thanks for your response Paul.

I will try the direct approach you suggested, but I think I am doing something similar already. I apologize for not supplying more information earlier, but I didn't realize the difference between the files as you defined.

Here is the full function:


I am using an InputStream, but I don't call the getClass().getResource() method like you suggest. I'll give your suggestion a try, and let you know what happens!
13 years ago
Interesting. I have JDK 6u23 64-bit installed on that machine. Is "JDK 1.6.0p12" newer than what I have?
13 years ago
I have an applet that needs to reads from a text file. My project structure is as follows:

--dir src
   --dir appletPackage
       *.java files

--dir bin
   --dir classes
    appletText.txt
    --dir appletPackage
        *.class files

In the function that starts to read from the text file, I simply use a relative path.



When I run the application in Eclipse, it runs fine. However, when I run the application as an application from a web page, the application cannot find the text file. My JAR is packaged just like the Eclipse directory structure. My applet tag is as follows:



My applet runs fine, but when I access the function that references the appletText.txt file, I get the FileNotFound Exception. I tried changing the "code" attribute to read , but that didn't work either.

Where does the file need to be?
13 years ago
Yep, it appears that the problem was my laptop is running 64-bit JRE, which doesn't include a Java plug-in for browsers. I'll mark this as resolved. But stay tuned for another thread from me :-).
13 years ago
Thanks for your response.

I did make it simple, and I revised the applet tag just like you suggested.

I think the problem may be that, according to some documentation I read on Oracle's website, there is no Java plug-in for 64-bit Windows. I going to try installing a 32-bit version of the latest JRE and run the 32-bit version of IE to see if that works.
13 years ago
I can't seem to deploy any Java applets. I am attempting to deploy the examples from the Java Tutorials - Deploying Applets; I see the html text, but where the applet is supposed to be, all I get is a frame with a red X.

I compiled the classes to a jar, per the instructions. So now my directory structure looks like this:

Under D:\Projects\Java\applet_ComponentArch_DynamicTreeDemo\build\classes:
  • directory appletComponentArch (contains the class files)
  • AppletPage.html
  • AppletPage_WithAppletTagNoJNLP.html
  • AppletPage_WithAppletTagUsingJNLP.html
  • dynamictree-applet.jnlp
  • DynamicTreeDemo.jar


  • I revised AppletPage_WithAppletTagNoJNLP.html by removing the external javascript references since I am on a standalone laptop and that was closest to how I wanted to deploy my personal application.

    I have set my JAVA_HOME environment variable, as well as adding %JAVA_HOME%\bin to the Path variable. I am able to run the applications using Eclipse's AppletViewer just fine. I'm using JDK and JRE 1.6.23.

    I also noticed that on my laptop, the Java icon does not show up in my system tray like it does when I run the tutorial examples on my Internet-connected machine. On my laptop, I have changed settings in the Java Control Panel to always Show the Console, and such. I'm running Windows XP 64-bit.

    What else could I be doing wrong?

    Amanda
    13 years ago
    Thanks! The last one I came across earlier and didn't seem to quite fit what I want to do. But I'll review the other two.

    13 years ago
    I've been looking on Google all morning and I haven't found a straight answer. Is there a library or package in the Java API that allows us to call exported functions from Window systems DLLs? I'm mainly interested in setupapi, user32, and cfgmgr32 DLLs. I found there was once a com.ms.win32 package in Java 2.0, but I don't see any reference to it the Java 6.0 API documentation. There is the JInvoke software I could purchase, but is there something free? I found some code examples using JNI, but the examples discussed creating my own DLL and call javah to create a C header file; I don't want to do that, either.

    I would appreciate just a little guidance on this issue, please.

    Thanks!
    13 years ago