Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How do I draw an Image on Jdialog?

524 views
Skip to first unread message

Marcus Biervliet

unread,
Mar 9, 2000, 3:00:00 AM3/9/00
to
I have a JDialog....how can I draw an Image or ImageIcon on it?

{
JFrame frame = new JFrame();
JDialog dialog = new JDialog(frame, "hello");
Container contentPane = dialog.getContentPane();

..... ????? //display image here

dialog.setSize(new Dimension(300, 150));
dialog.setLocationRelativeTo(frame);
dialog.setVisible(true);
}

Thanks


Vincent

unread,
Mar 10, 2000, 3:00:00 AM3/10/00
to
Marcus Biervliet wrote:

...
ImageIcon i = new ImageIcon(...);
JLabel l = new JLabel(i);
contentPane().add(l);
...

0 new messages