import java.awt.BorderLayout;
import static java.awt.BorderLayout.CENTER;
import static java.awt.BorderLayout.EAST;
import java.awt.Font;
import java.awt.FontFormatException;
import java.awt.Toolkit;
import java.io.File;
import java.io.IOException;
import javax.swing.BorderFactory;
import javax.swing.BoxLayout;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.UIManager;
import javax.swing.plaf.ColorUIResource;
import javax.swing.plaf.FontUIResource;
import javax.swing.plaf.metal.MetalLookAndFeel;
import javax.swing.plaf.metal.MetalTheme;

public class BrokenTooltips {

private static final File fontFile = new File("/System/Library/Fonts/NewYork.ttf");

public void run() throws Exception {
MetalLookAndFeel.setCurrentTheme(new MetalTheme() {
@Override public String getName() { return ""; }
@Override protected ColorUIResource getPrimary1() { return null; }
@Override protected ColorUIResource getPrimary2() { return null; }
@Override protected ColorUIResource getPrimary3() { return null; }
@Override protected ColorUIResource getSecondary1() { return null; }
@Override protected ColorUIResource getSecondary2() { return null; }
@Override protected ColorUIResource getSecondary3() { return null; }
@Override public FontUIResource getControlTextFont() { return null; }

@Override
public FontUIResource getSystemTextFont() {
try {
return new FontUIResource(FontUIResource.createFont(Font.TRUETYPE_FONT, fontFile).deriveFont(12f));
} catch (FontFormatException | IOException e) {
throw new RuntimeException(e);
}
}

@Override public FontUIResource getUserTextFont() { return null; }
@Override public FontUIResource getMenuTextFont() { return null; }
@Override public FontUIResource getWindowTitleFont() { return null; }
@Override public FontUIResource getSubTextFont() { return null; }
});
UIManager.setLookAndFeel(new MetalLookAndFeel());
JFrame frame = new JFrame("Broken Tooltips");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel mainPanel = new JPanel(new BorderLayout());
mainPanel.setBorder(BorderFactory.createEmptyBorder(15, 15, 15, 15));
JPanel buttonPanel = new JPanel();
buttonPanel.setLayout(new BoxLayout(buttonPanel, BoxLayout.Y_AXIS));
JButton shortButton = new JButton("Hover here");
shortButton.setToolTipText("Button");
buttonPanel.add(shortButton);
mainPanel.add(buttonPanel, EAST);
frame.getContentPane().add(mainPanel, CENTER);
frame.setSize(Toolkit.getDefaultToolkit().getScreenSize());
frame.setVisible(true);
}

public static void main(String[] args) throws Exception {
new BrokenTooltips().run();
}

}
