List of usage examples for javax.swing JTextArea getBorder
public Border getBorder()
null
if no border is currently set. From source file:edu.ku.brc.af.ui.forms.ViewFactory.java
/** * Creates a JTextArea for display purposes only. * @param cellField FormCellField info//w w w . ja v a 2 s .co m * @return the control */ public static JScrollPane changeTextAreaForDisplay(final JTextArea ta) { Insets insets = ta.getBorder().getBorderInsets(ta); ta.setBorder(BorderFactory.createEmptyBorder(insets.top, insets.left, insets.bottom, insets.bottom)); ta.setForeground(Color.BLACK); ta.setEditable(false); ta.setBackground(viewFieldColor.getColor()); ta.setLineWrap(true); ta.setWrapStyleWord(true); JScrollPane scrollPane = new JScrollPane(ta); insets = scrollPane.getBorder().getBorderInsets(scrollPane); scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED); scrollPane .setBorder(BorderFactory.createEmptyBorder(insets.top, insets.left, insets.bottom, insets.bottom)); return scrollPane; }