Adding element in a List box

How do we add an element to an existing List box in swings?

Read this section from the Swing tutorial on [url http://java.sun.com/docs/books/tutorial/uiswing/components/list.html]How to Use Lists.

Similar Messages

  • How to add more elements in the list box bean

    Hi,
    I have created a list box bean on a seeded page. I have an array of 573 elements.
    When I tried to add all those values in my list box, only 251 of those values got inserted in it.
    Please suggest me how can I insert all the 573 values in that list box.
    Regards,
    Gaurav.

    Thanks Gyan.
    Below is the code for creating list box :
    OAApplicationModule am = pageContext.getRootApplicationModule();
    OAViewObject listVO=(OAViewObject)am.findViewObject("LocationsLOVVO");
    OAWebBeanFactory list1 = pageContext.getWebBeanFactory();
    OADefaultListBean list = (OADefaultListBean)list1.createWebBean(pageContext, OAWebBeanConstants.DEFAULT_LIST_BEAN, null, "LocationsList");
    list.setListViewObjectDefinitionName("oracle.apps.irc.lov.server.LocationsLOVVO");
    list.setListValueAttribute("LocationCode");
    list.setListDisplayAttribute("LocationCode");
    list.setSize(6);
    list.setMultiple(true);
    list.setName("Location");
    OAMessageLayoutBean listboxbean = (OAMessageLayoutBean)webBean.findChildRecursive("AplmessageLayout");
    listboxbean.addIndexedChild(list);
    But it is not inserting all the location values in the list.
    Regards,
    Gaurav.

  • Adding data in a list box

    Hi all,
    I created a list-box on the selection-screen using
    PARAMETERS p_mtart type mtart AS LISTBOX VISIBLE LENGTH 20
    But, I don't find a way to add data to this list-box.
    Please help me.
    Regards,
    Saurabh Buksh.

    Hi,
    Sorry to bother you.
    I solved it.
    Regards,
    Saurabh Buksh.

  • How to add data into a List box

    CS3 SDk:Windows<br /><br />Hi all,<br />I am trying to add  data into a basic List box in CS3??<br /><br />// .fr<br />GenericPanelWidget<br />     (<br />     // CControlView properties<br />     kInvalidWidgetID, // widget ID<br />     kPMRsrcID_None, // PMRsrc ID<br />     kBindNone, // frame binding<br />     Frame(0,0,250,90) // left, top, right, bottom<br />     kTrue, // visible<br />     kTrue, // enabled<br />     // GroupPanelAttributes properties<br />     "", // header widget ID<br />     { <br />     <br />     WidgetListBoxWidgetN<br />     (<br />     kWFPListBoxWidgetID, kSysListBoxPMRsrcId, // WidgetId,RsrcId<br />     kBindAll, // Frame binding<br />     Frame(0,0,250,90) // Frame<br />     kTrue, kTrue, // Visible, Enabled<br />     1,0, // List dimensions<br />     19, // Cell height<br />     1, // Border width<br />     kFalse,kTrue, // Has scroll bar (h,v)<br />     kTrue, // Multiselection<br />     kTrue, // List items can be reordered<br />     kTrue, // Draggable to new/delete buttons<br />     kFalse, // Drag/Dropable to other windows<br />     kTrue, // An item always has to be selected<br />     kFalse,// Don't notify on reselect<br />     kFalse, <br />     {               <br />     }     <br />                    <br />),<br />},<br />),<br /><br />//-------ID.h--------<br />DECLARE_PMID(kWidgetIDSpace, kWFPListBoxWidgetID, kWFPPrefix + 2)<br /><br />//observer.cpp-----------WFPDialogObserver::Update<br /><br />//get currently selected/active widget <br />WidgetID theSelectedWidget = controlView->GetWidgetID();<br /><br />// ist it the text edit field? <br />if (theSelectedWidget == kWFPInsertButtonWidgetID && theChange == kTrueStateMessage) <br />{ <br /><br />IControlView* listBox = panelControlData->FindWidget(kWFPListBoxWidgetID);<br /><br />InterfacePtr<IListControlData> listControlData(listBox, UseDefaultIID()); <br /><br />//Insert the string into listbox <br />PMString strText = dialogCtrl->GetTextControlData(kWFPTextEditBoxWidgetID); <br /><br />// obviously there can't be a translation for text entered by user <br />strText.SetTranslatable(kFalse);<br />listControlData->Add(strText,kWFPTextEditBoxWidgetID); <br />dialogCtrl->SetTextControlData(kWFPTextEditBoxWidgetID, ""); <br />break;      <br /><br />I am not able to Add items into list box.<br /><br />I tried based on Discussion <br />http://www.adobeforums.com/webx/.3bc43877<br /><br />but not able to locate  SDKListBoxHelper file .it is not available in SDK.<br /><br />Please ,<br />Tell me Where I am going wrong.<br /><br />Thanks,<br />Adil

    resource VSPDialogWidget (kSDKDefDialogResourceID + index_enUS)
         __FILE__,
         __LINE__,
         kVSPDialogWidgetID, // WidgetID
         kPMRsrcID_None, // RsrcID
         kBindNone, // Binding
         Frame(5,0,491,266) // Frame (l,t,r,b)
         kTrue,
         kTrue, // Visible, Enabled
         kVSPDialogTitleKey, // Dialog name
              DefaultButtonWidget
                   kOKButtonWidgetID, // WidgetID
                   kSysButtonPMRsrcId, // RsrcID
                   kBindNone, // Binding
                   Frame(9,234,89,254) // Frame (l,t,r,b)
                   kTrue,
                   kTrue, // Visible, Enabled
                   kSDKDefOKButtonApplicationKey,  // Button text
              CancelButtonWidget
                   kCancelButton_WidgetID, // WidgetID
                   kSysButtonPMRsrcId, // RsrcID
                   kBindNone, // Binding
                   Frame(394,234,474,254) // Frame (l,t,r,b)
                   kTrue,
                   kTrue, // Visible, Enabled
                   kSDKDefCancelButtonApplicationKey, // Button name
                   kTrue,  // Change to Reset on option-click.
              WLBCmpListBox   //Tree view
                   kWLBCmpListBoxWidgetID, kPMRsrcID_None,     // WidgetId, RsrcId
                   kBindAll,                                                       // Frame binding
                   Frame(299,49,475,170)           // Frame
                   kTrue, kTrue,                                             // Visible, Enabled
                   kTrue,                               // EraseBeforeDraw
                   kInterfacePaletteFill,           // InterfaceColor
                   kHideRootNode | kDrawEndLine,     // Options. Display root node
                   kFalse,          // Use H Scroll bar
                   kTrue,          // Use V scroll bar
                   20,               // fVScrollButtonIncrement
                   20,               // fVThumbScrollIncrement
                   0,               // fHScrollButtonIncrement
                   0,               // fHThumbScrollIncrement
                   2,               // Items selectable, 0 = No Selection, 1 = Single Selection, 2 = Multiple Selection
                   kFalse,          // Allow children from multiple parents to be selected
                   kTrue,          // Allow discontiguous selection
                        //The tree view is dynamically created.          
    // added to support the list elements in the list box
    resource LocaleIndex (kWLBCmpListElementRsrcID)
         kViewRsrcType,
              kWildFS, k_Wild, kWLBCmpListElementRsrcID + index_enUS
    resource WLBCmpNodeWidget (kWLBCmpListElementRsrcID + index_enUS)
         __FILE__, __LINE__,
         kWLBCmpListParentWidgetId, kPMRsrcID_None,     // WidgetId, RsrcId
         kBindLeft | kBindRight,               // Frame binding
         Frame(0, 0, 194, 20),               // Frame
         kTrue, kTrue,                         // Visible, Enabled
         "",                                        // Panel name
                   // Just a info-static text widget with about-box text view to get white bg.
              WLBCmpTextWidget
                   kWLBCmpTextWidgetID, kPMRsrcID_None,          // WidgetId, RsrcId
                   kBindLeft | kBindRight,                                        // Frame binding
                   Frame(45,1,194,18)                                             // Frame
                   kTrue, kTrue, kAlignLeft,kEllipsizeEnd                    // Visible, Enabled, Ellipsize style
                   "",                                                                 // Initial text
                   0,                                                                 // Associated widget for focus
                   kPaletteWindowSystemScriptFontId,                         // default font
                   kPaletteWindowSystemScriptHiliteFontId,                    // for highlight state.
    If you still got problems, post you email here - I'll send you the complete project/code then.
    -Marc

  • Dynamic retrieval in list boxes using JSP

    Dear All,
    I have a list box in a form which is created by extracting data from oracle database. There are approximately 26000 records which are added dynamically in the list box. There are five rows in the form and each row has to have a list box with all records. Now if i retrieve all records for all list boxes, the page takes high time to load. I also tried using String array to read once and write them using loops in list box. But even then the loading time is quiet high. Is there some better way so that the page loads fast enough. I am using Oracle Database and the table is indexed.
    Thanks & Regards,
    Gagan Arora

    Well, it's big enough to make any page slow... but you can try to load all the list boxes in the client side with javascript.
    i make that usually, create a javascript strings array and on the "onLoad" event fill all the list boxes with the values in that array.
    but anyway is too much data.

  • Cannot display Thai. character in List box elements

    Hi all,
    I have set the Fonts to Ms San Serif to all items in a form, all items seems can display Thai. character correctly. For List box, it can display Thai also, but the elements in the selections cannot.
    Does any expert know how to fix this ?
    Thanks!

    Hi Kinghow,
    Thanks for your reply!
    The problem still can't solve after set the auto csv code select "Yes". The excel file still can't display Thai character.
    Am i using a correct way to generate excel file? Do you have any suggestion to export data to excel using pl/sql?
    If i removed below part, then the excel file working well.
    htp.tableOpen(cattributes=>'border="1",bordercolor="BLACK",align="CENTER"');
    for x in (select srd_line_prop,srd_line_dtl from schd_rptd where srd_queue_no=:P401031_QUEUE_NO and srd_line_prop='H' order by srd_queue_no,srd_line_no)
    loop
    htp.tablerowopen(cattributes => 'bgcolor="#81F7F3"');
    for i in 1..pkg_wwe.split_count(x.srd_line_dtl,'|') loop
    if i = 1 then
    htp.p('<TD nowrap align="center" width="70px" > <font size="2" face="arial" color="#088A08">');
    htp.p(pkg_wwe.split(x.srd_line_dtl,'|',i));htp.p(' ');htp.p(' ');
    htp.p('</TD>');
    else
    htp.p('<TD nowrap align="center" width="70px" > <font size="2" face="arial" color="#08088A">');
    htp.p(pkg_wwe.split(x.srd_line_dtl,'|',i));htp.p(' ');htp.p(' ');
    htp.p('</TD>');
    end if;
    end loop;
    htp.tableRowClose;
    end loop;
    htp.tableClose;
    I really do not have any idea on how to solve this problem. Is really strange on this problem.

  • How to save only newly added elements from the trailing list

    Dear,
    I have a shuttle bean with left and right trailing lists.
    At some point I save the right trailing list content to DB. Then I add additinal elements to the trailing list. Trying to save again gives me oracle.jbo.TooManyObjectsException: JBO-25013: Too many objects match the primary key oracle.jbo.Key
    exception.
    What is the approach I can take to only save newly added elements from the shuttle?
    I am wondering if I can put the extra logic (what logic would that be - do I need to check the PK value that is already in the database?) in the AM method with which I save the shuttle like here (TicketID and ResponsibilityID are primary key)
    if (items != null)
    Object ia[] = items.toArray();
    for(int i=1; i<ia.length; i++)
    Row rowApproval = vo.createRow();
    vo.insertRow(rowApproval);
    rowApproval.setNewRowState(Row.STATUS_INITIALIZED);
    Row row = vo.getCurrentRow();
    row.setAttribute("TicketId",items.get(0));
    row.setAttribute("ResponsibilityId",items.get(i) );
    row.setAttribute("Status",items.get(i));
    or should I do something in the EO?
    Thank you
    Anatoliy

    Hi,
    Can you please clarify - do I have to make a loop? I mean for every record/element in the trailing list
    I run the VO (that I will create) VO.executeQuery?Yes you do need to execute the VO for every record....by passing the different parameter in each iteration.
    Regards,
    Gyan

  • Handling List box element in JSP

    Hi,
    I have a List box which gets populated on the client side, depending on the user's activity on a form, when i finally submit the form, i want the list box with all the values to go to the server, Can anyone help me with the code on the server-side (JSP Scriplet) about how i can do this?
    Thanks
    Varadaraj

    Assuming that by list box, you mean an HTML element using <select ...> tag,...
    Only the currently selected values get submitted to the server. If thatis where you got kind of stuck.

  • Adding list box

    I have not done dailog programing much. Can some one tell me how to get values in the list box. I need to add some 10 values in my list box. Please help.

    Hi Arshad,
    1. For Dialog programming
    2.
    MODULE pai_1000.
    PROCESS ON VALUE-REQUEST.
    field mylistab module abc.
    Where
    field = fieldname on screen
    abc = module name (see code below)
    3.
    *&  Include           ZAMMOD03_F01                                     *
    *&      Module  abc  INPUT
          text
    MODULE abc INPUT.
      DATA : BEGIN OF itab OCCURS 0,
             bukrs LIKE t001-bukrs,
             butxt LIKE t001-butxt,
             END OF itab.
      SELECT * FROM t001 INTO CORRESPONDING FIELDS OF TABLE itab.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          retfield        = 'BUKRS'
          value_org       = 'S'
          dynprofield     = 'MYLISTTAB'
          dynpprog        = sy-repid
          dynpnr          = sy-dynnr
        TABLES
          value_tab       = itab
        EXCEPTIONS
          parameter_error = 1
          no_values_found = 2
          OTHERS          = 3.
    ENDMODULE.                 " abc  INPUT
    regards,
    amit m.

  • How to get the selected value/key of a drop down list box in webdynpro Java

    Dear SDN Members,
    I have added some static data into a drop down list box by key UI element using the procedure specified in value help tutorial.
    Now i want to display the value selected in a dropdown list box on view whenever i select an item in a dropdown list box.
    Can any one put here the code part relating to this.
    Your help will be awarded.
    Thanks in advance,
    Regards,
    Sireesha.B

    Hi Sireesha,
        You want to display value based on the key selected in dropdown list. If you want to do like that
    1) Create a context attribute for ex: key_value
    2)In the properties of the attribute select the calculated as true.
    3)It will create getter and setter methods for your attribute.
    4)Go to implementation add the following code in getter method of your attribute
    String attributeName = IPrivateCreate.IContextElement.KEY;
    //KEY is your dropdown key attribute not the value attribute.
    IWDAttributeInfo attributeInfo = element.node().getNodeInfo().getAttribute(attributeName);
    ISimpleTypeModifiable simpleType = attributeInfo.getModifiableSimpleType();
    IModifiableSimpleValueSet valueset = simpleType.getSVServices().getModifiableSimpleValueSet();
    Object key = element.getAttributeAsText(attributeName);
    return valueset.getText(key);
    Regards
    Suresh

  • How to add a list box with values for a ztable in SM30

    Hello Gurus,
                    I had created a table maintenance for Ztable and added many extra functionality to that. Now i would like to add a list box or check table for a field. Can i do that with out Regenerating my table maintenance. Please help me its..very urgent.

    Have referred this domain to the data element, this should be the Field type in ur table for the particular field.
    Eg: <b>SE11 > table name > fields-ZTEST > fieldtype-ZZTEST</b>
    ZZTEST in the data element > create a domain for this data element and in that specify teh value range.
    Save and activate it.
    Make sure that u regenerate teh table maintenance generator else u cant see the changes.
    Now if u press F4 u can see only thevalues specified, also u will see only the list box with values in SM30.
    Try this,please let me know if u face any difficulties.

  • How do you add a multiple entries at once to a drop-down list box?

    I'm making a form for students to fill out and I want them to be able to pick from about 200 different courses. In the Field/List Items place, it would appear that you can only enter one item one at a time. I did this for 56 faculty,which took too much time, but for over 200 course titles, it would be much more convenient just to copy/paste them from an Excel spreadsheet, which is what I've tried doing. Any help or tips would be appreciated. I've attached a PDF of what I'm working on. The drop-down box is the one next to "Course." Thanks.

    Hi,
    The next version of LiveCycle Designer ES2 will allow user to copy and paste a long list of items into a dropdown or list box at design time. But until then your choices are limited.
    Paste them one at a time;
    You could set up a global variable in the (File/Form Properties) with the 200 items in the one variable. Then it would depend if your users have Acrobat/Reader v9 or earlier versions of Acrobat/Reader. John Brinkman has (several) blogs on this topic: http://blogs.adobe.com/formfeed/2009/01/populating_list_boxes.html
    If you are going with v9 then you can use the setItem script. However if you want your form to be compatible with earlier versions then you will need the addItem script.
    Also check out a sample by Steve Walker. http://forums.adobe.com/message/1939873#1939873 and  http://forums.adobe.com/message/2038932#2038932  The first one dealt with adding user entered data onto a dropdown, which is not exactly what you are after, but it will give you direction in populating a dropdown from an array.
    You would place the script in the docReady event of the dropdown, which would populate the dropdown every time the form is opened.
    Good luck,
    Niall

  • What is the data type of the value returned by the List box prompt in crystal

    Post Author: Mudit Kothiyal
    CA Forum: Formula
    Hi all,
    I am creating a report which has a list box prompt. When I am selecting a single value from the list box the report is working fine, but when I am selecting multiple values its not returning any data( although data is there). Does anyone know how the prompt values are passed to the report query by the crystal. I kno it passes the value to the report as an array. But how does it pass the value to the report query.
    I am using command query to fetch data from the DB.
    Crystal Report Version: Crystal Report XI R2.
    DB: Oracle 10g
    Also does anyone know how to pass the values of the list box prompt to the report query in comma seperated format.
    Thanks & regards,
    Mudit

    Post Author: rcoleman
    CA Forum: Formula
    In regards to the latter part of your question
    The following examples are applicable to Basic and Crystal syntax.
    The examples assume that list is a String array consisting of the 3 elements: "Chocolate", "Vanilla" and "Strawberry".
    Join (list)
    Returns the String "Chocolate Vanilla Strawberry".
    Join (list, "***")
    Returns the String "Chocolate**Vanilla**Strawberry".
    Not sure about the first part of your question,sorry.

  • How to populate values in List Box in Adobe form

    Hi,
    How to populate values in List box in adobe forms?
    Thanks
    RB

    if you want to display a fixed values in the dropdown you can use list box ui and can specify values there
    or if u want to display values from the context node of the webdynpro
    1. Drag and drop a Value Help Drop-down List element from the Web Dynpro Library tab to the Body Pages pane.
    2. Drag and drop your node from the Data View tab onto it. This action binds the layout element to the corresponding node.
    with regards
    shanto aloor

  • Help needed in removing duplicate items of list box  in java

    How to remove duplicate items of list box while dynamically inserting (on-click event)
    It is not identifying duplicate data
    Variable name is HP_G1
    HP_dmg1 = (DefaultListModel) HP_G1.getModel();
    int a = HP_G1.getModel().getSize();
    System.out.println("HP list no--------> "+a);
    if(a!=0)
    for (int j=0; j<a; j++)
    String item1 = String.valueOf(HP_List.getModel().getElementAt(j));
    System.out.println("HP list added--------> "+item1);
    if(HP_dmg1.equals(item1)){
    HP_dmg1.remove(j);
    else
    HP_dmg1.addElement(GPL);
    }

    Your code is unreadable, so I'll ignore it. In the future please press the message editor's CODE button to format code.
    As to your problem, to the point you normally use a Set instead of List when you don't want duplicates in a collection.

Maybe you are looking for

  • How to display a Sum field for a formula column?

    Hi, I need to display a sum for a formula column at the end of report. for example: my formu_col=col_1-col_2 col_1 col_2 formu_col 3 1 2 6 5 1 total:sum(col_1) sum(col_2) sum(formu_col) now i have sum(col_1) and sum(col_2), but i don't have sum(formu

  • I Transcoded Movie Daredevil to Ipod With no problem

    I Transcoded Movie Daredevil to Ipod With no problem.It plays back wonderfully,,the sound is blazing!!I used DVD Dycrypter,than I used Videora iPod converter..I had no problems at all it was ver simple..and trust me I make everything complicating.:)h

  • BPM error: interface are not same

    Hi, In my BPM I opened a Asy/syn bridge. When I close it I get the error: A interface and B interface are not the same. A is the interface (synch) which I used on the sender side when I opened the bridge. B is the aynch. abs. interface for the receiv

  • CCD via SAF with Third-Party PBXs

    Hey Guys, Im looking into CCD via SAF for a IP Tel Deployment, multiple sites and distributed etc. However they have a couple of sites that recently migrate to the Avaya System. They would like to keep this system for the time being and integrate the

  • How can I sign out of my apple I'd

    Please help! How do I sign out of my appleid!?!!?