I have Uitable with data read from a AScii file.
I want to select columns using mouse and also using checkboxes. I tried a lot but i cannot figure out how to select uitable column using mouse and getting that data.
Also I am trying to insert checkbox in the last row of the uitable, so when user selects checkbox, particular column is selected.
Any idea?
To handle clicks on the column headers, one must go to undocumented territory:
%# old UITABLE (based on Swing JTable, instead of the new JIDE-based)
[hTable,hContainer] = uitable('v0', 'Parent',gcf, ...
'Data',magic(7), 'ColumnNames',cellstr(num2str((1:7)','C%d'))');
set(hContainer, 'Units','normalized', 'Position',[0 0 1 1])
%# handle mouse clicks on table headers
jTableHeader = hTable.getTable().getTableHeader();
h = handle(jTableHeader, 'CallbackProperties');
set(h, 'MousePressedCallback',...
@(src,evt) disp( src.columnAtPoint(evt.getPoint())+1 )) %# zero-based index