Questo è abbastanza facile utilizzando l'icona di un trasparente, come di seguito (in contrasto con l' 'immagine splash' nero). Sebbene si noti che mentre il riquadro delle opzioni offre un po 'di spazio di manovra in termini di visualizzazione, passa a cambiare un paio di cose e diventa subito più semplice usare un JDialog
.

import java.awt.*;
import java.awt.image.BufferedImage;
import javax.swing.*;
class IconFree {
public static void main(String[] args) {
Runnable r = new Runnable() {
@Override
public void run() {
// A transparent image is invisible by default.
Image image = new BufferedImage(
1, 1, BufferedImage.TYPE_INT_ARGB);
JPanel gui = new JPanel(new BorderLayout());
// ..while an RGB image is black by default.
JLabel clouds = new JLabel(new ImageIcon(new BufferedImage(
250, 100, BufferedImage.TYPE_INT_RGB)));
gui.add(clouds);
JOptionPane.showConfirmDialog(null, gui, "Title",
JOptionPane.OK_CANCEL_OPTION,
JOptionPane.QUESTION_MESSAGE,
new ImageIcon(image));
}
};
// Swing GUIs should be created and updated on the EDT
// http://docs.oracle.com/javase/tutorial/uiswing/concurrency/initial.html
SwingUtilities.invokeLater(r);
}
}
fonte
2013-06-07 18:40:33
JOptionPane.PLAIN_MESSAGE? – mishik
http://stackoverflow.com/a/10489515/2381006 –
@mishik: JOptionPane.PLAIN_MESSAGE non mi consente OK Annulla pulsanti. –