I've just faced a general problem with JTextField
in Java 8
on OS X 10.10 Yosemite
:
My particular case: JTextField
with a custom font does not handle/render the text correct.
textfield
bounds: text is not scrolled right, selecting and moving a text with the mouse produced heavily distorted display.Similar effects affect JTextArea
too.
I'm using Java 1.8.0_25
on OS X 10.10.2
, so this is not 1.8.0_40
- specific.
A similar problem is described here: Java JTextField entry broken on 1.8.0_40 OS X Yosemite 10.10.2
My custom font is a OTF font Myriad: stored in MyriadPro-Bold.otf, loaded with following code:
Font loadFont(GraphicsEnvironment ge, InputStream fontInputStream) throws FontFormatException, IOException
{
Font toreturn = Font.createFont(Font.TRUETYPE_FONT, fontInputStream);
ge.registerFont(toreturn);
return toreturn;
}
Does anyone know how to work this around? Or if this problem is going to be fixed in the near future?