-
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
-
-
You need to implement the TableCellRenderer. Check the link above, it will lead u straight to an example code.
chill.
eschew obfuscation
-
thanks guys!!
I am trying that right now!
ssary
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
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
|
Bookmarks