Skip to main content

SwingX ColumnControl - More columns than screen size

Please note these java.net forums are being decommissioned and use the new and improved forums at https://community.oracle.com/community/java.
4 replies [Last post]
NormanC
Offline
Joined: 2013-02-24

Hi folks!
As you surely know, if a table has a lot of columns they can't be all represented in the ColumnControlPopup. I found a thread from 2005 dealing with that problem, but apparently without a solution. In the meantime is there any useful workaround for that bug?
Kind regards!

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
kleopatra
Offline
Joined: 2003-06-11

Hi Norman,

it's not a bug, it's a feature ;-) We probably have an open issue in the tracker which is as long-standing as the thread you found.

More seriously: all you need is a scrollable popupmenu - which SwingX doesn't have (yet?), but there used to be experiments in the jdnc-incubator - and extend ColumnControlPopup to use that instead of standard. No ongoing work, on that scrollable (afaik).

Cheers
Jeanette

kschaefe
Offline
Joined: 2006-06-08

There are scrollable menus in my incubator.

I was hoping to move some incubator code (scrolling menus included) to the stubbed out Maven experimental package (no set APIs, lots of disclaimers, etc.) as a way to give that stuff more exposure. We have a lot of mostly finished ideas there that do not get tested or used because of limited views.

Karl

NormanC
Offline
Joined: 2013-02-24

Hi Jeanette!
Thanks for your reply! At first I thought, that it might be just some code lines to make a popupmenu scrollable, but it wasn't ;-). Unfortunately I also found only experiments which were either buggy or at example the number of visible entries had to be pre-configured - but without a dynamically change of visible rows there isn't much improvement, I think.

Best regards
Norman

cmadsen_dk
Offline
Joined: 2005-09-29

The code from here did it (more or less) for me http://java.net/projects/jdnc-incubator/lists/cvs/archive/2005-12/messag...

Using it like this:

return new JXTable() {

private ColumnFactory columnFactory;

@Override
protected JComponent createDefaultColumnControl() {

return new MultiColumnSelectControlButton(this);
}

@Override
public ColumnFactory getColumnFactory() {
if (columnFactory == null) {
columnFactory = DbTableColumnFactory.getInstance();
}
return columnFactory;
}

};

BR
Carsten