"answers <font size=\"+2\" color=\"red\">a prison</font> for oneself.";
public static JTextArea ta2 = new JTextArea(markup);
public void test(TestHarness harness)
{
View view = ta2.getUI().getRootView(ta2);
try
{
harness.check (view.getPreferredSpan(View.HORIZONTAL) >
view.getPreferredSpan(View.VERTICAL));
ta2.setText("");
harness.check (ta2.getPreferredSize().width == 0);
harness.check (view.getPreferredSpan(View.HORIZONTAL) == 0);
ta2.setText("\n\n\n\n\n\n\n\n\n");
harness.check (ta2.getPreferredSize().width == 0);
harness.check (view.getPreferredSpan(View.HORIZONTAL) == 0);
ta2.setLineWrap(true);
ta2.setWrapStyleWord(true);
harness.check (ta2.getPreferredSize().width == 100);
harness.check (view.getPreferredSpan(View.HORIZONTAL) == 100);
ta2.setText("");
harness.check (ta2.getPreferredSize().width == 100);
harness.check (view.getPreferredSpan(View.HORIZONTAL) == 100);
ta2.setText("\n\n\n\n\n\n\n\n\n");
harness.check (ta2.getPreferredSize().width == 100);
harness.check (view.getPreferredSpan(View.HORIZONTAL) == 100);
}
catch (Exception e)
{
// There shouldn't be an exception thrown. At the time of writing of
// this test case, GNU Classpath 0.19 + CVS does fall into this block.