This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
I would like to be able to specify a custom Icon when creating either a DialogDescriptor or a NotifyDescriptor. This should be similar to the way you can specify your own Icon in a JOptionPane.
There are three ways how to specified a icon in Dialog: 1) choose one from standard icons specified by message type (ERROR_MESSAGE, INFORMATION_MESSAGE, WARNING_MESSAGE, QUESTION_MESSAGE, PLAIN_MESSAGE) See http://bits.netbeans.org/dev/javadoc/org-openide-dialogs/org/openide/NotifyDescriptor.html#setMessageType(int) 2) your message/innerPane can be JLabel decorated by icon (http://bits.netbeans.org/dev/javadoc/org-openide-dialogs/org/openide/DialogDescriptor.html#DialogDescriptor(java.lang.Object,%20java.lang.String)) 3) your message/innerPane can be Object[], e.g. new Object[] {<my_icon>, <my_component>}. DialogDisplayer uses FlowLayout for layout these parts of message. Maybe it can help you.
I tried #1 in Windows but doesnt work: PruebaPanel p = new PruebaPanel(); DialogDescriptor d = new DialogDescriptor(p, "Hola mundo !!", true, NotifyDescriptor.INFORMATION_MESSAGE, null, new ActionListener() { public void actionPerformed(ActionEvent e) { } }); It doesnt show the ICON.
My main point here is that to specify an Icon it takes quite a bit of coding it would be nice to be able to just specify the Icon in the constructor, like you do with JOptionPane. I thought the Dialogs API was based around the JOptionPane idea. For a simple Dialog you should be able to specify your title, message, option type (type of buttons), your own icon if needed.