Font font = Font(\"Arial\", Font.BOLD, 35);
JLabel label = new JLabel(\"57\");
JPanel panel = new JPanel();
panel.setLayout(new BoxLayout(panel, BoxLayout.LINE_AXIS
The arrow in your diagram points to the difference between the glyph's nominal ascent and the maximum ascent, as discussed in FontMetrics. You can tinker with setBorder(null); but for absolute control, you'll have to render the glyphs yourself, as shown here. Fortunately, the digit glyphs of most fonts have a uniform advance and ascent.