MATLAB Answers

How to set "word wrap" for cells in a uitable?

40 views (last 30 days)
Darin McCoy
Darin McCoy on 29 Aug 2012
Edited: Walter Roberson on 13 Jun 2017
Hi,
I'm trying to figure out how to set "word wrap" to be true for a uitable on a particular cell. I have access to the underlying java object (thanks to Yair Altman's findjobj function) and have been able to figure out how to set the height of the uitable cell using the java object, but am not sure how to get the cells to word wrap.
Any ideas on how to do that??
Clarification on what I mean when I say word wrap http://en.wikipedia.org/wiki/Word_wrap

  1 Comment

Sinh Le
Sinh Le on 13 Jun 2017
can u give an example of how to set the height of the uitable cell using the java object.
I tried this, but it did not work
import com.jidesoft.grid.*
jscroll = findjobj(table_4);
jtable = jscroll.getViewport.getView;
jtable.setRowHeight(11,30)

Sign in to comment.

Accepted Answer

Darin McCoy
Darin McCoy on 31 Aug 2012
Actually - turns out.....if you add HTML tags into your UITABLE - it will do word wrap automatically. Fun times! :)

  2 Comments

patrick
patrick on 24 Feb 2014
what do you mean by HTML tags? do you have a sample code?
Walter Roberson
Walter Roberson on 24 Feb 2014
mywords = {'<HTML>This is a longer phrase that should wrap'; 'But this one which does not have the tag, should not wrap' };
uicontrol('Data', mywords)

Sign in to comment.

More Answers (0)

Sign in to answer this question.