Multiline TableHeader

This forum is used by users to request and discuss new product features. Please do not use this forum for technical support including bug reports.

Moderator: JIDE Support

Forum rules
Product suggestions only. Please do not use this forum for technical support including bug reports.

Re: Multiline TableHeader

Postby JIDE Support » Tue Oct 05, 2010 3:39 pm

Please give the following code a try. The reason is that, when you drop down, the header is in editing mode so renderer would not be invoked at this moment.
Code: Select all
    class CustomAutoFilterTableHeader extends AutoFilterTableHeader {
        public CustomAutoFilterTableHeader(JTable table) {
            super(table);
        }

        @Override
        protected TableCellEditor createDefaultEditor() {
            if (isAutoFilterEnabled()) {
                return new AutoFilterTableHeaderEditor() {
                    private static final long serialVersionUID = -7347944435632932543L;

                    @Override
                    protected AutoFilterBox createAutoFilterBox() {
                        return new AutoFilterBox() {
                            @Override
                            protected void customizeList(JList list) {
                                super.customizeList(list);
                            }

                            @Override
                            public Object[] getPossibleValues() {
                                return super.getPossibleValues(); // return your possible values list here to change the drop down list
                            }
                        };
                    }

                    @Override
                    protected void customizeAutoFilterBox(AutoFilterBox autoFilterBox) {
                        autoFilterBox.applyComponentOrientation(CustomAutoFilterTableHeader.this.getComponentOrientation());
                        super.customizeAutoFilterBox(autoFilterBox);
                        CustomAutoFilterTableHeader.this.customizeAutoFilterBox(autoFilterBox);
                    }
                };
            }
            else {
                return null;
            }
        }
    }

Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 33500
Joined: Sun Sep 14, 2003 10:49 am

Previous

Return to Product Suggestions

Who is online

Users browsing this forum: Google [Bot] and 2 guests