Slow to add components to a displayed container.

I am working on a Java project which needs to remove components from a Panel (pp_right) and then add componts to the same Panel (pp_right). My program was working well before under environment JRE 1.2 however it is very slow now to add componets to the Panel under the lastest Java environment (JRE 1.3 or 1.4).
I would really appreciate if somebody can help me out. Here is the website if you are interested in trying it:
http://cee.uiuc.edu/sstl/java/mdof/Isolation.html. Just click the button "Show Virtual Model". The codes related to add/remove componts are:
else if (evt.target == virtualModelButton)
if (virtualModelButton.getLabel() == "Show Virtual Model")
getstorynumber(); // get storynumber, if it has been changed, reset parameters.
virtualModelButton.setLabel("Show Control Panel");
pp_right_bottom.remove(pp_button1);
pp_right.remove(pp_right_top);
pp_right.add("North", pp_right_top2);
else if (virtualModelButton.getLabel() == "Show Control Panel")
pp_right.remove(pp_right_top2);
virtualModelButton.setLabel("Show Virtual Model");
pp_right_bottom.add(pp_button1, 0);
pp_right.add("North", pp_right_top);
pp_right.validate(); // This method has to be called each time after
// the components are added/removed.
Thank you very much!

Some tips when adding / removing components from a Container object:
1. It is often easier and safer to use the removeAll() method, and then rebuild the panel as desired. It is possible to get into trouble if the same component is added to different components or added to the same container multiple times.
2. After you have rebuilt your GUI, call the revalidate() method, followed by a repaint().

Similar Messages

  • Why should we add the components of JAppet to Container object ?

    why should we add the components of JAppet to Container object ? Because we are able to run the program by adding the components to the JApplet directly without using any container objects. Both with using and without using container to add components are giving the same outputs. So why we need to add them to container ? Thanks for all replying

    we are able to run the program by adding the components to the JApplet directly without using any container objectsSort of true. JApplet does have an add() method. And you can use that method rather than using getContentPane() and adding things to the Container it returns. But this method does not add things to the applet "directly without using any container objects".
    The [API documentation|http://java.sun.com/javase/6/docs/api/javax/swing/JApplet.html] explains: "JApplet contains a JRootPane as its only child. The contentPane should be the parent of any children of the JApplet. As a convenience add and its variants, remove and setLayout have been overridden to forward to the contentPane as necessary. This means you can write:
    {code}
    applet.add(child);
    {code}
    And the child will be added to the contentPane. The contentPane will always be non-null. Attempting to set it to null will cause the JApplet to throw an exception"

  • JLabel components not being displayed on the content Panel in Applet

    Hi everyone!!
    Plz give a solution to the following problem:
    I have an applet in which i have JPanel component and on that component i am adding a lot of JLabel components but the problem is that the JLabel components are not displayed on the applet unless i minimize or maximize the applet.
    kindly give solution to the problem.
    Thanks

    Howdy,
    code would be helpful. Here is a very simple JApplet that displays labels okay here in appletviewer. You talk of applets and JLabels. I assume you are using JApplets.
    import javax.swing.*;
    import java.applet.*;
    import java.awt.*;
    public class AppletPie extends JApplet {
         public void init() {
              Container cp = getContentPane();
              cp.setLayout(new FlowLayout());
              cp.add(new JLabel("Show"));
              cp.add(new JLabel("up"));
              cp.add(new JLabel("you"));
              cp.add(new JLabel("dumb"));
              cp.add(new JLabel("labels"));
    }Perhaps something in this code will help you to solve your problem.
    regards
    sjl

  • Acrobat xi - RE: Add sound icon- skin displayed is a 'blank white box' until it is clicked to activate it- can you lock skin to display before its activated so that in a print run the skin shows up (ie the controls-or any kind of greyed out rectangle, lik

    Hi,
    Acrobat xi - RE: Add sound icon- skin displayed is a 'blank white box' until it is clicked to activate it- can you lock skin to display before its activated so that in a print run the skin shows up (ie the controls-or any kind of greyed out rectangle, like video controls before 1st activation) and not the blank white box- if no, I guess I have to activate all sound icons before doing a print run?thanks)).

    Many of your points are totally legitimate.
    This one, however, is not:
    …To put it another way, the design of the site seems to be geared much more towards its regular users than those the site is supposedly trying to "help"…
    The design and management of the forums for more than five years have driven literally dozens of the most valuable contributors and "regulars" away from the forums—permanently.
    The only conclusion a prudent, reasonable person can draw from this state of affairs is that Adobe consciously and deliberately want to kill these forums by attrition—without a the PR hit they would otherwise take if they suddenly just shut them down.

  • "Add components to your existing installation" disabled in SQL Server 2000 clustered installation.

    When I try to add the
    fulltext service to a named instance in
    SQLServer 2000, I see the option "Add components to your existing installation"
    in gray.
    I launched
    the installer both ways, with the services stoped and started,
    and always the same result.

    Please check the below link and try..
    http://technet.microsoft.com/en-us/library/aa197936%28v=sql.80%29.aspx
    http://www.databasejournal.com/features/mssql/article.php/3441981/Full-Text-Search-on-SQL-2000-Part-1.htm
    Raju Rasagounder Sr MSSQL DBA

  • How can i add one field in the container for the standard task-90310004?

    Hi,
    Please let me know thw steps to add one field in the container for the standard task-90310004.
    Usefull suggestions will be rewarded.
    Regards,
    Neslin.

    <b>Hi,
    Containers are used for holding Application data for Workflow purposes.
    Event container
    Task container
    Workflow container
    Role container
    Binding is the linking of data from one container to the other for making data available all across the workflow.
    But you can get values from one container to another container like this
    Container(Con)
    1. WF Con to Role, Wf con to task con, Wf con to event
    and
    2. Event con to wf con, task con to wof con
    and
    3. Method con to task con
    and
    4. Task con to method con
    So, we don't have direct possible binding from task con to task con.
    Thanks and Regards,
    Prabhakar Dharmala</b>
    Message was edited by:
            Prabhakar Dharmala
        But you can do pass values from first task con to wf con and again from wf con to another task con

  • Possible to add multiple 'Collections' to a container

    Hello,
    In DB XML, is a 'Container' equivalent to an xquery 'Collection' ? All of the examples that I see, refer to the container when specifying the collection.
    Basically, I would like to create one Container - call in container1.dbxml Within container1, I would like to have multiple collections, collection1, collection2.
    I would then like to be able to run xqueries such as:
    count(/*) - and get a count of all the docs in both collection1 and collection2 or
    collection("collection1")/* - and get all the nodes in collection1 only
    So, bottom line question - can I add multiple collections to a container, or is a container and collection equivalent in DB XML?
    Thanks for your responses.

    IBB
    What you want to do is create a class that extends the Java XmlResolver class, and register that class with the XmlManager. In your extended class you would want to implement the following function:
    public boolean resolveCollection(XmlTransaction txn, XmlManager mgr, String uri, XmlResults result)
    So that the result argument contains all the documents in the collection specified by the uri. You will likely want to do this by querying the container for the documents for the given collection and copying the results returned by the query to the argument.
    Below is an example of an implementation of the function that resolves the collection to a single document.
    public boolean resolveCollection(XmlTransaction txn, XmlManager mgr, String uri, XmlResults result) throws XmlException {
         XmlDocument doc = mgr.createDocument();
         doc.setName(name);
         doc.setContent(content);
         XmlValue val = new XmlValue(doc);
         result.add(val);
         return true;
    Lauren Foutz

  • How to avoid extra div tags, when we add components using cq:include

    I tried using the below code in my component jsp from forums to remove those extra div tags when we try to add components using <cq:include tags.
    <%
       if (WCMMode.fromRequest(request) != WCMMode.EDIT && WCMMode.fromRequest(request) != WCMMode.DESIGN) {
           IncludeOptions.getOptions(request, true).forceSameContext(Boolean.TRUE);
    %>
    But this code helped to remove most of the extra div tags , but still adds this extra div tag to the first component I add using  <cq:include tag.
    its a basic and very critical necessity to maintain our markup design,But due to this  dynamically added extra div tag will hinder the html and css behaviour of the page.
    Appreciate your help to resolve this issue.
    Thanks

    Hi,
    Can you try below if you really dont want to include anything during include.
    <%
    IncludeOptions opts=null;
       if (WCMMode.fromRequest(request) != WCMMode.EDIT && WCMMode.fromRequest(request) != WCMMode.DESIGN) {
    opts= IncludeOptions.getOptions(request, true);     
    opts.forceSameContext(Boolean.TRUE);
    opts.setDecorationTagName("");
    %>
    Thanks,
    Pawan

  • Add a button to display Adobe Form through SPRO on T-code IQS22

    Hello All,
    I am trying to add a button to display Online Interactive Adobe Form through SPRO on T-code IQS22 but its not working.
    So please suggest me how can i add a button for it ASAP.
    Thanks and Regards:
    Anugrah

    I asked my question in hopes that somebody has maybe had a similar question or has dealtwith something similar to what I am trying to do
    But you said you already know how to do this. You said you know how to create a JFrame and display it. So what is your problem?
    You said you know where to add the code. So again what is your problem?
    All you posted is code that was generated by the IDE. You have not make any effort to add your own code. Why do you think the code to show a frame here, is any different than the code you used to show a frame in the past?
    You learn by trying, not by asking people to spoon feed the answer to you.
    If you would even make the slightest effort at filling in the code where the IDE has told you to add the code I would be more willing to help. But apparently you have no desire to make the effort.

  • Can you add components to an existing OAS installation?

    Hi All,
    I've not installed multiple components on OAS but let's say you have an existing environment with Oracle Portal...Can you add the Oracle Reports and Forms Services to this installation? Is this transparent?
    Thanks.

    Yes you can add components, but personally I wouldn't do this in a production situation. The main reason is that I don't know what will happen to your custom made settings (e.g. httpd.conf etc.).
    I should admit that I have no hands on experience adding forms and reports afterwards (portal I did and this did work, after some reconfiguring of apache).

  • How can I add KANNADA(India) as display language on my iphone4?

    how can I add KANNADA(India) as display language on my iphone4? your feedback will be highly appreciated.
    Thank you

    The languages available for displaying the OS are published in the tech specs, and you cannot add new ones:
    http://www.apple.com/iphone-5s/specs/
    The iphone does include a Kannada unicode font, so you should be able to see email and websites, such as
    http://kn.wikipedia.org/wiki/ಮುಖ್ಯ_ಪುಟ
    But there is no Kannada keyboard yet.  Search the app store for "kannada" to see if there is a keyboard app which might be useful for some purposes.

  • BAPI_REQUISITION_CREATE-way to add components

    I am trying to create a purchase requsition by BAPI_REQUISITION_CREATE
    but need to find a way to add components to the new purchase requisition.

    Hi,
    I've seen this code in some sites. See it might help you.
    LOOP AT it_requisiton_items INTO wa_requisiton_items.
    READ TABLE it_vbap
    INTO wa_vbap
    WITH KEY posnr = wa_requisiton_items-bnfpo.
    v_matnr = wa_vbap-matnr18.
    v_bamei = wa_requisiton_items-meins.
    Build table for call to BAPI
    wa_requisition_items_bapi-doc_type = eban_s-bsart.
    wa_requisition_items_bapi-purch_org = v_ekorg.
    wa_requisition_items_bapi-deliv_date = wa_requisiton_items-lfdat.
    wa_requisition_items_bapi-preq_item = wa_requisiton_items-bnfpo.
    wa_requisition_items_bapi-quantity = wa_requisiton_items-menge.
    wa_requisition_items_bapi-unit = wa_requisiton_items-meins.
    wa_requisition_items_bapi-material = v_matnr.
    wa_requisition_items_bapi-item_cat = wa_requisiton_items-pstyp.
    wa_requisition_items_bapi-acctasscat = wa_requisiton_items-knttp.
    wa_requisition_items_bapi-des_vendor = wa_requisiton_items-lifnr.
    wa_requisition_items_bapi-fixed_vend = wa_requisiton_items-flief.
    wa_requisition_items_bapi-plant = wa_requisiton_items-werks.
    wa_requisition_items_bapi-store_loc = wa_requisiton_items-lgort.
    wa_requisition_items_bapi-c_amt_bapi = wa_requisiton_items-preis.
    wa_requisition_items_bapi-price_unit = wa_requisiton_items-peinh.
    wa_requisition_items_bapi-purch_org = wa_requisiton_items-ekgrp.
    wa_requisition_items_bapi-mat_grp = wa_requisiton_items-matkl.
    IF wa_requisition_items_bapi-deliv_date IS INITIAL.
    wa_requisition_items_bapi-deliv_date = wa_vbap-erdat.
    ENDIF. "wa_requisition_items_bapi-deliv_date
    APPEND wa_requisition_items_bapi TO it_requisition_items_bapi.
    CLEAR wa_requisition_items_bapi.
    ENDLOOP. "it_requisiton_items into wa_requisiton_items
    CALL FUNCTION 'BAPI_REQUISITION_CREATE'
    EXPORTING
    SKIP_ITEMS_WITH_ERROR =
    IMPORTING
    number = preq_no
    TABLES
    requisition_items = it_requisition_items_bapi
    requisition_account_assignment = it_requisition_assignment
    REQUISITION_ITEM_TEXT =
    REQUISITION_LIMITS =
    REQUISITION_CONTRACT_LIMITS =
    REQUISITION_SERVICES =
    REQUISITION_SRV_ACCASS_VALUES =
    return = it_return
    REQUISITION_SERVICES_TEXT =
    REQUISITION_ADDRDELIVERY =
    EXTENSIONIN =
    COMMIT WORK.

  • How can we add components to JPanel so that they can be resizeable

    Is it possible to add components to JPanel so that we can resize them or drag them.

    You could try searching the forums, but I'll save you the trouble. tjacobs has oft posted code which does what you want, both dragging and resizing.
    You can find an example here or here.

  • How to add components to a subcontract PR using BAPI_PR_CREATE

    I am trying to use BAPI_PR_CREATE in SAP ECC 6.0 to create a Purchase Requisition with Item Category "L" (subcontracting) to be subcontracted to a vendor for repair.  Normally, in ME51N, we would add components to the PR before creating it, but I can't see any way to do that with this BAPI, and the documentation doesn't say.
    The result is an error with the following messages:
    T ID                   NUM MESSAGE
    E BAPI                 001 No instance of object type PurchaseRequisition has been created. External reference: # 1
    E ME                   154 Not possible to determine any components
    E ME                   642 Subcontracting only possible with vendor
    The error 154 (Not possible to determine any components) is the same message that would appear in ME51N if the components were not added for the repair.
    The error 642 (Subcontracting only possible with vendor) is confusing because a valid vendor number is being supplied to the FIXED_VEND field in PRITEM and the equivalent field in PRITEMX is marked with X.
    Any help would be greatly appreciated.

    Very late reply - but hoping it might help somebody in the future:
    SAP Note 1489799 - ME 154: Creating subcontracting purchase requisition w/o BOM

  • MIGO : add components for consumption (mvt.543) during goods receipt po

    Dear guru.
    Can I add components for consumption with movement 543 during the goods receipt of a purchase order (mvt.101) ?
    Thanks.

    Pl add child components in bill of material of parent item,then explode bom in purchase order.

Maybe you are looking for

  • Network user, network home folder, and the login keychain

    I've got everything set up in WGM. I can log the user onto a workstation, and the home folder maps to the appropriate network location. What I can't seem to do, is get a login keychain working. The keychain exists, in the proper folder on the network

  • Create withholding tax data subsequently for reconciled and open items in c

    Hi All, Mine is a US co code and I have a  vendor for which invoice and payment documents are posted. After posting the invoice i found that the vendor is subjected to classic withholding tax which i did not calculate when posting invoice, making pay

  • PC to Mac Transfer

    I have a nano formatted to Windows (Dell PC) but I have recently purchased a Mac Book Pro and want to transfer my itunes library from the PC to the Mac. What's the simplest way to do this? Thanks for any help!

  • Weblogic not startng after configuring weblogic92 with soa-suite 10.1.3.4

    Configurig WebLogic 9.2 with soa-suite 10.1.3.4 .New domain has been created sucessfully.Wheh tried to start weblogic using command in C:\bea\user_projects\domains\SOADomain\bin Error comes : Provider javax.xml.stream.XMLInputFactory could not be ins

  • How to Add New Object?

    HI, Any body can say how to add new object. For Example: The Document need to link with Invoice Transaction (T.Code: VF01, Table: VBRK/VBRP). Points will be rewarded, if information is useful. Tks Mani.