/** * Constructs a new display only {@link JTextArea} * @param text text that the {@link JTextArea} displays * @return a new display only {@link JTextArea} */ private JTextArea getTextAreaForDisplay(String text) { final JTextArea ta = new JTextArea(text); ta.setUI(new BasicTextAreaUI()); ta.setEditable(false); ta.setFocusable(false); ta.setOpaque(false); ta.setWrapStyleWord(true); ta.setLineWrap(true); return ta; }
public void testUpdateUI() throws Exception { assertTrue(jtComp.getUI() instanceof TextCompUI); TextUI textUI1 = jtComp.getUI(); SimplePropertyChangeListener listener = new SimplePropertyChangeListener(); jtComp.addPropertyChangeListener(listener); jtComp.UIClassId = "TextCompUISecond"; TextUI textUI2 = (TextUI) UIManager.getUI(jtComp); assertNotNull(textUI2); jtComp.updateUI(); assertEqualsPropertyChangeEvent("UI", textUI1, jtComp.getUI(), listener.event); assertTrue(jtComp.getUI() instanceof BasicTextAreaUI); }
@Override public void updateUI() { setUI(new BasicTextAreaUI()); if (myColors != null) updateColors(); }
@Override public void updateUI() { setUI(new BasicTextAreaUI()); updateColors(); }