|
"Dave Brackett" <davebrackett@hotmail.com> wrote in message <gn3h5a$7cl$1@fred.mathworks.com>...
> "ventus85 " <ventus85@katamail.com> wrote in message <gn3buh$dd9$1@fred.mathworks.com>...
> > The number of the line is attached to data,
> > I would like to align text on the right in the uitable.
> >
> > Thank you.
>
>
> based on this previous post it doesn't appear to be possible to right align text in the table: http://www.mathworks.ch/matlabcentral/newsreader/view_thread/169421
it can be done if you set a new TableCellRenderer, as explained here: http://forums.sun.com/thread.jspa?threadID=560517&tstart=88
renderer = javax.swing.table.DefaultTableCellRenderer;
renderer.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
jtable.getColumnModel.getColumn(1).setCellRenderer(renderer);
unfortunately, this works only if you use a standard JTable or Matlab's deprecated version of uitable; Matlab's new built-in uitable (actually, JideSoft's tables which Matlab uses) apparently doesn't enable modifying its CellRenderers...
Yair altman
|