Results 1 to 2 of 2
  1. #1
    sedk is offline Member
    Join Date
    Nov 2012
    Rep Power

    Default How can I add an image to a message dialog box

    final ImageIcon icon = new ImageIcon("/Users/derekfitzpatrick/Desktop/image.jpg");
    JOptionPane.showMessageDialog(this, re[roll], JOptionPane.INFORMATION_MESSAGE,icon);
    JOptionPane.showMessageDialog(this, re2[roll2]);
    JOptionPane.showMessageDialog(this, re3[roll3]);

    I tried this.. it didnt work.. help?


  2. #2
    quad64bit's Avatar
    quad64bit is offline Moderator
    Join Date
    Jul 2009
    Rep Power

    Default Re: How can I add an image to a message dialog box

    So, what didn't work? It just didn't load your image?

Similar Threads

  1. Replies: 4
    Last Post: 05-15-2011, 04:47 AM
  2. I cant get this Message dialog to appear.
    By dienesh77 in forum New To Java
    Replies: 2
    Last Post: 03-07-2011, 10:03 AM
  3. show Message Dialog
    By akritc in forum AWT / Swing
    Replies: 7
    Last Post: 06-10-2010, 02:49 PM
  4. Replies: 13
    Last Post: 03-20-2010, 01:03 AM
  5. JOptionPane - message dialog
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 12-17-2007, 09:11 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts