List of usage examples for javax.swing JTextPane setVerifyInputWhenFocusTarget
@BeanProperty(description = "Whether the Component verifies input before accepting focus.") public void setVerifyInputWhenFocusTarget(boolean verifyInputWhenFocusTarget)
From source file:Main.java
/** * Creates a new <code>JTextPane</code> object with the given properties. * * @param text The text which will appear in the text pane * @param backgroundColor The background color * @return A <code>JTextPane</code> object */// ww w . ja v a2 s .c om public static JTextPane createJTextPane(String text, Color backgroundColor) { JTextPane jTextPane = new JTextPane(); jTextPane.setBorder(null); jTextPane.setEditable(false); jTextPane.setBackground(backgroundColor); jTextPane.setFont(new Font("Times New Roman", Font.PLAIN, 14)); if (text != null) { jTextPane.setText(text); } jTextPane.setVerifyInputWhenFocusTarget(false); jTextPane.setAutoscrolls(false); return jTextPane; }