I cannot seem to force a layout in Swing. I have a JComponent added to a JLayeredPane and I set a border on the JComponent. Then, I wa
JComponent
JLayeredPane
This is super old, but I found a simple solution, which I'll show with a JPasswordField:
var pw = new JPasswordField(); ... pw.paint(pw.getGraphics()); // paints immediately