Why objects are  dynamically created in java

Why objects are dynamically created in java even if dynamically created object requires more space & more memory references as compared to static object?

I don't even know where to start...
KAMAL.MUKI wrote:
Why objects are dynamically created in javaWhat is the alternative?
even if dynamically created object requires more space & more memory referencesCan you prove that?
as compared to static object?Can you define "static object"?
I vote "troll".

Similar Messages

  • Why there are overloaded create methods in Statful bean?

    Hi all,
    I have a question ...!
    Why there are overloaded create methods for Statefule beans? and why not for Stateless bean?
    because any way these create methods are for giving referneces of EJB objects.hence, what is use of overloaded methods in stateful bean?
    Thanks in advance.
    Regards,
    Rahul

    Hi Rahul,
    Each stateful session bean is tied to a particular client. That means whatever state is passed in during create() is guaranteed
    to be available on subsequent invocations. Allowing multiple create methods is a convenience.
    For stateless session beans there is no prescribed relationship between the caller and which bean instance is used to handle
    an invocation. It wouldn't make sense to allow creation parameters since there would be no guarantee that a subsequent
    invocation is handled by an instance containing that particular initialization state.
    All of this only applies to the EJB 2.1 and earlier API. Starting in EJB 3.0, there are no longer explicit create() methods.
    As you've seen there isn't any benefit to having them in the stateless case. For stateful session beans in EJB 3.0, the
    developer can perform initialization by just declaring a particular business method and calling that after first acquiring a
    new stateful session bean reference.
    --ken                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Why 2BDOCS are getting created for sending Sold to Party to ECC.

    Hi,
    I have a question, when BP (Sold to) gets create in CRM & replicates in successfully ECC.When I see Tran SMW01, I found two bdocs are getting created for same Sold to. Why this is happening!! How I can remove the another Bdoc type (VEND_MAIN).
    Please suggest.

    Hello Developer,
    Yes, I've checked the combinations of webshop(In Shopadmin) and Product Catalog.(Sales Area) 
    All of them are compatible.
    Hey DJ,
    When you say: u201Cthe first entry maintained in the USAPPLREF tableu201Du2026.in our case, there are 2 entries for my user (PPELA3). The first one is for object type BUS1006001 and object key nr° 23263-my contact person, linked to sold-to nr° 1000003), which is the employee that I 've created in the ISAUSERADMIN.
    The second entry is with object type KNA1 with object key nr° 1000003 (which is the sold-to).
    Those are the only entries for my user in this table.
    Does this sequence have the influence described by you? Is that what you want to say?
    Other point: Does the REFERENCE CUSTOMER is important for the B2B scenario? (Our case) Since I thought it was important just for B2C scenarios, It was the same number in SHOPADMIN Webshop creation.
    In the meantime, I will create a new reference customer and change the webshop parameters.
    Thanks for your inputs.
    Regards,
    Paulo Pela

  • Why objects are invalid?

    Hi all,
    IS there any specificreasons why there are so many objects are invalid....
    [per]
    SQL>
    SQL> select A.Owner Oown,
    2 A.Object_Name Oname,
    3 A.Object_Type Otype,
    4 'Miss Pkg Body' Prob
    5 from DBA_OBJECTS A
    6 where A.Object_Type = 'PACKAGE'
    7 and A.Owner ='data'
    8 and not exists
    9 (select 'x'
    10 from DBA_OBJECTS B
    11 where B.Object_Name = A.Object_Name
    12 and B.Owner = A.Owner
    13 and B.Object_Type = 'PACKAGE BODY')
    14 union
    15 select Owner Oown,
    16 Object_Name Oname,
    17 Object_Type Otype,
    18 'Invalid Obj' Prob
    19 from DBA_OBJECTS
    20 where Object_Type in
    21 ('PROCEDURE','PACKAGE','FUNCTION','TRIGGER','PACKAGE BODY','VIEW')
    22 and Owner ='data'
    23 and Status != 'VALID'
    24 order by 1,4,3,2
    25 /
    data
    CHK_CURR_CORR_REG_ART_CO_DEEP
    FUNCTION Invalid Obj
    data
    FN_CHK_MAIN_ACT
    FUNCTION Invalid Obj
    data
    F_GET_FC_OPBAL
    FUNCTION Invalid Obj
    data
    F_GET_LC_OPBAL
    FUNCTION Invalid Obj
    data
    F_GET_MAIN_FC_OPBAL
    FUNCTION Invalid Obj
    data
    F_GET_MAIN_LC_OPBAL_DIV_1
    FUNCTION Invalid Obj
    data
    F_GET_MAIN_LC_OPBAL_DIV_DEPT
    FUNCTION Invalid Obj
    data
    F_GET_SUB_FC_OPBAL
    FUNCTION Invalid Obj
    data
    F_GET_SUB_LC_OPBAL
    FUNCTION Invalid Obj
    data
    ODB_CHK_COMB_FIRM
    FUNCTION Invalid Obj
    data
    O_DGET_JOB_AUTO_CSV_STS_AUTO
    FUNCTION Invalid Obj
    data
    O_DGET_JOB_CSV_STATUS
    FUNCTION Invalid Obj
    data
    O_GET_SRN_APPL_DT
    FUNCTION Invalid Obj
    data
    O_GET_SRN_CCT_REG_DT
    FUNCTION Invalid Obj
    data
    O_GET_SRN_NAME1
    FUNCTION Invalid Obj
    data
    O_GET_SRN_PAID_FEES
    FUNCTION Invalid Obj
    data
    REM_TEST
    FUNCTION Invalid Obj
    data
    SAR_TEST_FUNC
    FUNCTION Invalid Obj
    data
    CUSTOMER_UPDATE
    PACKAGE Invalid Obj
    data
    OVERLOAD_EG
    PACKAGE Invalid Obj
    data
    PACK1
    PACKAGE Invalid Obj
    data
    PDM_STUD_REFUND_PECS
    PROCEDURE Invalid Obj
    data
    PDM_STUD_REFUND_TCS
    PROCEDURE Invalid Obj
    data
    PDM_STUD_REG_CCT
    PROCEDURE Invalid Obj
    data
    PDM_STUD_REG_FND
    PROCEDURE Invalid Obj
    data
    PDM_STUD_REG_INT
    PROCEDURE Invalid Obj
    data
    PDM_STUD_REG_INT_DUMMY
    PROCEDURE Invalid Obj
    data
    PDM_STUD_REG_INT_DUP_FND_NO
    PROCEDURE Invalid Obj
    data
    PDM_STUD_REG_PE2ART
    PROCEDURE Invalid Obj
    data
    PDM_STUD_REG_PE2ART_RAGHU
    PROCEDURE Invalid Obj
    data
    PDM_STUD_REG_PEI
    PROCEDURE Invalid Obj
    data
    PDM_STUD_REG_PEII
    PROCEDURE Invalid Obj
    data
    ODBTRG101_ITEM
    TRIGGER Invalid Obj
    data
    ODBTRG103_REF
    TRIGGER Invalid Obj
    data
    ODBTRG437_AAT_ACVT_UPT_DAK
    TRIGGER Invalid Obj
    data
    ODBTRG437_AFCD
    TRIGGER Invalid Obj
    data
    ODBTRG437_AFCD_01
    TRIGGER Invalid Obj
    data
    ODBTRG437_AR
    TRIGGER Invalid Obj
    data
    ODBTRG437_BIN
    TRIGGER Invalid Obj
    data
    OV_MEM_FEE_CHK
    VIEW Invalid Obj
    data
    A_DUMMY
    PACKAGE Miss Pkg Body
    data
    CUSTOMER_UPDATE
    PACKAGE Miss Pkg Body
    data
    DBMS_LOCK
    PACKAGE Miss Pkg Body
    data
    ORNDBPKG_ART_FEE_COLL
    PACKAGE Miss Pkg Body
    data
    OVERLOAD_EG
    PACKAGE Miss Pkg Body
    data
    PACK1
    PACKAGE Miss Pkg Body
    data
    PKS
    PACKAGE Miss Pkg Body
    data
    RECEIPT_NO_VARIABLE
    PACKAGE Miss Pkg Body
    data
    STAGE_PACK
    PACKAGE Miss Pkg Body
    SQL> spool off

    SET SERVEROUTPUT ON;
    SET LINESIZE 1000;
    DECLARE
         || Cursor to all Object types in All_Objects belonging to the current user.
         CURSOR Cur_Object_Types
         IS
         SELECT DISTINCT Object_Type
           FROM All_Objects
          WHERE Owner = User;
         || Select the Invalid objects for the given object type.
         CURSOR Cur_Invalid_Objects(
              p_Object_Type     IN All_Objects.Object_Type%TYPE
         IS
         SELECT Object_Name, Status      
           FROM All_Objects
          WHERE Object_Type = p_Object_Type
            AND Status <> 'VALID'
            AND Owner = User;
         || Cursor to select the status of function based indexes.
         CURSOR Cur_FuncIdx
         IS
         SELECT Index_Name, FuncIdx_Status
           FROM User_Indexes
          WHERE FuncIdx_Status <> 'ENABLED';
         || Select all public synonyms created for current user object for
         || which underlying objects does not exists.
         CURSOR Cur_Synonyms
         IS
         SELECT Synonym_Name
               FROM All_Synonyms
          WHERE Owner = 'PUBLIC'
            AND Table_Owner = User
            AND Synonym_Name NOT IN (SELECT Object_Name
                                 FROM User_Objects);
         ln_LoopCnt     NUMBER;
         ln_TabIdxCnt     NUMBER;
         lv_Object_Type     VARCHAR2(100);
         lv_Object_Name     VARCHAR2(100);
         lv_Status     VARCHAR2(100);
         TYPE IObj_Type
         IS
         RECORD (Object_Type     VARCHAR2(100)
                ,Object_Name     VARCHAR2(100)
                ,Status          VARCHAR2(100)
         TYPE IObj_Tab_Type
         IS
         TABLE OF IObj_Type;
         IObj_Table      IObj_Tab_Type;
    BEGIN
         DBMS_OUTPUT.DISABLE;
         DBMS_OUTPUT.ENABLE(999999999999);
         DBMS_OUTPUT.PUT_LINE(CHR(10));
         IObj_Table   := IObj_Tab_Type();
         ln_TabIdxCnt := 0;
         FOR I IN Cur_Object_Types
         LOOP
                ln_LoopCnt := 0;
              FOR J IN Cur_Invalid_Objects(I.Object_Type)
              LOOP
                   ln_TabIdxCnt := ln_TabIdxCnt + 1;
                   ln_LoopCnt   := ln_LoopCnt + 1;          
                   IObj_Table.Extend;
                   IObj_Table(ln_TabIdxCnt).Object_Type := I.Object_Type;
                   IObj_Table(ln_TabIdxCnt).Object_Name := J.Object_Name;
                   IObj_Table(ln_TabIdxCnt).Status      := J.Status;
              END LOOP;
         IF ln_LoopCnt = 0 THEN
              ln_TabIdxCnt := ln_TabIdxCnt + 1;
              IObj_Table.Extend;
              IObj_Table(ln_TabIdxCnt).Object_Type := I.Object_Type;
              IObj_Table(ln_TabIdxCnt).Object_Name := ' ';
              IObj_Table(ln_TabIdxCnt).Status      := 'NONE';
         END IF;
         END LOOP;
         ln_LoopCnt := 0;
         FOR K IN Cur_FuncIdx
         LOOP
              ln_TabIdxCnt := ln_TabIdxCnt + 1;
              ln_LoopCnt   := ln_LoopCnt + 1;          
              IObj_Table.Extend;
              IObj_Table(ln_TabIdxCnt).Object_Type := 'FUNCTION BASED INDEX';
              IObj_Table(ln_TabIdxCnt).Object_Name := K.Index_Name;
              IObj_Table(ln_TabIdxCnt).Status      := K.FuncIdx_Status;
         END LOOP;
         IF ln_LoopCnt = 0 THEN
              ln_TabIdxCnt := ln_TabIdxCnt + 1;
              IObj_Table.Extend;
              IObj_Table(ln_TabIdxCnt).Object_Type := 'FUNCTION BASED INDEX';
              IObj_Table(ln_TabIdxCnt).Object_Name := ' ';
              IObj_Table(ln_TabIdxCnt).Status      := 'NONE';
         END IF;     
         ln_LoopCnt := 0;
         FOR L IN Cur_Synonyms
         LOOP
              ln_TabIdxCnt := ln_TabIdxCnt + 1;
              ln_LoopCnt   := ln_LoopCnt + 1;          
              IObj_Table.Extend;
              IObj_Table(ln_TabIdxCnt).Object_Type := 'PUBLIC SYNONYM WITHOUT UNDELYING OBJECT IN SCHEMA '||USER;
              IObj_Table(ln_TabIdxCnt).Object_Name := L.Synonym_Name;
              IObj_Table(ln_TabIdxCnt).Status      := 'UNDERLYING OBJECT NOT FOUND';
         END LOOP;
         IF ln_LoopCnt = 0 THEN
              ln_TabIdxCnt := ln_TabIdxCnt + 1;
              IObj_Table.Extend;
              IObj_Table(ln_TabIdxCnt).Object_Type := 'PUBLIC SYNONYM WITHOUT UNDELYING OBJECT IN SCHEMA '||USER;
              IObj_Table(ln_TabIdxCnt).Object_Name := ' ';
              IObj_Table(ln_TabIdxCnt).Status      := 'NONE';
         END IF;          
         IF IObj_Table.COUNT > 0 THEN
              FOR I IN 1..IObj_Table.COUNT
              LOOP
              lv_Object_Type     := IObj_Table(I).Object_Type;     
              lv_Object_Name     := IObj_Table(I).Object_Name;     
              lv_Status     := IObj_Table(I).Status;
                   IF I = 1 THEN
                        DBMS_OUTPUT.PUT_LINE('+-----------------------------------------------------------------------------------------------------------------------------+');
                        DBMS_OUTPUT.PUT_LINE(RPAD('|                                               LIST OF INVALID OBJECTS',134,' ')||'|');
                        DBMS_OUTPUT.PUT_LINE('|-----------------------------------------------------------------------------------------------------------------------------|');
                        DBMS_OUTPUT.PUT_LINE(RPAD('|                   OBJECT TYPE                              |               OBJECT NAME        |               STATUS',134,' ')||'|');
                        DBMS_OUTPUT.PUT_LINE('|-----------------------------------------------------------------------------------------------------------------------------|');
                   END IF;
                   DBMS_OUTPUT.PUT_LINE('| '||RPAD(lv_Object_Type,59,' ')||'| '||RPAD(lv_Object_Name,32,' ')||' | '||RPAD(lv_Status,28,' ')||'|');
              END LOOP;
              DBMS_OUTPUT.PUT_LINE('|-----------------------------------------------------------------------------------------------------------------------------|');
         ELSE
              DBMS_OUTPUT.PUT_LINE('THERE ARE NO INVALID OBJECTS IN SCHEMA '||USER||'.');
         END IF;
         DBMS_OUTPUT.PUT_LINE(RPAD('| NOTE: ',134,' ')||'|');
         DBMS_OUTPUT.PUT_LINE(RPAD('|      If you find any object in status INVALID / DISABLED / UNDERLYING OBJECT NOT FOUND, then ',134,' ')||'|');
         DBMS_OUTPUT.PUT_LINE(RPAD('|      execute the procedure RECOMPILE_INVALID_OBJECTS to fix the same.',134,' ')||'|');
         DBMS_OUTPUT.PUT_LINE('+-----------------------------------------------------------------------------------------------------------------------------+');
    END;
    [\pre]
    HTH..                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Objects are updated/created in the database in wrong order

    Hello,
    I have three objects tied with certain relations: Ticket, Type and
    Solution.
    Relation between Ticket and Solution is unidirectional one-to-one - ticket
    may contain one solution. Relation between Type and Solution is one-to-many
    bi-directional.
    During transaction I do the following:
    1) instantiate new Solution and add it to the Type;
    2) set this Solution to the Ticket.
    On commit Kodo tries to update ticket before creating solution in the
    database. What am I doing wrong?
    Thank you in advance.
    Best regards,
    Alexey Maslov

    Alex,
    Thank you. It worked :)
    "Alex Roytman" <[email protected]> wrote in message
    news:[email protected]...
    The best way to handle update/insert order is not to rely on it. Not only
    foreign key sensitive to order but unique constraints too. So if your
    database supports it (and most decent databases do) use defferred
    constraints - the ones which get applied on commit not on
    insert/update/delete and you will be fine
    "Alexey Maslov" <[email protected]> wrote in message
    news:[email protected]...
    Patric,
    Thank you for response.
    It's not about Type->Solution relation. We've got constraint from
    Ticket
    to Solution. But we need to load Ticket to get it's Type.
    It's a problem to instantiate the Solution before loading Type. Thething
    is that Type object is used to construct Solution automatically adding
    it
    to
    internal collection.
    This is done to overcome JDO deficiency in relation maintenance. I'vefound
    this pattern in Robin Roos' book.
    create...() method usage makes sure that dependent object is added tothe
    parent after each creation. Adding objects manually after creation wouldbe
    error-prone and code-cluttering.
    Where's that "transparency" so much told about on JDOCentral?
    P.S. I wonder how this pattern works in other places?
    "Patrick Linskey" <[email protected]> wrote in message
    news:[email protected]...
    Alexey,
    In Kodo JDO 2.3 and 2.4, object changes are flushed to the database in
    the order that the objects are first enlisted in the transaction. So,
    if
    you instantiate the Solution object before loading Type, everything
    should work the way you want it to.
    We have more sophisticated foreign key constraint satisfaction code in
    internal codebases -- expect to see this hit production in the nextfew
    months.
    -Patrick
    Alexey Maslov wrote:
    Hello,
    I have three objects tied with certain relations: Ticket, Type and
    Solution.
    Relation between Ticket and Solution is unidirectional
    one-to-one -
    ticket
    may contain one solution. Relation between Type and Solution is
    one-to-many
    bi-directional.
    During transaction I do the following:
    1) instantiate new Solution and add it to the Type;
    2) set this Solution to the Ticket.
    On commit Kodo tries to update ticket before creating solution inthe
    database. What am I doing wrong?
    Thank you in advance.
    Best regards,
    Alexey Maslov
    Patrick Linskey [email protected]
    SolarMetric Inc. http://www.solarmetric.com

  • Why the two objects are not add by java

    like below
    Integer i1=new Integer(5);
    Integer i2=new Integer(5);
    System.out.println(i1+i2);
    if i run this program out put is 10
    but
    Object o1=new Object();
    Object o2=new Object();
    System.out.println(o1+o2);
    gives compilation error.
    plz help me to solve this doubt

    Assuming this is not an April Fools Day joke,
    then the serious answer is: what does it MEAN to add two arbitrary objects?
    Intuitive answer:
    If all you told Java is that o1 is an Object and o2 is an Object,
    how would Java know what to do with them?
    Are them numbers? Are they lists? Are they graphical icons? What?
    Technical answer:
    The + operator requires numbers or Strings.
    And Java's auto-unboxing only works for primitive types.
    So only String, Float, Double, Integer, Short... will work.
    Object will not work.

  • Why objects are said to have physical reality when they are just software programs?

    I am very new to java, infact to the programming world, and am confused about classes and objects. Why do we need a class to create an object? How and when these objects find physical reality? And why do we need to create a software model of a physical thing? Where are these objects and classes stored?  Please help. Gone through 10+ websites and 4 books ,couldn't get the clear picture.

    0b5fc302-7c76-48af-be15-6146a99280a8 wrote:
    Why do we need a class to create an object?
    I'ts almost like a construction drawing of a car. This drawing tells you e.g. what the car will look like an how many persons it can carry. But the drawing is not able to do that. But the real car build based on that drawing is able to do things planned in the drawing. But the drawing does not tell what horsepower the cars engine may have. There will be different engines that may fit in the car giving it differen maximun speed and scceleration.
    Similar thing is with java classes and objects. A class describes what the objects created from that class are able to do. When You see a class you get a clear picture of those abilities without having an object yet. From that class you get objects having all the same behavior but the objects may differ in the properties given to them.
    0b5fc302-7c76-48af-be15-6146a99280a8 wrote:
    How and when these objects find physical reality?
    Not sure what you mean by that. A computer program has no physical reality in a way you coult touch. The physical reatity of a computer program is representet by the magnetic alignment of goups of tiny areas  at your hard drive or electric charge/discharge of the capacitors of your computers RAM. So there is no physical reality for a computer program.
    0b5fc302-7c76-48af-be15-6146a99280a8 wrote:
    And why do we need to create a software model of a physical thing?
    Imagin:
    You are a car manufactorer. You have to prove that your cars are safe for their passengers in case of a crash. How do you check that? Are you willing to build hundreds of physical cars only to destroy them in a test crash?
    The better way is to simulate the characteristics of the construction and the materials it will be build from in a computer program and do (most of) the crash test with that computer program untill you find a setup that is prommissing to pass a real physical crash test.
    0b5fc302-7c76-48af-be15-6146a99280a8 wrote:
    Where are these objects and classes stored?
    This question also has more than one answer:
    1. Computer programs are stored in the world wide web and/or your computer (which effectively is part of the www).
    2. Computer programes are stored on some kind of durable memory (punch tapes, magnetic tapes, barcodes, magnetic disks, memory cards/sticks, optical disks...)
    3. Computer programs are stored in so called files at those locations and memory types. There are 2 types of files: human readable files and machine readable files. The human readable files are used by programmers to create or change a program. Some kind of program (called compiler or interpreter which is not the same and Java uses both) converts human readable files into machine readable files. Machine readable files contain the program as a sequence of numbers that a computer will interpret as commands and their parameters.
    4. The machine readable files cannot be executed as long as they are at the locations and memories mentioned earlier. before a machine readable program can be executed it must be copied to the computers RAM.
    hopefully this didn't made things worse... ;o)
    bye
    TPD

  • How to create unique object for dynamically created jTextFields

    Hello to all forum members
    According to my requirement , i have created a number of jpanels(containing textfield,comboboxes etc) and added them to a jScrollPane.
    But my requirement is after adding the jPanels to the JScrollPanel, i want to add some logic to that jpanels; like
    1) i want to sort the panels according to some condition when a sort button is clicked
    2)and the text field which are in the panel should be sorted according to the integer value inside the text field.
    3) and after a buton clicked the value what are in the jText field should store in the data base etc.....
    For the above logic to apply i need the instance variable(i.e object reference ) should be difference, so that when i want to get a value from any component ( text from jtextfield ) i can get the value through its instance variable name.for example
    JTextField textField1=new JTextField("aaa");
    JTextField textField2=new JTextField("cccc");
    JTextField textField3=new JTextField("eee");then
    textField1.getText();
    textField2.getText();
    textField3.getText();But the problem is when i am creating the number of panels the name of the instance variables (of all the components i.e textfield ,panels)are same so i can't add the logic to any particular component.
    I have tried to solve this problem , but not getting any idea .Please help me to find out the solution. I hope i explained my problem clearly if not
    tell me i will explain it again.
    I have given here with the code in which i have created 100 jpanels , each jpanels consisting of 1label and 1text field but the instance variable for each component is same.
    Plese help me to solve this problem,Thanks in advance.
    import javax.swing.*;
    public class NestedPanels extends JFrame
      private static final int NO_OF_NESTED_PANELS = 100;
      public NestedPanels()
        super("Nested Panels");
        setSize(200, 200);
        JPanel mainPanel = new JPanel();
        mainPanel.setLayout(new BoxLayout(mainPanel, BoxLayout.Y_AXIS));
         for ( int i=1; i<=NO_OF_NESTED_PANELS; i++)
             mainPanel.add(createChildPanel(i));
         javax.swing.JScrollPane jScrollPane = new javax.swing.JScrollPane();
         jScrollPane.setViewportView(mainPanel);
        getContentPane().add(jScrollPane);
        setDefaultCloseOperation(EXIT_ON_CLOSE);
        setVisible(true);
      private JPanel createChildPanel(int intChildPanelNumber)
        JPanel childPanel = new JPanel();
        childPanel.setLayout(new BoxLayout(childPanel, BoxLayout.X_AXIS));
        childPanel.add(new JLabel("" + intChildPanelNumber));
        childPanel.add(new JTextField());
        return childPanel;
      public static void main(String[] argv)
        javax.swing.SwingUtilities.invokeLater(new Runnable()
          public void run()
            NestedPanels example = new NestedPanels();
    }Thanks & Regards
    Mahendra

    Hi to all forum members,
    Thanks for all your help.
    JayDS, as you have told i have tried with
    return Integer.valueOf( getText() ).compareTo( Integer.valueOf( mp.getText() ) );but it is giving
    java.lang .NumberFormatException.forInputString(unknown source)
    sorry i could not get what is SSCE?
    I am sending the code here with my requirement.
    My requirement is to sort the panels.
    i.e.
    when I will click on to the sortC1 button , the whole panels should be sorted according to the integer value inside the textfield1 (but here in my code it is sorting string wise,if u enter 1,2 ,1111111,3 ,222 the output should be 1,2,3, ,222 ,1111111 but it is actually giving the output as 1, 1111111,2,222,3 which is wrong )
    Arrays.sort(NestedPanelSorting); => this method is used for sorting
    return getText().compareTo(mp.getText());=> method is used for the text comparision in the example ( NestedPanelSorting.java)
    sortC2 also same.
    When I will click sortC3 ,the panel will be sorted according to the string values in the dropdown of combo boxes. Here how to access the instance of combobox to sort or the panel or through array of objects how can i sort?
    import java.awt.BorderLayout;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.util.Arrays;
    import javax.swing.*;
    public class NestedPanelSorting extends JFrame
        private static final int NO_OF_NESTED_PANELS = 10;
        private MyPanel[] NestedPanelSorting = new MyPanel[NO_OF_NESTED_PANELS];
        //MyPanel[] is a array of MyPanel objects declared below
         private JPanel mainPanel;
        private JScrollPane jScrollPane;
         public NestedPanelSorting()
            super("Nested Panels Sorting");
            setSize(400, 200);
            mainPanel = new JPanel();
            mainPanel.setLayout(new BoxLayout(mainPanel,BoxLayout.Y_AXIS));
            //in the for loop below MyPanel(i) is called through NestedPanelSorting[i]
              for (int i = 0; i < NestedPanelSorting.length; i++)
                NestedPanelSorting[i] = new MyPanel(i);
                mainPanel.add(NestedPanelSorting);
    jScrollPane = new javax.swing.JScrollPane();
    jScrollPane.setViewportView(mainPanel);
    getContentPane().add(jScrollPane, BorderLayout.CENTER);
    JButton myBtn1 = new JButton("sortC1");
              JButton myBtn2 = new JButton("sortC2");
              JButton myBtn3 = new JButton("sortC3");
    getContentPane().add(myBtn1, BorderLayout.EAST);
    getContentPane().add(myBtn2, BorderLayout.WEST);
    getContentPane().add(myBtn3, BorderLayout.SOUTH);
              myBtn1.addActionListener(new ActionListener()
    public void actionPerformed(ActionEvent arg0)
    myButtonAction(arg0);
    setDefaultCloseOperation(EXIT_ON_CLOSE);
    setVisible(true);
    private void myButtonAction(ActionEvent arg0)
              //this Array.sort() method is for sorting the array -
              // accordig to string value but i need to sort integer value wise
    Arrays.sort(NestedPanelSorting);
              mainPanel = new JPanel();
    mainPanel.setLayout(new BoxLayout(mainPanel,
    BoxLayout.Y_AXIS));
    for (int i = 0; i < NestedPanelSorting.length; i++)
    mainPanel.add(NestedPanelSorting[i]);
    jScrollPane.setViewportView(mainPanel);
         public static void main(String[] argv)
    javax.swing.SwingUtilities.invokeLater(new Runnable()
    public void run()
    new NestedPanelSorting();
    //declaring of MyPanel class where textfield1,txtField2,comboBox1 are added
         class MyPanel extends JPanel implements Comparable<MyPanel>
    private int number;
    private JTextField txtField1;
              private JTextField txtField2;
    private JComboBox comboBox1;
    public MyPanel(int number)
                   super();
    this.number = number;
    setLayout(new BoxLayout(this, BoxLayout.X_AXIS));
    add(new JLabel(String.valueOf(number)));
    txtField1 = new JTextField();
    add(txtField1);
                   txtField2 = new JTextField();
    add(txtField2);
                   comboBox1=new JComboBox();
                   comboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "ITEM  1 ", "ITEM  2 ", "ITEM  3 ", "ITEM  4 ","ITEM  5 " }));
                   add(comboBox1);
    public int getNumber()
    return number;
              public String getText()
                   if (txtField1.getText() == null)
    return "";
                   return txtField1.getText();
         public int compareTo(MyPanel mp)
              return getText().compareTo(mp.getText());
              //return Integer.valueOf( getText() ).compareTo( Integer.valueOf( mp.getText() ) );

  • Accessing object by dynamically creating it's id?

    Hi All,
    hopefully this is a quick one, I just can't figure it out:
    I'd like to be able to access objects by their id, but I want to be
    able to do it dynamically.
    For example:
    I have two objects, already instantiated, object_01 and
    object_02 and would like to do something like:
    while (var i:uint = 1; i<=2, i++) {
    myMovieClip.addChild("object_0" + i.toString());
    Can this be done and if so, how?
    Thanks!

    Further to my own research, I discover 'this' (pun intended)
    while (var i:uint = 1; i<=2, i++) {
    myMovieClip.addChild(this["object_0" + i.toString()]);
    (it works)

  • How many objects are created?

    I have this question which some one posted to me.
    He asked me how many objects are created when an object of a simple class is created for example
    class A{
    public static void main(String args[])
    A a1 = new A();
    Now how many objects are created? I think only one. Can anyone tell me if any other objects are also created.
    Plz tell me .

    No, the answer is indeed 1. All the other objects
    (including the String[] in the main method
    parameters) are created outside of the A
    class, either by the JVM itself or by some other
    class that calls the A.main() method. You can try
    this out for yourself by adding a constructor such as
    A()
    System.out.println("Creating class A");
    } and see what prints out.Take a closer look at the question:
    how many objects are created when an object of a
    simple class is created for exampleIt doesn't say "how many objects of type A are created".
    I.e. The VM has to load class A before you can create an object from it, and thus an object of type Class is created. There are also a bunch of other objects which needs to be created before you can instantiate A.
    Kaj

  • Assigning a 'dynamically created sequence' value to a variable

    in my procedure i am creating a sequence on the fly, i am preparing the name with some passed parameters like below
    v_seq_name := 'seq_'||loadid||v_table_name;
    execute immediate 'CREATE SEQUENCE '||v_seq_name||' MINVALUE 1 MAXVALUE 999999999999999999999999999 START WITH 1 increment by 1 cache 20';
    and now after doing some operations i need to assign the current value of sequence to a number variable i tried following but not working
    1) v_curr_value : = v_seq_name.currval ;
    2) select v_seq_name||'.nextval' into v_curr_value from dual;
    can you please suggest me how i can get the value in plsql block.

    DIVI wrote:
    in my procedure i am creating a sequence on the fly, i am preparing the name with some passed parameters like below
    v_seq_name := 'seq_'||loadid||v_table_name;
    execute immediate 'CREATE SEQUENCE '||v_seq_name||' MINVALUE 1 MAXVALUE 999999999999999999999999999 START WITH 1 increment by 1 cache 20';
    and now after doing some operations i need to assign the current value of sequence to a number variable i tried following but not working
    1) v_curr_value : = v_seq_name.currval ;
    2) select v_seq_name||'.nextval' into v_curr_value from dual;
    can you please suggest me how i can get the value in plsql block.Well, you haven't given the error you are getting but I guess the procedure isn't compiling? You need to execute immediate any reference to the sequence.
    Having said that, your architecture is probably wrong if you are dynamically creating things in a procedure.
    Why do you need to create them dynamically?

  • Dynamic loading in Java

    I was asked following in the interview-
    What things are dynamically loaded in Java?
    How can we change this behaviour so as to load things statically?
    Can anybody clarify this for me or give some reference URLs etc?
    Thanks in advance.

    I was asked following in the interview-
    What things are dynamically loaded in Java?
    How can we change this behaviour so as to load things
    statically?
    Can anybody clarify this for me or give some reference
    URLs etc?
    Sounds like an absurdly general question to me.
    For example shared libraries are loaded dynamically. And there is no way to do it statically unless one modifies the jvm.
    Or using Class.forName() loads a class dynamically. Statically one could create a null reference which would be a 'static' load. Of course that is a rather tentative definition because java is still going to load it when the method is reached rather than on start up.
    Or one could say that the core jvm is statically loaded, for example the system class loader, since it is implemented in C (but of course it actually exists in a shared library so it is loaded dynamically as well by the OS.) All other classes are loaded dynamically and again it requires changing the JVM to alter the behavior.

  • Dynamically created traverse image

    Hello,
    I was given the task of recreating this report that our software vendor hard-coded into our system.  In it there are simple floor plan images created dynamically from a traverse string, which may look like the following:
    BAS2003=N42E14S11E12 FOP2003= N11W12S11E12$ N11E23S45W21 FGR2003=S20E21N20W21$ N3W9N2W6 FOP2003=S4E6N4W6$ S2W13$.
    Explanation:
    BAS= Basement
    FOP= Front Open Porch
    FGR= Full Garage
    I'm not sure how much anyone knows about these building traverses, but the numbers represent a measurement of how long each wall is, the letter directly preceding each number is the direction (ie the basement has a wall 42 feet long, running "north" (or bottom-to-top in the graphic), which connects to a wall 14 feet long running east, etc)
    I already asked around and these images are NOT stored in our database, they are dynamically created based on the string.  They are simple images, with nothing more than accurately proportioned, colored polygons with their accompanying measurement labels.  These images DO appear in the reports that are hard-coded, so I'm assuming this CAN be done somehow. 
    Any help is appreciated.
    /holly

    Holly,
    Do you know if the original report was created in CR? Extracting the wall lengths shouldn't be too much a problem using formulas. The real problem is going to the the dynamic rendering of shapes. You have to bear in mind that CR doesn't have this ability.
    There is a Box object but you can't adjust the box's height with a formula (only the width can be adjusted this way).
    Odds are you are trying to replicate a report that is the result of some custom programming. If it was done in CR, I'd be very interested in seeing how it was done.
    Jason

  • How to create a java application & call it from a PDA via TELNET

    Dear All,
    My objective is to create a java application that's hosted on a server and called remotely from a PDA using TELNET.
    I've created a java application using Eclipse & the jCurses library. Unfortunately, the jCurses API events and listener aren't enough and i wasn't able to achieve my target application functionality.
    Can anyone advise a library other than jCurses that can help create a java application that can be called from a PDA via TELNET?
    Is AWT an option ?
    Thanks in advance for your support,
    Best regards,
    Lana

    user10827661 wrote:
    My objective is to create a java application that's hosted on a server and called remotely from a PDA using TELNET.
    I've created a java application using Eclipse & the jCurses library. Unfortunately, the jCurses API events and listener aren't enough and i wasn't able to achieve my target application functionality.
    Can anyone advise a library other than jCurses that can help create a java application that can be called from a PDA via TELNET?
    Is AWT an option ?Your server side Java application can use a Java library that
    creates a java.net.ServerSocket to listen for TCP connections from TELNET clients.
    You do not need any graphics (jCurses or AWT) on the server side, telnet is a simple ascii protocol.

  • How to dynamically create a JSF dataTable from a String[][] array

    Hi, I�m developing an application that uses columns, rows and data instead of any other attributes, so I got from a database Resultset a String[] array with the rows headers, other String[] array with the columns headers, and a String[][] array with the information between every row[] and column[] header al this String arrays depend on a method that receives the group title as a parameter so they are dynamically created, anyway I can display this information in a jsp page but I don�t know how to display this information in a JSF dataTable.
    Does anybody knows how I could do this? and which is the proper way to create a dynamically rows and columns dataTable?

    Hi, I�m developing an application that uses columns, rows and data instead of any other attributes, so I got from a database Resultset a String[] array with the rows headers, other String[] array with the columns headers, and a String[][] array with the information between every row[] and column[] header al this String arrays depend on a method that receives the group title as a parameter so they are dynamically created, anyway I can display this information in a jsp page but I don�t know how to display this information in a JSF dataTable.
    Does anybody knows how I could do this? and which is the proper way to create a dynamically rows and columns dataTable?

Maybe you are looking for

  • HELP PLEASE!!!! i'm locked out of my ipad completly!

    it says ipad is disabled connect to itunes. Its from to many pin attempts from because someone changed my pin please help!!!

  • Append or combine multiple IDOCs into a single IDOC file

    Hi All, We are implementing multiple new payment types that will generate IDOC files for us to send to the bank.  To keep the cost to the minimum, the requirement is to combine multiple IDOCs to a single file. I'd like to know the most efficient way

  • 1.5.6 library won't open now that I download the 2.0 trial

    I downloaded the 2.0 trial when it came out and put a few files in it to play around with. I left the 1.5.6 application on the computer since the 2.0 trial wouldn't allow me to use the 1.5.6 library. I would drag the 1.5.6 library onto the 1.5.6 appl

  • Adobe Flash Player not working since update

    Good Morning, I had a update yesterday and since then anything that uses Flash Player doesn't work, it stops sends a report to apple and thats it i've tried uninstalling the flash player and still nothing, I tried repairing the permissions in disk ut

  • Knowledge of any specific module in XI

    Hey guys do i need to know any modules of SAP to understand XI properly or not?also in interviews for SAP XI developer what kind of questions are asked. thanx ahmad