DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2004
    Posts
    11

    Urgent help needed, my jobdepends on this!!!!

    i need to add a combobox to a table cell, not just in one cell but in a whole column, i meani need a column of combo boxes, there are about 5 rows and 2 columns, the second column has to be a combo box,

    here is the code i used to create the table and put it in the panel
    but how do i go about it after that, would really aprreciate help please

    JComboBox comboBox = new JComboBox();
    JComboBox comboBox1 = new JComboBox();
    Component[] list = new Component[]{comboBox,comboBox1};

    comboBox.addItem("16LT");
    comboBox.addItem("1AM");
    comboBox.addItem("1DR");

    Object[][] data = new Object[][]{{StringResources.Systems[0],list[0]},{StringResources.FulfilmentSystems[1],list[1]}};
    dmta.setDataVector(data,StringResources.ContainerTableHeaders);

    dmta.setDataVector(data,StringResources.ContainerTableHeaders);

    jtab1 = new JTable(dmta);
    JScrollPane JScroll1 = new JScrollPane(jtab1);


    but this jsut puts the data in the first columnand inthe second column in each cell it says " JCombobox, invalid layout..."

    Please help need to finish this urgently
    ssary

  2. #2
    Join Date
    Mar 2004
    Posts
    635

  3. #3
    Join Date
    Nov 2004
    Location
    Norway
    Posts
    1,560
    You need to implement the TableCellRenderer. Check the link above, it will lead u straight to an example code.

    chill.
    eschew obfuscation

  4. #4
    Join Date
    Oct 2004
    Posts
    11
    thanks guys!!
    I am trying that right now!
    ssary

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links