How to add Component in JList

Hello guys,
I want to add a components that is for eg (checkBox,CompoBox) in JList
Pls help me
Thanks in advance
aneesh

I want to add a components that is for eg
(checkBox,CompoBox) in JList Uhm, maybe you should redesign your GUI. I can understand adding that stuff to a JTable, but a JList with combo boxes makes me sick. It's like having a button with radiobuttons on it...

Similar Messages

  • How to add component dynamically to datatable row?

    Hi,
    I have a dropdown in one column of table.Depending upon selected value in that dropdown, I want to add some components dynamically only in that row.How to do this?
    I have seen that findComponent() method doesnt accept clientId.Is there any other way to use clientId to search components. Because clientIds contain row numbers.
    Thanks in advance,
    Chitra.

    Bind the component to the bean using its 'binding' attribute. Then use it instead.

  • How to add icon to JList(urgent)

    Hi guys,
    wanted to make a jlist which will have icon & string in it. How can I add the icon to it. also does icon file extension must be .gif ?
    Thanks & Kind Regards

    You are in luck. The API documentation for JList contains an example of precisely that. Take a deep breath, relax, and read it. (Icons must be GIF or JPEG.)

  • How to add component to production order like co08

    Hi experts,
         i used FM CO_BC_INSERT_CMP_OF_ORDERS ,code as follows:
    TCOKT_IMP-AUTYP = '10'.
    TCOKT_IMP-MANDT = SY-MANDT.
    RESBB_INS-MANDT = SY-MANDT.
    RESBB_INS-MATNR = 'NTQA3070'.
    RESBB_INS-POSTP = 'L'.
    RESBB_INS-VORNR = '0010'.
    RESBB_INS-AUFNR = ORDER_NUMBER.
    RESBB_INS-POSNR = '0010'.
    RESBB_INS-BDMNG = 19.
    RESBB_INS-RGEKZ = 'X'.
    RESBB_INS-WERKS = '1110'.
    *RESBB_INS-LGORT = HEADER-PRODUCTION_SCHEDULER.
    *RESBB_INS-RSNUM = HEADER-RESERVATION_NUMBER.
    RESBB_INS-RSPOS = '0010'.
    APPEND RESBB_INS.
    CALL FUNCTION 'CO_BC_INSERT_CMP_OF_ORDERS'
    EXPORTING
    FLG_CALC_CHK            = 'X'
      INS_MODE                = ' '
       NO_RSPOS_COUNT          = 'X'
       TCOKT_IMP               = TCOKT_IMP
       FLG_BANF_CREATE         = 'X'
      I_FLG_COPY_LTEXT        = 'X'
      TABLES
        RESBB_INS               = RESBB_INS
    EXCEPTIONS
       NO_AMOUNT               = 1
       NO_BWVAR                = 2
       NO_KLVAR                = 3
       NO_VALUE                = 4
       RELEASE_NO_CHANGE       = 5
       SYSTEM_ERROR            = 6
       OTHERS                  = 7
    but i still can't add the component to an exist production order.i think maybe i missed some important parameters,I need your help .Thanks a lot.

    I'm not sure what you are trying to do.
    Would you like to overlay the two components and display only one at a time? If so then just put them both in a Canvas at the same position and change their "visible" properties as necessary.
    You should be able to do this in MXML, except for the switching part, which will likely be in AS.
    If this post answers your question or helps, please mark it as such.
    Greg Lafrance - Flex 2 and 3 ACE certified
    www.ChikaraDev.com
    Flex / AIR Development, Training, and Support Services

  • How to add component to JPanel

    Hello,
    I Try to add a JPnel to other JPnel
    but it works not ther is a error in this code ??
    class MyClass extends JFrame
        Container contentPane;
      public MyClass()
                  contentPane = this.getContentPane();
                  contentPane.setBorderLayout(new BorderLayout());
                 MainPanel();
    puplic void MainPanel()
         Dimension dim = new Dimension(w,h);
         Dimension aDim = new Dimension((w / 2),(h / 2));
         JPanel mainPanel = JPanel();
         mainPanel.setPrefferedSize(dim);
         mainPanel.setLayout(new BorderLayout());
         JPanel pp = getLanguagePanel(aDim);
         pp.revalidate();
         mainPanel.add(pp,BorderLayout.PAGE_END);
         mainPanel.revalidate();
         contentPane.add(mainPanel,BoderLayout.CENTER)
    public JPanel getLanguagePanel(Dimension aDim)
             JPanel retPanel = new JPanel();
         retPanel.setPreferredSize(aDim);
         retPanel.setBorder(null);
         JLabel L = new JLabel("Test Label");
         L.setBounds(50,50,250,30);
         retPanel.add(L);
         retPanel.setBackground(Color.GREEN);
         retPanel.setOpaque(true);
         retPanel.revalidate();
         retPanel.repaint();
         return retPanel;
    }thanks

    contentPane.setBorderLayout(...)There is no such method. Your compiler should be telling you this.
    puplic void MainPanel()There is no such modifier. Your compiler should be telling you this.
    mainPanel.setPrefferedSize(...)There is no such method. Your compiler should be telling you this.
    BoderLayout.CENTERThere is no such class. Your compiler should be telling your this.

  • How to add a text Component ( text annotation) to the Tiff Image

    Hi.............
    This is the first time I am using Sun Developers Forum.......................
    My problem is.............I want to add a component ( Text or Label ) to the Tiff Image which is displayed on the JIMICanavs [ from JIMI API ].
    Even , if anybody knows about How to add a component to the JIMICanavs , Please help me..................................

    I'm curious: is JIMI still popular? What advantange does it have over the current Java 2D support in the J2SE, or over JAI?

  • How to add a new url link in a view of an existing webdynpro component?

    How to add a new url link in a view of an existing webdynpro component?

    hi ,
    refer SAP online hep :
    Implementing Enhancements in a View
    http://help.sap.com/erp2005_ehp_04/helpdata/EN/46/233f2189f74f08e10000000a114a6b/frameset.htm
    To enhance the layout of the view, you can create new UI elements. This procedure is no different u2013 from a technical viewpoint u2013 from creating UI elements in components themselves. All UI elements created within the enhancement implementation can then be processed as usual.
    Enhancements  means inserting user developments into SAP development objects at predefined positions.
    The Enhancement Framework enables you to add functionality to standard SAP software without actually changing the original repository objects, and to organize these enhancements as effectively as possible.
    refernce :
    have a look at this article
    How to Create Enhancement Implementation in Web Dynpro ABAP
    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/700317da-bd79-2c10-368e-8f18bf5d8b81&overridelayout=true
    as pointed correctly by Saurav in earlier thread
    regards,
    amit

  • How to add contents of an arrayList to a JList

    Hi,
    I am trying to figure out how to add the contents of an arraylist to a Jlist.
    Basically I have 3 classes which are as follow:
    1. AuctionItems(String name, int bid) which represents an item in auction
    2. AuctionItemsFactory which creates AuctionItems and adds them to an arraylist called stock
    3. AuctionBidsGui1 which is the interface where the user can see the items in the auction and select them from a JList.
    But I dont know how to read the contents of the stock(arraylist) into the JList which is in AuctionBidsGui1. Below are the 3 classes mentioned above
    public class AuctionItems {
         String name;
         int bid;
         public AuctionItems(){
              name = null;
              bid = 0;
         public AuctionItems(String name, int bid){
              this.name = name;
              this.bid = bid;
         public String getName(){
              return name;
         public int getBid() {
              return bid;
    public class AuctionItemsFactory {
         private ArrayList<AuctionItems> stock;
         int size;
         public AuctionItemsFactory() {
              stock = new ArrayList<AuctionItems>();
         public void addItems(AuctionItems item) {
              stock.add(item);
    //removes last element of the arrayList
         public void removeItems() {
              int n = stock.size() - 1;
              stock.remove(n);
         public void printNumOfItems() {
              int n = stock.size();
              System.out.println(n);
         public int numberOfItems(){
              return stock.size();
         public void printItems(){
              for (AuctionItems item : stock) System.out.println(item);
    and this one is a small part of the AuctionBidsGui1 class which represents the JList where the list of the items will go.
    public void addItemListWidgets() {
              itemsList = new JList();
              itemsList.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
              itemsList.setLayoutOrientation(JList.VERTICAL);
              itemsList.setVisibleRowCount(10);
              itemsList.setSelectedIndex(0);
              JScrollPane itemsListScroller = new JScrollPane(itemsList); // put the list in the scroller
              itemsListScroller.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
              itemsListScroller.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
              itemsListPanel.add(itemsListScroller);
         }

    I know that I have to use the toArray() but i dont know what type of method to use for this because i will need to implement a method in my AuctionItemsFactory class which will copy the contents of the arraylist into an array so then i can call this methos from my AuctionBidGui1 class.
    I would appreciate if you could give me a bit more hints.

  • How to add adf faces in component pallete of jdeveloper 11g?

    how to add adf faces in component pallete of jdeveloper 11g?

    Hi,
    the replacement of ADF Faces HTML components in JDeveloper 11 is Trinidad. For existing applications, a migration path will be provided in JDeveloper 11 production. I wouldn't recommend configuring ADF Faces in JDeveloper 11.
    You an configure ADF Faces Components in JDeveloper 11 by :
    - Tools --> Manage Libraries
    - Create a User Library
    - select ADF Faces adf-faces-impl.jar
    - Enure the namespace is not af or afh but something different to not cnflic with teh ADF Faces RC components
    Note that adding the ADF Faces components to the component palette will not make them show in the ADF binding context menu nor will it automaticaly set up the web.xml file. The components are available as any other JSF library set
    Again, I wouldn't go this way ;-)
    Frank

  • How to add interface to customlize MXML Component when use Flex Builder 3?

    How to add interface to customlize MXML Component when use
    Flex Builder 3?

    David,
    I don't believe you can add the interface via the creation
    dialog in FlexBuilder 3. You can always manually add the
    "implements" property to your MXML Component root tag. Something
    like this: <mx:VBox implements="com.mycorp.IMyInterface">
    If you want autogeneration of the interface, then create an
    ActionScript class with that interface and then copy the generated
    functions and setter/getters into the script block of your MXML
    component.

  • How can add some suggested value to a propert on a Declarative Component,

    how can add some suggested value to a propert on a Declarative Component?

    kenyatta,
    Where you want to add the value ?
    If you want put some UIComponent(Value) to your declarative Component than follow my blog ( http://jneelmani.blogspot.com/2009/02/11g-how-to-create-declarative-component.html ) and add your value in STEP-5.
    You can watch live-demo at http://www.oracle.com/technology/products/jdev/viewlets/viewlet.html
    --Neelmani Jaiswal
    Edited by: Neelmani Jaiswal on Mar 23, 2009 11:11 AM

  • How to add avatars to people listbox  component?

    Hi,
    I want to know how to add avatars to people list box ,
    please give me suggestions how to do this.
    I need this very urgently.
    Thanks in advance for all the help.
    regards
    Avanthika.

    Hi all,
      I have a similar problem but I think with the same root cause:
    !ENTRY com.sap.ip.bi.zen 4 0 2015-01-08 10:58:45.930
    !MESSAGE Error message: Object doesn't support this action Line Number: 10 Pos: 3 Function: function() { var mapOptions
       Before that everything was working fine, I had the same error but given that everything was working fine I was ignoring it:
    Jan 08, 2015 12:37:45 PM com.sap.ui5.resource.impl.osgi.OSGiResourceLocator determineCacheBusterId
    INFO: com.sap.ui5.vbm: 201408061443
    Jan 08, 2015 12:37:45 PM com.sap.ui5.resource.impl.osgi.OSGiResourceLocator determineCacheBusterId
    INFO: com.sap.ip.bi.zen.rt.components.crosstab.phx-testresources: 201412101410
    Jan 08, 2015 12:37:45 PM com.sap.ui5.resource.impl.osgi.OSGiResourceLocator determineCacheBusterId
    INFO: com.sap.ui5.themelib_sap_goldreflection: 201408121740
    Jan 08, 2015 12:37:45 PM com.sap.ui5.resource.impl.osgi.OSGiResourceLocator determineCacheBusterId
    INFO: com.sap.ui5.table: 201408121740
      I'm following now what Mark said, save and restart the application, which is fine.
      Has somebody found the root cause?
    Kind Regards,
    Javier

  • How to enter values in JList box and JTable ???

    Hi friends...
    i am new to Swing
    SInce i am using Netbeans IDE 5.5
    and there is easy to do swing programming using this IDE
    now i am confused using JTable and JList box
    since i used method Insert in AWT
    but how to add values in LIST BOX ( JList )
    ex.
    JList list = new JList( );
    list.add(mystringvalue, ? );
    here it ask for component so what should i write here..
    when i write here this, gives error.
    what to do to insert string or vector or object in JList
    and to enter value in JTable
    THanks

    hi Ghanshyam,
    i am also new to swing i was just wondering are you using the swing palette to create your interface
    by the look of the code
    JList list = new JList( );
    list.add(mystringvalue, ? );you may not be because every JList is put in a JScrollPane
    but if you do want to do it through the palette there is an option in properties - model which you can uses to add in values.
    and if your looking to get info. from a database look up
    AbstractListModel &
    AbstractTableModel
    the is a lot of info on the internet (example net beans CarTableModel) is a
    good start off
    happy hunting.
    JJ

  • How to add lines in combobox?

    I want to add very thick colored lines in this combobox so ..
    how do i do that..
    thanks
    public class NewJFrame extends javax.swing.JFrame {
        /** Creates new form NewJFrame */
        public NewJFrame() {
            initComponents();      
        // <editor-fold defaultstate="collapsed" desc=" Generated Code ">
        private void initComponents() {
            jComboBox1 = new javax.swing.JComboBox();
            setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
            getContentPane().add(jComboBox1, java.awt.BorderLayout.NORTH);
            pack();
        // </editor-fold>
        public static void main(String args[]) {
            java.awt.EventQueue.invokeLater(new Runnable() {
                public void run() {
                    new NewJFrame().setVisible(true);
        // Variables declaration - do not modify
        private javax.swing.JComboBox jComboBox1;
        // End of variables declaration
    }

    I am exaplaining the code here.Please check once again.
    import java.awt.Component;
    import java.awt.FlowLayout;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.awt.event.WindowAdapter;
    import java.awt.event.WindowEvent;
    import java.util.Vector;
    import javax.swing.JComboBox;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JList;
    import javax.swing.JSeparator;
    import javax.swing.ListCellRenderer;
    import javax.swing.UIManager;
    import javax.swing.border.EmptyBorder;
    * @version 1.0 12/25/98
    public class BlockComboBoxExample extends JFrame {
      final String SEPARATOR = "SEPARATOR";
      public BlockComboBoxExample() {
        super("Block ComboBox Example");
        String[][] str = { { "A", "B", "C" }, { "1", "2", "3" },
            { "abc", "def", "ghi" } };
        JComboBox combo = new JComboBox(makeVectorData(str));
        combo.setRenderer(new ComboBoxRenderer());
        combo.addActionListener(new BlockComboListener(combo));
        getContentPane().setLayout(new FlowLayout());
        getContentPane().add(combo);
        setSize(300, 100);
        setVisible(true);
    /*This method makes a vector of data to be added to the combo box by iterating through the String array and after each element of array,the needSeparator is made true indicating a separator must be added*/
    private Vector makeVectorData(String[][] str) {
        boolean needSeparator = false;
        Vector data = new Vector();
        for (int i = 0; i < str.length; i++) {
          if (needSeparator) {
            data.addElement(SEPARATOR);
          for (int j = 0; j < str.length; j++) {
    data.addElement(str[i][j]);
    needSeparator = true;
    return data;
    public static void main(String args[]) {
    try {
    UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
    } catch (Exception evt) {}
    BlockComboBoxExample frame = new BlockComboBoxExample();
    frame.addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent e) {
    System.exit(0);
    /*This class is used to render the elements in ComboBox.When adding elements it checks for Separator,and if it is SEPARATOR then it returns a JSeparator object,causing a separator to be added in combo box.*/
    class ComboBoxRenderer extends JLabel implements ListCellRenderer {
    JSeparator separator;
    public ComboBoxRenderer() {
    setOpaque(true);
    setBorder(new EmptyBorder(1, 1, 1, 1));
    separator = new JSeparator(JSeparator.HORIZONTAL);
    public Component getListCellRendererComponent(JList list, Object value,
    int index, boolean isSelected, boolean cellHasFocus) {
    String str = (value == null) ? "" : value.toString();
    if (SEPARATOR.equals(str)) {
    return separator;
    if (isSelected) {
    setBackground(list.getSelectionBackground());
    setForeground(list.getSelectionForeground());
    } else {
    setBackground(list.getBackground());
    setForeground(list.getForeground());
    setFont(list.getFont());
    setText(str);
    return this;
    class BlockComboListener implements ActionListener {
    JComboBox combo;
    Object currentItem;
    BlockComboListener(JComboBox combo) {
    this.combo = combo;
    combo.setSelectedIndex(0);
    currentItem = combo.getSelectedItem();
    public void actionPerformed(ActionEvent e) {
    String tempItem = (String) combo.getSelectedItem();
    if (SEPARATOR.equals(tempItem)) {
    combo.setSelectedItem(currentItem);
    } else {
    currentItem = tempItem;
    Now you can use the same concept to add separator to ur combobox.

  • How to add selected values from table(selected using checkbox)to table?

    Hi All,
    i have created simple page with search panel with table in table i have created one column as check box for selecting.
    here what my requirement is i need to do search multiple times to add some roles to from some different categories.here whenever i searched i ll get some roles into table there i ll select some role and i ll click add buttion. whenever i click add i need to add those roles into some other table finally i ll submit added roles.
    here i followed one link http://www.oracle.com/technetwork/developer-tools/adf/learnmore/99-checkbox-for-delete-in-table-1539659.pdf
    i used same code and able to see selected row in console, as object array how to add these into table.
    please help me out
    Thanks in advance
    siva shankar

    Thank you for a quick reply
    i used the same thing before i go for table check box concept.here what i observed is when i search i am getting some results i am able to shuttle.but if i search again the shuttle is refreshing with new values even not available list its refreshing selected list. IF dont want refresh selected ones.
    my usecase after make some searches I will select some roles from different categories at finally i ll submit.
    i hope you understand me requirement. please suggest me is this requirement is possible in shuttle component? if yes please guide me.
    thanks
    Siva Sankar

Maybe you are looking for

  • Some app don´t run

    some app don´t run suddenly, any idea?

  • G3 and G4 12.1' screens compatible?

    Can you put a display from a g3 ibook on a g4 ibook if they are both the 12.1' size?

  • Storeproc error help...any help appreciated...

    Error Executing Database Query. [Macromedia][Oracle JDBC Driver]Internal error: Net8 protocol error. The error occurred in C:\Inetpub\wwwroot\Denemeler\Kara_tahta\RMS\NewHire.cfm: line 16 14 :     15 :     <cfprocresult 16 :     name="NewHire" result

  • Hi , PROTECT..........ENDPROTECT is not working

    Hi , Can we use the protect.....endprotect command across the many elements . My Line Item is shown in two rows like this . Material      qty     unit    price description mat1         1            ea      10     text1 ........       ..          ... 

  • IPhoto 9.4.2 menus disabled (OSX 10.8.2)

    Ignore - apparently I've had too much Holiday cheer! The issue was that I have a monitor connected to my laptop. That monitor was turned off, but guess where iPhoto was displaying? Yup Now don't I feel silly... I just upgraded to OS X 10.8.2 on my Ma