Dialog boxes using the swing set can be created using a combination of the JOptionPane and JDialog classes. For example, to create an error box:

JOptionPane pane = new JOptionPane(msg, JOptionPane.ERROR_MESSAGE);
JDialog dialog = pane.createDialog(owner, title); 
dialog.show();