A very slow remove() & add() operation

The method below switches two JPanels in and out of a JFrame.
Both JPanels and their contents have been instantiated before the method is called.
However, the switch takes 16 seconds! (The first time the method is called. Thereafter, if executes
normally)
I have coded other, similar methods which make the switch essentially instantaneously.
Can anyone tell me the sorts of factors that would result in such a delay, so that I can avoid
them in my code?
void switcherMethod() {
     aClass.aJFrame.setSize( 612, 662 );     //     --------------- ? size     
     aClass.aJFrame.getContentPane().remove( anotherClass.jPanelOne );
     aClass.aJFrame.getContentPane().add( aClass.jPanelTwo );
     aClass.aJFrame.invalidate();
     aClass.aJFrame.validate();
     aClass.aJFrame.repaint();
}Many thanks in advance.

I am also seeing a similar problem with the 1.4.1 JVM.
I remove a component from a panel, and add a different one, and it takes 7-10 seconds for the add() to return. All other functions (remove, validate, etc) are fast, just the add() is slow.
Anyone have any insight???

Similar Messages

  • Server 2012 Essentials - very slow to add new user

    Eight month old Dell PowerEdge R320 rackmount server, running Windows Server 2012 Essentials. XEON E5-2400 processor, 16 GB RAM, 6 TB of SATA disks( RAID-1).  "Shared resources' on this server are not all that extensive since there are only six
    'shared folders' on this server ... And for certain I am NOT any sort of 'guru' as it would pertain to Windows Server 2012 Essentials, but it seems to me that the fact it takes over 35 minutes to add a single
    new user to this server is a bit "unusual", to say the least... As I mentioned, there are only six "shared resource" folders on this server being served from the "DATA" disk that users can access with R/W rights, and all other
    resources on this server are marked as 'no access' for our twelve (now thirteen) users.  Does this not seem to be an inordinately long time to add a single new user..?  I have just checked and found a few updates (maybe five) that were 'pending'
    a reboot (which it is doing now, as I write this), and I will try adding a new user as a 'test' after this reboot, but - am I wrong?  Doesn't this seem to be an extremely long time just to add a single new user..?

    Hi,
    Thanks for your post.
    Please wait for the update installed and reboot, then try to add user to check the result.
    Adding a new user did not need much time generally.
    Regards.
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Support, contact [email protected]

  • Very Slow to Add Songs from Network Drive

    My library has reached 12,800 tracks. Because my hard drive is just about full I'm now storing music on a network drive, which is accessed wirelessly (at 54Mbps). Once the music is added to the library iTunes plays it quite happily without any lag. BIG problem though is the time it takes to add songs from this hard drive to the library - it can anything from 20 seconds to a minute PER SONG! And that's after I had to roll back to iTunes version 6 since the gapless playback determination loop took even longer once the songs were in there.
    Is this normal? Can anything be done? What's it actually doing when adding a song to the library that could cause it to take so long? Even if it has to read the whole file into memory it should still be quicker than this.
    NB. I've tried adding using a mapped drive (H:\...), machine name (\\qnap\music\...) and IP address (\\192.168.1.34\music\...) and it makes no difference.

    Did you find a solution?

  • JDeveloper 10.1.3.1 is very slow, how to make it faster ?

    Hi all,
    I am using JDeveloper 10.1.3.1, on AMD Athlon 64 2800+, 1 GB RAM, Windows XP SP2.
    As our pages grows, now it is very slow to add new page or navigation case on the faces-config.xml.
    Yes, we can use the overview tab of the faces-config to work faster, but I see the drawing is not good if we let JDev to draw the line.
    Is there any workaround to make our JDev faster ?
    Thank you for your help,
    xtanto

    Hi Xtanto,
    What I mean is that I use multiple faces-config files. One of them is just for my manged beans that I use in a menu model for my af:Page. In that faces-config, there are no navigation cases, just managed beans. Since the faces-config diagram view shows only navigation cases, the diagram is not useful for such faces-config's (the diagram is blank). In any case, I never use the diagram view, even for my faces-config's with the navigation cases. I just find it easier to use the "overview" view, or the XML source instead.
    Hope this is clearer.
    John

  • Notebook 80GA is very slow

    I brought my notebook 2 weeks ago and I am deceptioned with its performance. It is very slow in all operation. Browses, Office etc. What can I do to solve this problem?

    hi relvas,
    Welcome to the Forums.
    Just to verify, do you have the IdeaPad G40-70 / 80GA shown in this page? If yes, which one is yours?
    As for the slow performance, can you try the following:
    1. Ensure that the power option is set to High Performance.
    2. Open Task Manager and check if there's are processes that's eating up resources (CPU, HDD, Memory, etc.) and try ending these task and observe.
    3. Boot the machine in Safe Mode with Networking and check if the performance is still slow. If the system is looks very responsive, perform a clean boot to temporarily disable non-microsoft services/apps that might be eating up the system resources and observe in normal mode.
    Regards
    Did someone help you today? Press the star on the left to thank them with a Kudo!
    If you find a post helpful and it answers your question, please mark it as an "Accepted Solution"! This will help the rest of the Community with similar issues identify the verified solution and benefit from it.
    Follow @LenovoForums on Twitter!

  • Remove/add panel to applet speedy in 1.3.x; painfully slow in 1.4.1/2.beta

    The following code (which was working for years, including even 1.3.x) suddenly fails in 1.4.1 and 1.4.2beta on both win 2000 and win xp
    DESCRIPTION OF PROBLEM :
    An applet consists of 2 components: a contents panel and a button. The contents panel consists of one of several panels of components which are swapped at run-time. The first time a panel is added, the applet works fine, but subsequent additions of the "cached" panel cause 1.4.1 and 1.4.2beta to go to 100% utilization and take 10 seconds before properly displaying the panel.
    STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
    Load applet described above (and whose short complete example is reproduced below), then click on button "Swap Contents". Each click should swap the contents between 2 panels very quickly. 1.3.x releases did all swaps quickly as expected. Suddenly, in 1.4.1 and 1.4.2beta, the first click is fine, but subsequent clicks are painfully slow.
    ---------- BEGIN SOURCE ----------
    // Java code to reproduce bug followed by html file to load applet
    import java.awt.*;
    import java.awt.event.*;
    public class TestRemoveAddApplet extends java.applet.Applet {
    Container contentPanel = new Panel();
    Button button = new Button("Swap contents");
    Panel contents1 = new Panel();
    Panel contents2 = new Panel();
    Label contentsL1 = new Label("Contents #1");
    Label contentsL2 = new Label("Contents #2");
    Component current = contents2;
    public void init() {
    setLayout(new BorderLayout());
    add(contentPanel,"Center");
    add(button,"South");
    button.addActionListener(new Swap());
    contents1.add(contentsL1);
    contents2.add(contentsL2);
    // initialize contents
    swapContents();
    class Swap implements ActionListener {
    public void actionPerformed(ActionEvent e) {
    swapContents();
    void swapContents() {
    current = (current == contents1 ? contents2 : contents1);
    // remove contents of previous contents panel
    contentPanel.removeAll();
    // display new contents
    contentPanel.add(current);
    validate();
    HTML file follows:
    <HTML>
    <HEAD>
    <TITLE>Test Remove / Add in Applet</TITLE>
    </HEAD>
    <BODY>
    <OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
    WIDTH = 100% HEIGHT = 100% >
    <PARAM NAME = CODE VALUE = "TestRemoveAddApplet" >
    <PARAM TYPE = "application/x-java-applet;version=1.1" >
    </OBJECT>
    </BODY>
    </HTML>
    ---------- END SOURCE ----------

    Try hiding the panels first then adding them then show. I know its crazy but I have gotten better performance this way with 1.4.1x. Try it.
    current.setVisible(false);
    contentPanel.add(current);
    current.setVisible(false);

  • FF very slow on shopping sites or news sites. OK temporarily when I remove all cookies and offline content storage, but the slows again

    FF very slow on shopping sites or news sites. OK temporarily when I remove all cookies and offline content storage, but then slows again

    Reload web page(s) and bypass the cache.
    * Press and hold Shift and left-click the Reload button.
    * Press "Ctrl + F5" or press "Ctrl + Shift + R" (Windows,Linux)
    * Press "Cmd + Shift + R" (MAC)
    Clear the cache and the cookies from sites that cause problems.
    "Clear the Cache":
    * Tools > Options > Advanced > Network > Offline Storage (Cache): "Clear Now"
    "Remove Cookies" from sites causing problems:
    * Tools > Options > Privacy > Cookies: "Show Cookies"
    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    *Don't make any changes on the Safe mode start window.
    *https://support.mozilla.com/kb/Safe+Mode

  • Very Slow Spot Removal Tool in LR5?

    Hello,
    Has anyone else noticed the SPot Removal tool being very slow in LR5?  I don't even mean when painting a selection.  Just moving the mouse around the screen is sluggish and jittery for my on my Win7 system.
    Thanks for any suggestions,
    ~Steve

    I am running Windows 7 (64 bit) with an i7-3930k processor (12 cores at 3.2GHz), 64 GB RAM, an SSD boot and app drive, a separate SSD scratch drive for Adobe stuff, and 2 GeForce GTX 580 GPU's (3 GB video RAM each).  WIth this setup, I wouldn't say that LR4 ran perfectly, but it was a lot better than LR5 is running for me.
    I haven't gotten out of the Develop module with LR5 yet, so I can't say anything about printing or exporting, but most of the adjustment sliders are stickier than in LR4.  It takes a few seconds for any adjustments to be seen on the image after moving the slider.  This was most noticeable for me with the local Adjustment Brush.  Painting the mask work fine, but after that any adjustments take 3-4 seconds to appear on-screen.  The adjustments like Sharpening and Noise Reduction under the Detail panel take a few seconds to appear.  I know I'm asking for help here, but please understand that I don't have time to check every slider and function within the application.  It's very obvious to me that LR5 runs much slower than LR4.4 on the same computer.
    Here's my System Info from Lightroom if you're interested:
    Lightroom version: 5.0 [907681]
    Operating system: Windows 7 Ultimate Edition
    Version: 6.1 [7601]
    Application architecture: x64
    System architecture: x64
    Logical processor count: 12
    Processor speed: 3.2 GHz
    Built-in memory: 65477.5 MB
    Real memory available to Lightroom: 65477.5 MB
    Real memory used by Lightroom: 1327.1 MB (2.0%)
    Virtual memory used by Lightroom: 1298.9 MB
    Memory cache size: 0.0 MB
    Maximum thread count used by Camera Raw: 6
    System DPI setting: 96 DPI
    Desktop composition enabled: Yes
    Displays: 1) 2560x1600
    Application folder: C:\Program Files\Adobe\Adobe Photoshop Lightroom 5
    Library Path: E:\Users\SATX79\Pictures\Lightroom\Lightroom 5 Catalog.lrcat
    Settings Folder: C:\Users\SATX79\AppData\Roaming\Adobe\Lightroom
    Installed Plugins:
    1) Behance
    2) Canon Tether Plugin
    3) Export to Photomatix Pro
    4) Facebook
    5) Flickr
    6) HDR Efex Pro 2
    7) Leica Tether Plugin
    8) Nikon Tether Plugin
    Config.lua flags: None
    Adapter #1: Vendor : 10de
              Device : 1080
              Subsystem : 15883842
              Revision : a1
              Video Memory : 3019
    AudioDeviceIOBlockSize: 1024
    AudioDeviceName: Speakers (Realtek High Definition Audio)
    AudioDeviceNumberOfChannels: 2
    AudioDeviceSampleRate: 44100
    Build: Uninitialized
    CardID: 4224
    Direct2DEnabled: false
    GPUDevice: D3D
    MaxTexture2DSize: 8192
    OGLEnabled: true
    Renderer: NVIDIA GeForce GTX 580
    ShaderModel: 11.1
    Vendor: Nvidia
    VendorID: 4318
    Version: 10de:1080:15883842:00a1
    Also, when I looked this up, I checked the About dialog.  The credits pane doesn't scroll.  :-)
    Thanks for your attention,
    ~Steve

  • The problem is with the new operating system  and sending photo via email when used in my iPad.   From photo I selected 3 photos to send via email. I choose the upload key and choose to send by email. Typing text on the email is very slow.

    The problem is with the new operating system  and sending photo via email when used in my iPad.
    From photo I selected 3 photos to send via email. I choose the upload key and choose to send by email. Typing text on the email is very slow. This is solved by saving the email as a draft and opening the email again from mail.
    Can you amend he system to allow emails to be sent from photo as previously.

    Have you tried restarting or resetting your iPad?
    Restart: Press On/Off button until the Slide to Power Off slider appears, select Slide to Power Off and, after the iPad shuts down, then press the On/Off button until the Apple logo appears.
    Reset: Press the Home and On/Off buttons at the same time and hold them until the Apple logo appears (about 10 seconds). Ignore the "Slide to power off"

  • My iphone took all of my pics off of my computer. this is making it very slow. How do I remove them if the only options are places or albums?

    Hello,
    I accidently hit restore on my phone and erased everything. When I called Apple they helped me retrieve everything from my computer and more. I now have over 4,000
    pics on my phone  that were on my computer, which is making it very slow. How do I get these off when the only options the phone is giving me are places and albums

    To Remove Photos from your Phone you need to Sync your phone with the Computer you Usually Sync with...
    See Here for Syncing...
    http://support.apple.com/kb/HT1386
    From Here
    http://www.apple.com/support/iphone/syncing/
    iPhone User Guide
    http://manuals.info.apple.com/en_US/iphone_user_guide.pdf

  • Since download of Firefox Hello desktop & laptop both on Windows 7 are very slow even after refresh, download history removed and anti virus software turned off

    Since download of Firefox Hello my home desktop & laptop, both on Windows 7, are very slow to open. I have refreshed firefox, removed download history and turned off the anti virus software in extensions. All the plugins are up to date. Can we revert back to Firefox without Firefox Hello?

    Firefox Hello is simply a wrapper for technology already in Firefox, it doesn't negatively impact performance if you aren't using it. Are you saying that your entire computer is slow or just Firefox?

  • 11g (11.2.0.1) - dimension operator very slow on incremental load

    Dimension operator very slow in porcessing incremental loads on 11.2.0.1 Have applied cumulative patch - still same issue.
    Statistics also gathered.
    Initial load into empty dimension performs fine (thousands of records in < 1 min) - incremental load been running over 10 mins and still not loaded 165 records from staging table.
    Any ideas?
    Seen in 10.2.0.4 and applied patch which cured this issue.

    Hi,
    Thanks for the excellent suggestion.
    Have run other mapings which maintain SCD type 2 using dimesnion operator behave similary to 10g. - have raised issue with this particular mapping with Oracle - awaiting response.
    One question - when look at the mappings which maintain SCD Type 2s looks to join on dimension key and the surrogate ids.
    What is best practice regarding indexing of such a dimension, e.g is it recommended to index dimension key and the surrogate ids along with the natural/nbusiness keys?
    Thanks

  • I want to buy MBA 11'' which model is good.  i.e.  i need speed.  I am using Lenovo netbook s-10. Is very slow in opening web pages an also in operating other apps.

    I want to buy MBA 11'' which model is good.  i.e.  i need speed.  I am using Lenovo netbook s-10. Is very slow in opening web pages an also in operating other apps.

    Put your first emphasis on memory. Don't even consider 2 GB.
    Second, maximize your SSD size according to the ability of your wallet. Lastly is your processor.
    For what you describe the MBA is plenty fast.

  • Why the response is very slow when the DNS enrty of server PC is remov

    Hi
    Though this subject has been already discussed at many places,im unable to get the clue.Here is my problem.In my office (LAN),server and client are running at different PC.After DNS entry of server PC is removed from DNS server,the page loading and every request & response between client and server is very slow.It takes 2 minutes for each and every request.And coming to the possible solutions,is "configuring the server PC in DNS server" is the only solution?When both the server and client PCs are DNS configured i dont see any issue or slowdown.Any help would be really appreciated
    Assuming it is a lookup issue,i have written the following test application.
    public class DnsName
    public static void main(String[] arg)
    String ipaddress = "";
    String hostaddress = "";
    if(arg.length == 1)
    ipaddress = arg[0];
    else
    System.out.println("!!!!!!Usage : java DnsName <ipaddress>");
    System.exit(0);
    System.out.println("Time before processing : " + System.currentTimeMillis());
    try
    hostaddress = (InetAddress.getByName(ipaddress)).getHostName();
    catch(UnknownHostException uhe)
    System.out.println("Exception occured " + uhe);
    System.out.println("Ip address : " + ipaddress);
    System.out.println("Host name : " + hostaddress);
    System.out.println("Time after processing : " + System.currentTimeMillis());
    When it was compiled and run on a linux PC,time difference betwwen process is around 50ms,but when the same application is run in a Windows PC,the time difference is around 4-5 seconds(4000ms).Can anyone tell me what makes the difference in Windows??
    [email protected]
    www.adventnet.com

    Because it does a DNS lookup. And without a server, the interface must wait for a timeout.

  • Why the response is very slow when the DNS enrty of server PC is removed ??

    Hi
    Though this subject has been already discussed at many places,im unable to get the clue.Here is my problem.In my office (LAN),server and client are running at different PC.After DNS entry of server PC is removed from DNS server,the page loading and every request & response between client and server is very slow.It takes 2 minutes for each and every request.And coming to the possible solutions,is "configuring the server PC in DNS server" is the only solution?When both the server and client PCs are DNS configured i dont see any issue or slowdown.Any help would be really appreciated
    Assuming it is a lookup issue,i have written the following test application.
    public class DnsName
    public static void main(String[] arg)
    String ipaddress = "";
    String hostaddress = "";
    if(arg.length == 1)
    ipaddress = arg[0];
    else
    System.out.println("!!!!!!Usage : java DnsName <ipaddress>");
    System.exit(0);
    System.out.println("Time before processing : " + System.currentTimeMillis());
    try
    hostaddress = (InetAddress.getByName(ipaddress)).getHostName();
    catch(UnknownHostException uhe)
    System.out.println("Exception occured " + uhe);
    System.out.println("Ip address : " + ipaddress);
    System.out.println("Host name : " + hostaddress);
    System.out.println("Time after processing : " + System.currentTimeMillis());
    When it was compiled and run on a linux PC,time difference betwwen process is around 50ms,but when the same application is run in a Windows PC,the time difference is around 4-5 seconds(4000ms).Can anyone tell me what makes the difference in Windows??
    [email protected]
    www.adventnet.com

    When you do getHostName() on an InetAddress, what you're doing is asking the OS to do a reverse lookup. So basically this is a windoze problem, not a java problem (although that probably doesn't help you much) Try searching google to see why a windows reverse lookup might be so slow and go from there.

Maybe you are looking for