Slow Applet

this has got to be one of the simplest applets, yet it takes over 10 minutes to run the second part.
here's the source
(done in netbeans, I'm a newb)
import java.awt.*;
import java.awt.event.*;
import java.applet.Applet;
public class gpaApplet extends java.applet.Applet implements ActionListener {
  public Button sub=new Button("Submit");
  public TextField number=new TextField(5);
public void init() {
setLayout(new FlowLayout());
add(number);
add(sub);
sub.addActionListener(this);
public void actionPerformed(java.awt.event.ActionEvent a) {
if (a.getSource()==sub) {
int num=3, index=0;
TextField[] ta = new TextField[num];
remove(number);
remove(sub);
setLayout(new FlowLayout());
add(ta[0]);
}this is not all of what i plan to do with it, but i need this to work in order to do what i plan to do. after it removes the textfield and the button (number and sub), it takes 10 minutes+ (i never waited to see how long it takes, all i know is that its still trying after the 10 minutes but still hasnt displayed anything to the screen) to display just 1 textfield from the array.
when i dont use arrays, and i just make 1 textfield and display it (after removing the textfield and button) it takes about 2 -3 minutes to display the textfield,
i've tried it on 3 computers, one of which was a 3 ghz machine with 1 gig of ram. so i dont see why its soooo daam slow
can someone please help me solve this problem?

ok, now the problem arises here. i need to make the "num" number of textfields, based on whatever is input (i'll add that code later, after i get this to work).
so how do i make as many textfields as i want? i tried putting a "for" loop within...
TextField[] ta = new TextField[] {
//for loop goes here
}i tried putting that loop in there, but it would not allow it. gave some kind of error.
so my question. how do i make as many textfields as i want, based on the number that the user enters.

Similar Messages

  • Very slow applets on Safari 5 and 1.6.20 - works fine in Firefox

    Hello,
    Has anyone else noticed very slow applets in safari 5? I'm running 1.6.0_20 and trying run any of the applets at http://openprocessing.org results in VERY slow applet performance.
    If i load the same applets in Firefox things run smoothly.
    For example, load this one in both and see the difference:
    http://openprocessing.org/visuals/?visualID=9151
    The motion in Safari 5 is jerky and not fluid at all. But in firefox it runs nice and smooth. Even in Chrome it's jerky just like Safari.
    I've tried both the 32/64 bit version settings and still the same result in Safari.
    Thanks..

    HI,
    Open Java Preferences (Applications/Utilities) Select the Network tab
    Click: Delete files
    Relaunch Safari.
    And empty the Safari cache from the Safari menu.
    Could be the site itself. An HTML validator came up with errors.
    http://validator.w3.org/check?uri=http%3A%2F%2Fopenprocessing.org%2Fvisuals%2F%3 FvisualID%3D9151&charset=%28detect+automatically%29&doctype=Inline&group=0
    Carolyn

  • J2SE 5.0 plugin and slow applet load time

    Folks,
    I have an applet (https), with about 5 MB of jar files. After we
    moved to J2SE 5.0, the load time seems much slower. It used to load in
    40 seconds. Now it loads in 4 min.
    An odd thing I noticed is when I minimize my Internet Explorer window,
    the applet seems to start up quickly again.
    Is this possibly related to the "starburst logo" progress bar
    animation that Sun now uses for applet start ups? I know that
    animated gifs can sometimes chew up quite a bit of cpu time.
    I think the progressbar property is no longer in 5.0
    I'm running on a single proc laptop. When I run it on my 2 proc
    server, it is not as obvious, and startup time seems reasonable.
    Thanks,
    Rob
    [email protected]

    I'm also seeing a similar slow applet startup time. CPU is 100% (IE is in high 90s). Works ok on my 3GHz P4, but is very slow (up to 16 minutes) on 400 MHz P2.
    My problem seems to be related to how my .properties files (23 total, for internationalization support) are handled.
    During start-up in JRE 1.5 I see the following for each .properties file:
    network: Connecting http://dummy.com/demos/AES/1_4_2_06/fax.class with proxy=DIRECT
    network: Connecting http://dummy.com/demos/AES/1_4_2_06/fax.class with cookie "PHPSESSID=e4aad164588f860e495812ec5c52326c"
    network: Server http://dummy.com/demos/AES/1_4_2_06/fax.class requesting to set-cookie with "PHPSESSID=e4aad164588f860e495812ec5c52326c; path=/"
    network: Connecting http://dummy.com/demos/AES/1_4_2_06/fax_en.class with proxy=DIRECT
    network: Connecting http://dummy.com/demos/AES/1_4_2_06/fax_en.class with cookie "PHPSESSID=e4aad164588f860e495812ec5c52326c"
    network: Server http://dummy.com/demos/AES/1_4_2_06/fax_en.class requesting to set-cookie with "PHPSESSID=e4aad164588f860e495812ec5c52326c; path=/"
    network: Connecting http://dummy.com/demos/AES/1_4_2_06/fax_en.properties with proxy=DIRECT
    network: Connecting http://dummy.com/demos/AES/1_4_2_06/fax_en.properties with cookie "PHPSESSID=e4aad164588f860e495812ec5c52326c"
    network: Server http://dummy.com/demos/AES/1_4_2_06/fax_en.properties requesting to set-cookie with "PHPSESSID=e4aad164588f860e495812ec5c52326c; path=/"
    network: Connecting http://dummy.com/demos/AES/1_4_2_06/fax_en_US.class with proxy=DIRECT
    network: Connecting http://dummy.com/demos/AES/1_4_2_06/fax_en_US.class with cookie "PHPSESSID=e4aad164588f860e495812ec5c52326c"
    network: Server http://dummy.com/demos/AES/1_4_2_06/fax_en_US.class requesting to set-cookie with "PHPSESSID=e4aad164588f860e495812ec5c52326c; path=/"
    network: Connecting http://dummy.com/demos/AES/1_4_2_06/fax_en_US.properties with proxy=DIRECT
    network: Connecting http://dummy.com/demos/AES/1_4_2_06/fax_en_US.properties with cookie "PHPSESSID=e4aad164588f860e495812ec5c52326c"
    network: Server http://dummy.com/demos/AES/1_4_2_06/fax_en_US.properties requesting to set-cookie with "PHPSESSID=e4aad164588f860e495812ec5c52326c; path=/"
    The file (1 of 23) I supply is named fax.properties (the default file). Since my locale setting are English/US I guess the I18N code is trying to figure out if the regional files are present. Each of these requests is timing out 5-8 seconds for each - it builds up quickly.
    I haven't been able to find out why this is happening or resolve the issue. I'm close to restricting my applet to only 1.4.2 as that was fine and posting this as a bug.

  • Slow applet on Vista & 7

    Hi everyone,
    this is my first thread so i hope i got the right section :).
    I used to work on a Windows XP station where i was using applets that were quite fast but now i'm working on Windows 7 and those applets are slow and the same thing happen on Vista.
    The JRE are 1.6.12 on both environment and the problem occur on both IE and Firefox.
    I already look over the forum but i couldn't find a solution so i hope you can help me .
    Thanks,
    Ator
    PS: Sorry for my english :)

    I have an iPhone 4 and since upgrading to iOS 7 I am also having a lot of trouble with my cellular network. I am with one of the big 3 Telcos in Canada. I get full bars but my service is either slow or non-responsive. Some of my apps claim that the network has dropped even though I have full bars and no interference. I have surfed around for a solution and have not found any solid advice yet. I have more than half of my phones storage free.
    Any advice?

  • Slow applet--HELP!

    My entire project has skidded to a halt because of this problem, so I need help right away!
    The problem:
    A very simple applet is running very slowly. All it does is display a custom component.
    How can I speed it up without losing encapsulation?
    public class ArrowTest extends Applet{
       Arrow a = new Arrow();
       add(a);
    }The component is a lightweight custom component, which is also very simple. It has a anonymous listener class in its constructor (MouseMotionListener) which causes the Arrow to rotate when the mouse is clicked and dragged. (this involves lots of Math.cos, Math.sin, etc., but not THAT much) However when I dragged my mouse on the arrow's area, the rotation was slow and choppy. I would drag the mouse, and about 10 seconds later, the arrow would notice and flip right to where I ended, not showing the in-between steps.
    The applet ran fine (smoothly and with a fast response) on my computer in the applet viewer. It also worked fine when I ftp'd it to my html server and ran it. It worked badly at school, which is the ultimate destination of this applet. The school's computers are not much slower than my testing computer. I know that the html servers are extremely busy/slow, but I thought that the entire applet was loaded into memory so that once it was started, the server's business was done?
    Is there any case in which the applet needs to go back to the HTML server once it has loaded the applet?
    I had planned to put many such arrows on the screen concurrently, and even pack it into another custom component. But if I can't even display one arrow, my entire project is on the skids.
    How can I speed this up?
    Can I make it such that the user has to download pieces of my applet and store it on their computer somewhere, so that I can help this slow HTML server (so that it sends less info)?
    Thanks in advance!
    :) jenMc

    thank you for replying!
    However, I'm not sure what you're suggesting?
    The event handler, which is part of the component, calls repaint() (the component's paint and update methods). The rotation is intended to be packaged as part of the arrow's default behavior, in the same sense as a button's default behavior is such that if you click on a button you see the image of the button go "up and down". You do not assign a event handler to do this; it is part of the component. Supposedly when you do this, the applet only reloads the area within the clip bounds of the component?
    I do not want to draw an arrow by calling getGraphics(). That would ruin the encapsulation. Another words, I want to add an arrow to the screen by simply saying
    add(arrow);
    not by having to write an arrow algorithm every time I want to use an arrow, which is most of the time, since that's my base class for Vector, Force, Acceleration, Velocity, etc. classes.
    I don't want the caller to be responsible for repainting or painting or anything.
    Am I totally not understanding your suggestion? If I am, please correct me.
    :) Jen

  • Slow Applet init in IE

    Hi dudes,
    i have a problem with applet.. it's no a true problem, but it's an annoying problem. I have an applet that work in IE. When it's start with focus on and with maximixe window the applet load very slowly and CPU usage in very busy (88%-100%). When i start the applet with window minimized, it's load very fastly. It's a problem becuase my application needs to start in full screen mode....
    You have some suggestions?
    Thank you. Matte

    I can't post it beacuase it's a commercial program for my company.
            UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
            enableEvents(AWTEvent.WINDOW_EVENT_MASK);
            Container contentPane  = this.getContentPane();
            contentPane.setLayout(null);
            String value = (String)this.getParameter("file");
            event_root1 = DNDTree.createTree(true,1,null,1);
            eventi1.addMouseListener(new Editor_eventi1_mouseAdapter(this));
            (DefaultMutableTreeNode) eventi1.getModel().getRoot(),new ArrayList());
            event_root2 = DNDTree.createTree(false,1,null,1);
            eventi2 = new DNDTree(event_root2,2);
            jScrollPane1 = new JScrollPane(tree1);
            jScrollPane2 = new JScrollPane(tree2);
            jScrollPane1.setViewportBorder(null);
            jScrollPane1.setAutoscrolls(true);
            jScrollPane1.setBorder(border2);
            jScrollPane1.setToolTipText("");
            jScrollPane1.setBounds(new Rectangle(50, 10, 320, 390));
            jScrollPane2.getViewport().setBackground(Color.white);
            jScrollPane2.setBorder(border2);
            jScrollPane2.setBounds(new Rectangle(400, 10, 320, 390));
            jScrollPane5 = new JScrollPane(eventi1);
            jScrollPane5.getViewport().setBackground(Color.white);
            jScrollPane5.setBorder(border2);
            jScrollPane5.setBounds(new Rectangle(50, 10, 320, 390));
            jScrollPane6= new JScrollPane(eventi2);
            jScrollPane6.getViewport().setBackground(Color.white);
            jScrollPane6.setBorder(border2);
            jScrollPane6.setBounds(new Rectangle(400, 10, 320, 390));
            Menu_Disponibili = new JPopupMenu();
            Menu_Disponibili.setBackground(new Color(212, 208, 200));
            Menu_Disponibili.setFont(new java.awt.Font("Tahoma", Font.PLAIN, 11));
            Menu_Disponibili.setToolTipText("Opzioni di inserimento");
            Menu_Disponibili.setInvoker(null);
            Menu_Disponibili.addMouseListener(new Editor_Menu_Disponibili_mouseAdapter(this));
            Item_Expande.setText("Espandi");
            Item_Expande.addActionListener(new Editor_Item_Expande_actionAdapter(this));
            Item_Collapse.setText("Compatta");
            Item_Collapse.addActionListener(new Editor_Item_Collapse_actionAdapter(this));
            Item_Add.setText("Aggiungi");
            Item_Add.addActionListener(new Editor_Item_Add_actionAdapter(this));
            VTextIcon textIcon = new VTextIcon(jLabel1, "OGGETTI DISPONIBILI",VTextIcon.ROTATE_NONE,220,220,198);
            jLabel1 = new JLabel(textIcon);
            jLabel1.setBackground(Color.darkGray);
            jLabel1.setFont(new java.awt.Font("Tahoma", Font.BOLD, 12));
            jLabel1.setForeground(Color.darkGray);
            jLabel1.setBorder(border2);
            jLabel1.setDisabledIcon(textIcon);
            jLabel1.setBounds(new Rectangle(31, 10, 20, 390));
            VTextIcon textIcon2 = new VTextIcon(jLabel2, "OGGETTI SELEZIONATI",VTextIcon.ROTATE_NONE,220,220,198);
            jLabel2 = new JLabel(textIcon2);
            jLabel2.setFont(new java.awt.Font("Tahoma", Font.BOLD, 12));
            jLabel2.setForeground(Color.darkGray);
            jLabel2.setBorder(border2);
            jLabel2.setHorizontalAlignment(SwingConstants.CENTER);
            jLabel2.setHorizontalTextPosition(SwingConstants.CENTER);
            jLabel2.setVerticalAlignment(SwingConstants.CENTER);
            jLabel2.setBounds(new Rectangle(719, 10, 20, 390));
            VTextIcon textIcon3 = new VTextIcon(jLabel6, "GRUPPI",VTextIcon.ROTATE_NONE,220,220,198);
            jLabel6 = new JLabel(textIcon3);
            jLabel6.setBackground(Color.darkGray);
            jLabel6.setFont(new java.awt.Font("Tahoma", Font.BOLD, 12));
            jLabel6.setForeground(Color.darkGray);
            jLabel6.setBorder(border2);
            jLabel6.setText("");
            jLabel6.setBounds(new Rectangle(31, 10, 20, 390));
            progressBarControl = new ProgressBarControl(ProgressBar,ProgressLabel);
            progressBarControl.reset();
            jTabbedPane1.setSelectedIndex(0);It's very strange, because it's works perfectly when execute it on a minimize window (CPU USAGE DOWN TO 40%-55%), while with a maximized window it's works very slowly and cpu usage go to 95%-100% it's very frustrating....

  • Java 1.5 and slow applet loading

    Ever since i switch to Java 1.5, i have noticed that the time to load an Applet has increase dramatically..even small simple Applet. What would normally takes me 30 seconds to load an applet now takes me at least 3 to 4 minutes.
    As it turned out..this bug was reported. It appears that the new Java applet logo (cool) was the culprit (probably because it's severals large image?). Java say they have a fix for the bug, but the fix wont be available until the 4th update release (urgh).
    I need 1.5 JRE (for work and other stuff), so i can't just simply revert back to 1.4.2
    One soultion i found is to replace the logo; however..i'm the client and does not have access to the code, so i can't do this. Anyone knows of a solution taround this until the 4th update release?
    I'm shocked to find that such a serious bug was not discovered before the relase of 1.5. I think those folks at Java is too spoiled and forget that some of us (clients) still live in the dark age of 56k modem (no satalitte, cable modem or DSL avail in my area).

    You think it is normal that it takes 30 seconds to load.
    I think it is a programming problem. You should not import a lot of package.
    Applet are supposed to be light, it is not like programs it is normal when you're on 56k (of course aol steals some of those bandwidth by sending you advertisement) and it's not my applet..it's one of a few applet s that i encountered when surfing the web..so i have ano control over how it is implemented or designed. Even small one that do simple stuff like display a hello world takes forever to load.

  • Re: [Fwd: Java Applet IIOP Call-In with Release 3C--How dowe speed up d

    Hi Michael,
    We have done exactly what you describe and have avoided the slow applet
    download times. Although it can be a bit tricky, it is possible to use
    the ORB bundled inside the Netscape 4.0 browser (Visibroker for Java by
    Visigenic). Most of the code should follow Netscape's examples (on
    http://developer.netscape.com)--just remember to initialize the ORB by
    passing a reference to the current applet in orb_init() (so that you
    invoke something like orb_init(this) [assuming you are extending
    java.applet.Applet]). Pulling up the Java console within your web
    browser should help debug quite a bit (a lot of debug messages will get
    printed there the ORB is having problems).
    Netscape has just implemented the applet caching schemes you describe,
    so it probably shouldn't matter too much if you use another vendor's
    ORB (we've done this with Iona's OrbixWeb). If you use ZIP files, they
    have to be uncompressed, and I don't think that the browser will cache
    them between browser sessions. Netscape 4.0 does seem to handle
    compressed JAR files just fine and it does indeed cache them between
    browser sessions. I'd go with the JAR format anyway since the ZIP
    bundling was just a workaround until Sun got their act together in the
    1.1 JDK.
    By the way, you also might want to take advantage of the code-signing
    and capabilities APIs of Netscape if you are going to invoke methods on
    objects not resident on your web server. Otherwise, you will probably
    run into the (in)famous browser applet security restrictions and you may
    have other problems doing things like callbacks from Forte, etc.
    If you want more detail on how it works, let me know and I can post some
    examples.
    Oh, one last thing: we are a consulting firm specializing in these kinds
    of things :)
    Bill
    Subject: Java Applet IIOP Call-In with Release 3C--How do we speed up download time.
    Date: Wed, 2 Jul 1997 09:10:31 -0500
    From: Michael Nelson <[email protected]>
    To: "'[email protected]'" <[email protected]>
    We have successfully implemented a simple Java Applet that calls into
    Forte Services via IIOP. However, the duration of the download time
    for
    Applet and its required class files is UNACCEPTABLE in a typical
    INTERNET environment where 28.8K modems and multiple hops around the
    net
    are not uncommon. We dialed into our network at 28.8K (but no
    hopping),
    and found that download times varied from 1.5 - 2.0 minutes. This is
    unacceptable, even by internet standards. We have been using the
    Visigenic Visibroker product as the ORB.
    After doing some investigation, we've come up with several ideas to
    speed up download time:
    1. Figure out how to use the Visigenic components (CORBA/IIOP class
    files) that come bundled with the latest version of the Netscape
    Navigator browser, so that they don't have to be downloaded
    2. Figure out how to use ZIP files. Here's what I've read: "Since
    the
    introduction of Netscape Navigator 3.0, you can specify an
    uncompressed
    .zip file as an addition to the code base of your application. By
    specifying a ZIP file, the browser will load your applet's classes
    from
    a specified ZIP file before it searches the code base. This ZIP can
    improve applet download time by reducing the number of HTTP
    connections
    required to fetch applet code. As an added benefit, Netscape caches
    the
    single ZIP file so that it will not reload your applet unless the date
    of the ZIP file has changed."
    3. Figure out how to use JAR files. Here's what I've read: "JAR
    stands for Java archive. It's a file format based on the popular ZIP
    file format and is used for aggregating many files into one. Although
    JAR can be used as a general archiving tool, the primary motivation
    for
    its development was so that Java applets and their requisite
    components
    can be downloaded to a browser in a single HTTP transaction, rather
    than
    opening a new connection for each piece. This greatly improves the
    speed with which an applet can be loaded onto a web page and begin
    functioning. The JAR format also supports compression, which reduces
    the
    size of the file and improves download time still further."
    Unfortunately, we've been unable to get any of these approaches to
    work.
    Has any one used these or other approaches to speed up applet
    download
    time? Or, does anyone know of consulting firms that specialize in
    this
    sort of thing?
    Thanks in advance for your help.
    Mike Nelson, Project Leader
    Metrix, Inc.
    [email protected]
    414-798-8560 x1157
    Billy L. Williams, Jr. | email: [email protected]
    Sage Solutions, Inc. | Tel: (415) 392-7243 (x506) Fax: (415) 391-3899
    | Pager: (415) 605-1791 (page me if urgent)

    Hi Michael,
    We have done exactly what you describe and have avoided the slow applet
    download times. Although it can be a bit tricky, it is possible to use
    the ORB bundled inside the Netscape 4.0 browser (Visibroker for Java by
    Visigenic). Most of the code should follow Netscape's examples (on
    http://developer.netscape.com)--just remember to initialize the ORB by
    passing a reference to the current applet in orb_init() (so that you
    invoke something like orb_init(this) [assuming you are extending
    java.applet.Applet]). Pulling up the Java console within your web
    browser should help debug quite a bit (a lot of debug messages will get
    printed there the ORB is having problems).
    Netscape has just implemented the applet caching schemes you describe,
    so it probably shouldn't matter too much if you use another vendor's
    ORB (we've done this with Iona's OrbixWeb). If you use ZIP files, they
    have to be uncompressed, and I don't think that the browser will cache
    them between browser sessions. Netscape 4.0 does seem to handle
    compressed JAR files just fine and it does indeed cache them between
    browser sessions. I'd go with the JAR format anyway since the ZIP
    bundling was just a workaround until Sun got their act together in the
    1.1 JDK.
    By the way, you also might want to take advantage of the code-signing
    and capabilities APIs of Netscape if you are going to invoke methods on
    objects not resident on your web server. Otherwise, you will probably
    run into the (in)famous browser applet security restrictions and you may
    have other problems doing things like callbacks from Forte, etc.
    If you want more detail on how it works, let me know and I can post some
    examples.
    Oh, one last thing: we are a consulting firm specializing in these kinds
    of things :)
    Bill
    Subject: Java Applet IIOP Call-In with Release 3C--How do we speed up download time.
    Date: Wed, 2 Jul 1997 09:10:31 -0500
    From: Michael Nelson <[email protected]>
    To: "'[email protected]'" <[email protected]>
    We have successfully implemented a simple Java Applet that calls into
    Forte Services via IIOP. However, the duration of the download time
    for
    Applet and its required class files is UNACCEPTABLE in a typical
    INTERNET environment where 28.8K modems and multiple hops around the
    net
    are not uncommon. We dialed into our network at 28.8K (but no
    hopping),
    and found that download times varied from 1.5 - 2.0 minutes. This is
    unacceptable, even by internet standards. We have been using the
    Visigenic Visibroker product as the ORB.
    After doing some investigation, we've come up with several ideas to
    speed up download time:
    1. Figure out how to use the Visigenic components (CORBA/IIOP class
    files) that come bundled with the latest version of the Netscape
    Navigator browser, so that they don't have to be downloaded
    2. Figure out how to use ZIP files. Here's what I've read: "Since
    the
    introduction of Netscape Navigator 3.0, you can specify an
    uncompressed
    .zip file as an addition to the code base of your application. By
    specifying a ZIP file, the browser will load your applet's classes
    from
    a specified ZIP file before it searches the code base. This ZIP can
    improve applet download time by reducing the number of HTTP
    connections
    required to fetch applet code. As an added benefit, Netscape caches
    the
    single ZIP file so that it will not reload your applet unless the date
    of the ZIP file has changed."
    3. Figure out how to use JAR files. Here's what I've read: "JAR
    stands for Java archive. It's a file format based on the popular ZIP
    file format and is used for aggregating many files into one. Although
    JAR can be used as a general archiving tool, the primary motivation
    for
    its development was so that Java applets and their requisite
    components
    can be downloaded to a browser in a single HTTP transaction, rather
    than
    opening a new connection for each piece. This greatly improves the
    speed with which an applet can be loaded onto a web page and begin
    functioning. The JAR format also supports compression, which reduces
    the
    size of the file and improves download time still further."
    Unfortunately, we've been unable to get any of these approaches to
    work.
    Has any one used these or other approaches to speed up applet
    download
    time? Or, does anyone know of consulting firms that specialize in
    this
    sort of thing?
    Thanks in advance for your help.
    Mike Nelson, Project Leader
    Metrix, Inc.
    [email protected]
    414-798-8560 x1157
    Billy L. Williams, Jr. | email: [email protected]
    Sage Solutions, Inc. | Tel: (415) 392-7243 (x506) Fax: (415) 391-3899
    | Pager: (415) 605-1791 (page me if urgent)

  • How much can too many imports slow inititialization down?

    How much can too many imports slow applet inititialization down?
    I have seen our company's sorce code for some huge applets they have written. In many, many cases, the imports at the beginning of each file are written something like this...
    import java.awt.*;
    import java.awt.event.*;
    import java.util.*;
    import javax.swing.*;
    import javax.swing.border.*; 
    import javax.swing.event.*;Only certain portion of these imports are actually used. Does this sort of thing really impact the applets loading speed? I know it will obviously take at least a little longer but will the user even notice?

    You are not actually importing the classes, but rather making the names of the classes available.

  • Multiple repeat downloads of applet jar file

    We have an applet that is downloaded from a Weblogic server. The applet is packaged as a jar file. Some of the testers have been complaining that the applet is extremely slow to start up.
    The applet start-up involves three phases. In a first phase, it fetches data from the server. This phase seems to execute in pretty much constant time. During the second and third phases, it constructs a UI using Swing objects. The UI includes some JPEG files, which are extracted from the applet's own jar file.
    Testers report that the slow part of start-up is actually the UI setup. This should theoretically not be network-bound at all. But packet tracing reveals that during this phase, there's a large amount of network traffic going on. It turns out that there are multiple GET requests for the applet jar file being issued. Typically, 29 requests are issued in all; just for reference, the applet is required to extract 28 images from its jar file, so it looks as if the additional requests correspond to image requests.
    One further detail: this does not occur where there is a fast connection to the server. In these cases, the applet is downloaded once. It looks as if the problem only occurs on slower network connections, and the speculation here is that the applet jar is somehow being downloaded only partially, so that requests for images somehow trigger a re-request of the jar file.
    Has anyone seen anything similar and, more to the point, is there a fix or workaround?
    Technical details: Internet Explorer 5.5 or 6.0, JRE version 1.4.2_01 Java HotSpot(TM) Client VM (on the client), WebLogic 8.1 (on the server)
    Thanks in advance for any help.

    Ok.
    I have been trying hard and found the solution. One of the ablove posting says that it works under java 1.4.1 plug-in. That's infact absolutely true. It also says that how to run client using JRE 1.4.2 or higher. That can be solved two. This is definitely a bug with the 1.4.2 plug-in.
    Follow this procedure that will solve the mystry.
    ----------------------start ---------------------------------
    Problem
    Download of applet is very slow
    Why?
    This was happening because of the repeated download of the applet jars by the applet plug in controller. It is quite clear that the Java 1.4.2 plug in controller has a bug that causes the plug in to download same jar files multiple times irrespective of Jar cache in the client side (configurable from client side using the Java plug in control panel) is enabled or disabled. Therefore, we have moved from 1.4.2 plug in to 1.4.1 (controlled from our client (JSP) code) that works fine.
    What the client (applet client) should do?
    You must do the following in the client side in order to avoid the long download time for applet when running from a browser. We have also found that the browser actually do not matter in slow applet downloads. It is only the plug in that does control the applet download.
    Irrespective of what JVM you have already installed (or not yet installed) please do the following:
    1. Download the JRE 1.4.2 from http://java.sun.com/products/archive/index.html
    -At the time of its installation if it shows that the "JRE is already installed do you uninstall it?" Go ahead and uninstall the JRE 1.4.2. After the un-installation again install the JRE 1.4.2
    -If it does not have the JRE 1.4.2 already installed, then you will see any warning window and you will be able to install the 1.4.2 JRE successfully.
    2. Now, go to the same link and install JRE 1.4.1.
    -If this JRE already installed, uninstall first like the step 1 above. then reinstall it.
    3. Now, after successful installation of the JRE 1.4.1, open the Plug-In control panel.
    -You will find the list of control panel(s) in the Start->Control Panel window. Use the control panel that shows the version number 1.4.1. If no version number shown then use the one that do not show any version number at its end.
    4. Do the following on the Plug-In control panel.
    -Verify if this is the 1.4.1 plug in control panel? Go to the "About" tab to see if it shows 1.4.1.
    If it does not show the 1.4.1 (or 1.4.1_x) then plug in was not installed correctly. Reinstall the 1.4.1 JRE following the step in no-2
    -Go to "Basic" tab and select "Show console" radio button.
    -Go to "Advanced" tab and from the drop down select "JRE ...1.4.2" from the "Java Runtime Environment" drop down box.
    -Go to "Browser" tab and select all that in the "Settings" box applicable for browsers.
    -Go to "Cache" select "Enable Caching" if it is not selected currently. Select "Unlimited" from "Size" options.
    Now hit "Apply" button at the bottom and close the control panel using the 'X'.
    5. Restart your Windows machine.
    6. You are ready to run the applet from any of the browser (IE, NS, etc.)
    --------------------------end------------------------------

  • Mac trouble

    I finally found out what was up with my slow applet--sort of. (See my earlier post "Slow Applet --help") I was testing the applet on a PC at home, and at school, I was using a Mac. I tried a PC at school, and the applet worked just as well as it did at home. Further testing on the Mac revealed the following error:
    -on Netscape 4.7 : Class Arrow not found
    -on IE 5: No given error, but I assume it is the same.
    I have converted the applet, and I am using the plugin. Everything is in the same directory. (Both IE and Netscape, same version, run this program on the PC).
    Actually, on the Mac, the applet loads, the classes load, but the listener does not appear to be listening at all. Does Mac have a problem with anonymous listener classes? Or custom components?
    Or could it be that I need to check the version of the mac jre (I thought the plugin checked for this--it did last time i ran a Mac program)?
    Or could it be I don't have enough memory available? How can I check that (and increase it)?
    Or other??
    Help!
    JenMc

    I have been trying several tests to see what was causing the trouble. Seems like
    public class XXX extends Component
    is a 1.1 thing after all.
    Mac ran a simple applet containing such an object (without listeners), and it didn't complain. I wrote my (original) listener with 1.2-style event handling. That's easy to change. I think I've got a handle on it.
    Thank you veerrry much anyway!!!!!!
    :) jen

  • Applet very slow and shows no activity, but its running

    I have a new applet for the users, but I am reluctant to implement until I get some others opinions. It is very slow (30 - 40 seconds)
    Before it outputs a screen with about 20 lines, it reads 90 different html files. It looks at the forth rec of each to extract a name. It also gets the file size to determine if the record needs to be on the screen.
    Anyway, it does 4 reads on 90 files. = 360 reads. Oops, it also reads and loads a 80 record file at the beginning. So total is 440 reads.
    It takes 30 - 40 seconds. Which is not horrible, but it is not good. What really bothers me is that the applet screen shows no activity. At the bottom is shows "done" and "100%". Task Manager shows no activity. But if you just let it sit there, it will finally fill the screen. Pretty amazing to me. I would much rather see a "progress bar" moving on the bottom like other screens. Actually, a progress bar would solve it, because the users are not in a big hurry anyway.
    I am using "openStream" and "readLine" for the files.
    Any opinions?
    import javax.swing.*;
    import java.applet.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.net.*;
    import java.io.*;
    import java.util.*;
    public class urlaa extends JApplet
    //zz  implements Runnable, ActionListener
          implements ActionListener
    // zz added
        private JLabel item;
        private JList itemList;
      int par;
      int errorflag = 0 ;
      int orgsize = 14900 ;
      String par1;
      String s;
      String e1;
      String e2;
      String e3;
      String w1;
      String w2;
      String w3;
      String w4;
      int i = 0;
      int len ;
      int size ;
      String stringsize ;
      URLConnection conn ;
      int i2 = 0 ;
      int k = 0;
      int current = 0;
      String s1 ;
      String s6 ;
      String s7 ;
      String s8 ;
      String printline ;
      String pageLink;
      String arr[]  = new String[150] ;
      String arr2[] = new String[150] ;
      String arr3[] = new String[150] ;
      int arr4[] = new int[150] ;
      String inputLine;
      Thread runner;
      public void init()
             String parameter = getParameter("par1");
             if (parameter != null)
                 par = Integer.parseInt(parameter);
             else
                 par = 99;
    // zz         Button goButton = new Button("Go");
    // zz         goButton.addActionListener(this);
    // zz         add(goButton);
    // zz   added
            this.item = new JLabel();
            this.addButton();
            Container container = this.getContentPane();
            this.itemList = this.getList();
            container.add(this.getPanel());
            URL u;
            InputStream wis = null;
            DataInputStream dis;
            int rcnt = 0;
            int rcn2 = 0;
           //    1)  read filelist.txt file
           //         and load into a table.
           //    2)  close the filelist.txt file
           //    3)  Use the tabled file names to
           //         read and see if the bio
           //         has been done
           //  1) Read filelist.txt and load table
            try
            u = new URL("http://www.classof1961.mysite.com/filelist.txt");
            catch (MalformedURLException e)
              errorflag = 1 ;  // set error flag to stop while loops
              e1 = ("FILELIST.TXT MalformedURLException: " + e.getMessage()) ;
            try
                u = new URL("http://www.classof1961.mysite.com/filelist.txt");
                wis = u.openStream();
            catch (IOException ioe)
              errorflag = 1 ;  // set error flag to stop while loops
              e1 = ("FILELIST.TXT IOException : " + ioe.getMessage()) ;
    //      does not work     size = wis.getContentLength() ;
                // Convert the inputStream to a buffered DatainputStream.
                dis = new DataInputStream(new BufferedInputStream(wis));
                // Read 1st record to set up while loop
                   try
                     s1 = dis.readLine() ;  // get 1st rcd
                   catch (IOException ioe)
                     errorflag = 1 ;  // set error flag to stop while loops
                     e3 = ("FILELIST.TXT IOException : " + ioe.getMessage()) ;
                   while (s1 !=  null)
                   {  // load file names loop
                   if (errorflag == 0)
                   {  // if errors
                    arr[i] = s1 ;
                    i++ ;
                    try
                    s1 = dis.readLine() ;
                    catch (IOException ioe)
                      errorflag = 1 ;  // set error flag to stop while loops
                      s1 = null ; // force end of loop
                      e3 = ("load table read failed" + ioe) ;
                    rcnt++ ;
                    if (rcnt > 100)  // test code
                    {                // test code
                      errorflag = 1;
                      s1 = null ;
                      e3 = "Load table is looping!!" ;
                   }  // end of error check loop
                   }  // end of table load loop
               int lasttableentry = i ;  //
                   // CLOSE the filelist.txt file
                   try
                    wis.close();
                   catch (IOException ioe)
                    errorflag = 1 ;  // set error flag to stop while loops
                    e3 = ("close of filelist.txt file failed" + ioe) ;
    //   End of filelist read and load and close
    //      ptr to whats new names in table arr
            i = 0 ;
    //      While more names in table,
    //        Connect and Open file
    //        Read file until 4th rcd (rel 3rd rcd)
    //          if rcd has date, then move it to table
    //          else
    //          bump to next file name
              w1 = arr[i] ;
              w2 = w1.substring(1, 4) ;   // ONLY USED FOR CHK FOR XXXX
    //    ______________  start of major loop  _____________
            boolean morenames = true ;
            while (morenames)
            {  // Name table loop
            if (errorflag == 0)
            {  //if no errors
              try
                u = new URL(w1);
                try
                  URLConnection conn ;
                  conn = u.openConnection();
                  size = conn.getContentLength();
                catch (IOException e)
                  errorflag = 4 ;
                  morenames = false ;
                  e1 = ("file size logic failed " + w1) ;
              catch (MalformedURLException e)
                    errorflag = 1 ;  // set error flag to stop while loops
                    morenames = false ;
                    e1 = ("next whats new url error : " + w1) ;
    // compile error                break ;
              try
                  u   = new URL(w1) ;
                  wis = u.openStream();
              catch (IOException e)
                errorflag = 1 ;  // set error flag to stop while loops
                morenames = false ;
                e2 = ("next whats new open error :  " + w1) ;
    //   compile error            break ;
    //            Convert the inputStream to a buffered DatainputStream.
                  dis = new DataInputStream(new BufferedInputStream(wis));
                if (errorflag == 0)
                {  //if no errors
                       try
    //  does not work                       String s2 = dis.readLine(3) ;
                         s1 = dis.readLine() ;
                         s1 = dis.readLine() ;
                         s1 = dis.readLine() ;
                         s1 = dis.readLine() ;
                       catch (IOException e)
                         errorflag = 1 ;  // set error flag to stop while loops
                         morenames = false ;
                         e2 = "whats new file MalformedURLException: " ;
                       // file is larger than original non-bio file size
                       if (size > orgsize)  //  if file size > original file size
                       String s2a = s1.substring(0, 5);
                       String s3 = "                       " ;
    //                 Only look at title records to get the name
                       if (s2a.equals("<titl"))
                          int k2 = 7 ;
                          int l = k2 + 1 ;
                            while (!s1.substring(k2, l).equals("<"))
                              k2++ ;
                              l++ ;
                          s3 = s1.substring(7, k2) ;
                       else
                          s3 = "               " ;
    //                 s3 now has blanks or the name
                       arr2[k] = w1 ;    // move name into arr2 (link to bio)
                       arr3[k] = s3 ;    // move name into arr3 (bio name)
                       arr4[k] = size ;  // move in file size
                       k++ ;
                       } // end of if length > 36
                } // end of chk for error flag zero (no errors)
                  //  now we have to close this whats new file
                   // CLOSE the current whats new file
                   try
                    wis.close();
                   catch (IOException ioe)
                    errorflag = 1 ;  // set error flag to stop while loops
                    morenames = false ;
                    e3 = ("close of the current whats new file failed" + ioe) ;
                  //  end of the close
              rcn2++ ;
              if (rcn2 > 100)  // test code
              {                // test code
                 errorflag = 2;
                 morenames = false ;
                 e3 = "Searching files is looping!!" ;
              i++ ;           // bump to next whats up name
              w1 = arr[i] ;   // load it into work string
              if (i > lasttableentry)
                morenames = false ;
              } // end of error checking loop
             else
                  morenames = false ;
            } // end major name table loop
                   // CLOSE the last whats new file
                   try
                    wis.close();
                   catch (IOException ioe)
                    errorflag = 1 ;  // set error flag to stop while loops
                    e3 = ("close of last whats new file failed" + ioe) ;
    // end of init
    //     _________________ other methods  ______________________
    // zz added
        private JList getList() {
            // Create a List
            JList tempList = new JList(arr3);
            tempList.setVisibleRowCount(3);
            // Enable single selection
            tempList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
            return tempList;
        private JButton addButton() {
            JButton button = new JButton("Select Item below and click here to go to the bio");
            button.addActionListener(this);
            return button;
        private JPanel getPanel() {
            // set layout to GridLayout 3 rows and 1 columns, no separations
            JPanel panel = new JPanel(new GridLayout(3,1,0,0));
            JScrollPane spane1 = new JScrollPane(this.itemList);
            panel.add(this.addButton());
            panel.add(spane1);
            panel.add(this.item);
    //       panel.add(new JLabel("Example List"));
            return panel;
    //   _______________  actionPerformed method  ____________________
         public void actionPerformed(ActionEvent evt)
           s8 = "actionPerformed";
    // zz added
            String command = evt.getActionCommand();
            // Get the selected value from the list and update the JLabel
            item.setText((String)itemList.getSelectedValue());
    //  try to redirect to selected url
      try
             int idx  = itemList.getSelectedIndex() ;
             String urlvalue = this.arr2[idx] ;
             URL u = new URL(urlvalue);
             this.getAppletContext().showDocument(u, "_self");
         catch(Exception e)
    }

    jagossage wrote:
    But if you just let it sit there, it will finally fill the screen. Pretty amazing to me. The onus is on you, the developer, to decide how to distract your users as they wait for your code to finish. Why should you expect something to do it for you?
    I would much rather see a "progress bar" moving on the bottom like other screens.Ah, I think I see where you're confused. The progress bar and applet loading subtitles, etc are Java's way of presenting the progress of loading the applet. Once it's fully loaded, though (which it is when your code starts running), it hands off control to you. It's in your hands at that point.

  • Applet with JDBC runs very slow

    I have recently created an applet which I am using to interface with a MS SQL Server 2000 database using JDBC. The server is running W2K Server, and a Tomcat web server.
    There are some performance problems with this application. The volume of data being demanded by the database is very low, yet it runs very slow. More specifically, however, the application runs at a very fast pace for several seconds, then "stalls" for 10 -15 seconds.
    The stalling of the application does not take place at the same place in the code all the time; rather it seems to be completely independent of what I am doing. Sometimes a particular operation takes 20 seconds to complete, but the next day the same thing only takes 20msec.
    Any ideas?
    Thanks

    sounds like network usage issues
    hard to tell with no code and no idea how you're configured

  • My applets run slow all of a sudden!

    I am running Windows XP SP3.
    Yesturday I tested one of my java applets and everything move around perfectly fine.
    Now if I try to run a java applet all of the items on the screen (stuff being drawn) move TWICE as slow.
    I tried running one on my laptop and it runs perfectly fine.
    I tried reinstalling Java 6 and JDK and recompiling all of the programs but I have had no luck.
    I have not installed anything from when I last ran them.
    Anyone know what I should do?

    Hi Sam,
    Thanks for using Apple Support Communities.  This article has some things you can try if your MacBook seems to be slow:
    OS X Mavericks: If your Mac runs slowly
    http://support.apple.com/kb/PH13895
    Cheers,
    - Ari

  • Java Applet - slow response over WAN and fast on LAN

    Hi All,
    Using Tomcat we have a Java applet that runs very slow over the Internet but just the opposite on the LAN (fast). On our website we have a link that we click which initializes the application. it is very slow but if the same link is clicked on the LAN it is very fast in responding. We have a 10MB internet connection and even when testing with very little traffic after peak business hours we have same results.When closing the browser and reopening it is much faster the second time. This tells me it is being Cached. If I go to a system that has never accessed the applet we are very slow again. We are hosting this application for a 3rd party so we did not write the code. This company is finger pointing at Router and I am finger pointing at Java application itself maybe not being optimal.
    I am attaching "debug" info from Java Console. Can anyone identify any issues from this debug output or familiarity with this type issue. Your insight is greatly appreciated.
    Java Plug-in 1.5.0_01
    Using JRE version 1.5.0_01 Java HotSpot(TM) Client VM
    User home directory = C:\Documents and Settings\Administrator
    network: Loading user-defined proxy configuration ...
    network: Done.
    network: Loading proxy configuration from Netscape Navigator ...
    network: Reading user preference file from C:\DOCUMENTS AND SETTINGS\ADMINISTRATOR\APPLICATION DATA\Mozilla\Profiles\default\4i0ghip7.slt\prefs.js
    network: Done.
    network: Loading browser proxy configuration ...
    network: Done.
    network: Proxy Configuration: Browser Proxy Configuration
    basic: Cache is enabled
    basic: Location: C:\Documents and Settings\Administrator\Application Data\Sun\Java\Deployment\cache\javapi\v1.0
    basic: Maximum size: unlimited
    basic: Compression level: 0
    basic: Registered modality listener
    basic: Referencing classloader: sun.plugin.ClassLoaderInfo@b1b4c3, refcount=1
    network: Connecting http://www.mgaucb.com/gottlieb/images/codonix.png with proxy=DIRECT
    basic: Loading applet ...
    basic: Initializing applet ...
    basic: Starting applet ...
    Internal Version: 3.0.35 Build id: TB-200402041305-35
    Mar 7, 2009 1:12:03 AM com.codonix.trackerboard.gui.TrackerBoardApplet start(null:-1)
    INFO: Internal Version: 3.0.35 Build id: TB-200402041305-35
    Codebase: http://www.mgaucb.com/gottlieb/
    Mar 7, 2009 1:12:03 AM com.codonix.trackerboard.gui.TrackerBoardApplet start(null:-1)
    INFO: Codebase: http://www.mgaucb.com/gottlieb/
    Documentbase: http://www.mgaucb.com/gottlieb/TBUC.html
    Mar 7, 2009 1:12:03 AM com.codonix.trackerboard.gui.TrackerBoardApplet start(null:-1)
    INFO: Documentbase: http://www.mgaucb.com/gottlieb/TBUC.html
    WebAppPath: /gottlieb
    Mar 7, 2009 1:12:03 AM com.codonix.trackerboard.gui.TrackerBoardApplet start(null:-1)
    INFO: WebAppPath: /gottlieb
    basic: Modality pushed
    basic: Modality popped
    network: Connecting socket://www.mgaucb.com:80 with proxy=DIRECT
    Initial Trackerboard/Table: TBUrgentCare/null
    Mar 7, 2009 1:12:35 AM com.codonix.trackerboard.gui.TrackerBoardApplet doLogin(null:-1)
    INFO: Initial Trackerboard/Table: TBUrgentCare/null
    SiteID: CodoniX
    Mar 7, 2009 1:12:35 AM com.codonix.trackerboard.gui.TrackerBoardApplet doLogin(null:-1)
    INFO: SiteID: CodoniX
    liveconnect: the url of the applet is http://www.mgaucb.com and the permission is = false
    liveconnect: JavaScript: calling Java system code
    liveconnect: JavaScript: default security policy = http://www.mgaucb.com
    liveconnect: JavaScript: calling Java system code
    liveconnect: JavaScript: default security policy = http://www.mgaucb.com
    Starting UI Generator....
    liveconnect: JavaScript: calling Java system code
    liveconnect: JavaScript: default security policy = http://www.mgaucb.com
    Warning: No permission to control logging.
    Mar 7, 2009 1:12:58 AM com.codonix.uigenerator.StartApplet init(null:-1)
    WARNING: No permission to control logging.
    Warning: No permission to control logging.
    Mar 7, 2009 1:12:58 AM com.codonix.uigenerator.StartApplet init(null:-1)
    WARNING: No permission to control logging.
    liveconnect: JavaScript: calling Java system code
    liveconnect: JavaScript: default security policy = http://www.mgaucb.com
    liveconnect: JavaScript: calling Java system code
    liveconnect: JavaScript: default security policy = http://www.mgaucb.com
    liveconnect: JavaScript: calling Java system code
    network: Connecting socket://www.mgaucb.com:80 with proxy=DIRECT

    Hi Geoff,
    Thanks for posting here.
    Have you checked your internet edge router ? and make sure there is no any speed limitation set on it , like QOS.
    You may also try the methods below:
    1. Disable RSS, Chimney, AutoTuning on 2008R2
    How to know if TCP offload is working
    http://blogs.technet.com/b/brad_rutkowski/archive/2007/08/10/how-to-know-if-tcp-offload-is-working.aspx
    2. Install Hotfix 982860
    A computer that is running Windows 7 or Windows Server 2008 R2 takes four minutes to open a Microsoft Office 2003 document from a network share
    http://support.microsoft.com/kb/982860
    Thanks.
    Tiger Li
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

Maybe you are looking for