Results 1 to 4 of 4

Thread: AbstractObjectTable

  1. #1
    Join Date
    Jun 2006
    Posts
    27

    Default AbstractObjectTable

    hi all i have an object derived from abstractObjectTable, when executed the data appears but NO HEADER APPEARS !!

    any tip?

    Code:
    package com.isthari.management.table.invoicer;
    
    import javax.swing.JTable;
    import javax.swing.table.TableColumnModel;
    
    import org.springframework.richclient.table.support.AbstractObjectTable;
    
    import com.isthari.base.richclient.control.LabelControl;
    import com.isthari.management.dao.invoicer.CustomerDao;
    
    public class CustomerTable extends AbstractObjectTable implements LabelControl {
    
    	private CustomerDao customerDao;
    
    
    	public CustomerDao getCustomerDao() {
    		return customerDao;
    	}
    
    	public void setCustomerDao(CustomerDao customerDao) {
    		this.customerDao = customerDao;
    	}
    
    	public CustomerTable (){
    		super("customerTable", new String [] {"id", "name"});
    	}
    
    
    
    	@Override
    	protected void configureTable(JTable table) {
    		TableColumnModel tcm = table.getColumnModel();
    		tcm.getColumn(0).setPreferredWidth(100);
    	}
    
    	protected Object[] getDefaultInitialData() {
    		return this.customerDao.findAll(12L).toArray();
    	}
    
    
    	public String getLabel() {
    		return "customersTable";
    	}
    }

  2. #2
    Join Date
    Jun 2008
    Posts
    8

    Default scroll pane

    hello, this seems valid.
    you should check usage of CustomersTable.getComponent(), plain JTable component must be decorated with JScrollPane to show heraders & scroll bar.
    Code:
    return new javax.swing.JScrollPane(customersTable.getComponent());

  3. #3
    Join Date
    Jun 2006
    Posts
    27

    Default

    thank you it works nicely now

  4. #4
    Join Date
    Jun 2008
    Posts
    8

    Thumbs up

    yup... common catch. but it's there for a reason...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •