I have a Java desktop application that I'm working on and use JDK 6 for development through the IDE. I use the rendering hint VALUE_FRACTIONALMETRICS_ONalong with other hints to better display text in JLabels. These tips work fine on JVM 1.6, but I recently noticed that it seems to completely ignore VALUE_FRACTIONALMETRICS_ONit when I run the application with JRE 1.7. Am I doing something wrong here that makes Java 7 ignore these hints?
lblDate = new ATimeLabel(ATimeLabel.DATE_LETTERS) {
private static final long serialVersionUID = 1L;
@Override
protected void paintComponent(Graphics g) {
Graphics2D g2d = (Graphics2D) g;
g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
g2d.setRenderingHint(RenderingHints.KEY_RENDERING,
RenderingHints.VALUE_RENDER_QUALITY);
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON);
g2d.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS,
RenderingHints.VALUE_FRACTIONALMETRICS_ON);
super.paintComponent(g2d);
}
};
FRACTIONALMETRICS has the most noticeable visual effect for text, so getting this to work is what I'm looking for.
, , IDE (), Java 6, Jar ( Right), JRE, Java 7.
( , , )

.