You can play with setDefaultLookAndFeelDecorated() , but the title bar will not look like a native or other normal dialogs, but you can try this.
JDialog.setDefaultLookAndFeelDecorated(true); JDialog dialog = new JDialog(frame, "Test"); dialog.getLayeredPane().getComponent(1).setFont(new Font("Lucida",Font.PLAIN,48)); dialog.setSize(300,100); dialog.setLocation(400,200); dialog.setVisible(true);
displays the following

Note: setDefaultLookAndFeelDecorated() method
Provides a hint about whether the newly created JFrames should have their window decorations (e.g. borders, widgets to close the window, name ...) provided by the current look and feel.
therefore there is no guarantee that it will work the same in different settings, I would assume.
source share