JDialog is a container. You should add a JLabel to its ContentPane. You are free to change the JLabel's font:
e.g.
import javax.swing.*;
import java.awt.*;
public class MyDialog
{
public static void main(String[] args)
{
JFrame frame = new JFrame(); //owner
JDialog dialog = new JDialog(frame,"My Dialog");
dialog.pack();
dialog.setSize(320,240);
JLabel label = new JLabel("Hello world");
label.setFont(new Font("MonoSpace",Font.ITALIC,20));
dialog.getContentPane().add(label);
dialog.setVisible(true);
}
}
Instead of adding the JLabel directly you could/should add it to a JPanel first, etc...
Regarding font global settings, the fonts are set by the LookAndFeel (L&F). You should create a custom LookAndFeel (or customise an existing one) class and define your preferred font settings for every item there using something like this e.g.
UIManager.put("Menu.font", new FontUIResource(yourFont));
(ditto for Button.font, Tree.font, CheckBox.font, etc.)
You can then use the created L&F in your code:
UIManager.setLookAndFeel(yourLookAndFeelClass);
or specify it at command line:
java -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel YourApp
or change the contents (you might have to create it if it does not exist) of the file
$JAVA_HOME/lib/swing.properties :
#swing.properties
swing.defaultlaf=com.sun.java.swing.plaf.windows.WindowsLookAndFeel
Alternatively, you might want to have a look at the contents of
$JRE_HOME/lib/font.properties .
Look
here,
here and
here for more details.