How can I set JDialog
to use favicon of it's parent?
Use the parent as the parent of the dialog. Vis.

import java.awt.image.BufferedImage;
import javax.swing.*;
public class DialogIconByParent {
public static void main(String[] args) {
Runnable r = new Runnable() {
@Override
public void run() {
try {
UIManager.setLookAndFeel(
UIManager.getSystemLookAndFeelClassName());
} catch (Exception useDefault) {
}
BufferedImage bi =
new BufferedImage(16, 16, BufferedImage.TYPE_INT_RGB);
JFrame f = new JFrame(new DialogIconByParent()
.getClass().getSimpleName());
f.setIconImage(bi);
f.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
f.setLocationByPlatform(true);
f.setContentPane(new JLabel(new ImageIcon(
new BufferedImage(400, 200, BufferedImage.TYPE_INT_RGB))));
f.pack();
f.setMinimumSize(f.getSize());
f.setVisible(true);
// This hints to use the frame's icon, among other things.
JDialog d = new JDialog(f);
d.add(new JLabel(new ImageIcon(
new BufferedImage(250, 100, BufferedImage.TYPE_INT_RGB))));
d.pack();
d.setLocationRelativeTo(f);
d.setVisible(true);
}
};
SwingUtilities.invokeLater(r);
}
}