I am adding a JTextArea to a component with a layout manager that respects preferred size and location. However, the position of the displayed caret in the JTextArea becomes erroneous after typing a few "wide" letters (e.g. 'm'):
This is after having typed all the letters from the left and the actual caret position is after 'd'. The JTextArea in this case is much wider than the text. Not sure if it might be relevant but the font used is Arial, size 11, plain style and is being set before adding the JTextArea to the parent container. Any ideas what might be causing this?