Change The Icon Of JOptionPane

Can anybody tell me how can I chnage the Icon of JOptionPane ,
I would like to chnage the default Icons come with Java, I want my own Icons to be displayed
Thanx in advance
pritesh

hi,
just use those static showXXXDialog() methods that expect a javax.swing.Icon as parameter, such as:
JOptionPane.showMessageDialog(null, "My message", "My title", JOptionPane.INFORMATION_MESSAGE, new ImageIcon("info.gif"));
Or use the showOptionDialog() method that provides similar features.
sincerely Michael

Similar Messages

  • How to change the icon of JOptionPane and JFileChooser in swing

    Hi,
    Does any body know how to change the icon of JOptionPane and JFileChooser in swing.
    Please help me out in this.
    Thanx in advance.

    Try this
    import javax.swing.*;
    import java.awt.event.*;
    public class Untitled4 {
      public Untitled4() {
      public static void main(String[] args) {
        ImageIcon i = new ImageIcon("C:/TestTree/closed.gif");
        JOptionPane p = new JOptionPane();
        p.setMessage("This JOptionPane has my icon");
        p.setMessageType(JOptionPane.QUESTION_MESSAGE);
        p.setOptionType(JOptionPane.YES_NO_CANCEL_OPTION);
        final JDialog d = p.createDialog("test");
        d.setIconImage(i.getImage());
        d.setVisible(true);
        d.setModal(true);
        if(Integer.parseInt(p.getValue().toString()) == JOptionPane.YES_OPTION) {
            System.out.println("You Clicked Yes");
    }

  • Is there a way to change the icon associated with icloud account?

    Is there a way to change the icon associated with my iCloud account? It's currently a rose and i do not like it.

    Welcome to the Apple Support Communities
    Are you referring to your iCloud account picture or your user picture?
    It looks like you are referring to your user picture. To change it, open System Preferences > Users & Groups, press the picture box and choose the user picture you want from the ones that came by default. If you want to select a different picture stored on your Mac, drag that photo onto the picture box.
    If you want to change your iCloud account picture, open http://www.icloud.com and log in with your Apple ID. Then, press your name at the top right of the site and press the user picture. If you put the cursor on the picture box, you will see a button at the top of the box to change your picture

  • When I click on a link in an RSS feed it used to indicate that I'd viewed that particular link by changing the icon to the left of the link. It doesn't do that anymore. [SOLVED]

    When I click on a link in an RSS feed it used to indicate that I'd viewed that particular link by changing the icon to the left of the link. It doesn't do that anymore. This started happening right around the time I updated to Firefox 4, but may have been a little before that too. For some things, like news and web comics it's just a little annoying. For important things like looking for new journal articles for my job, it literally makes my job more difficult. So fixing this would make my day.

    I seem to have solved my own problem. When I disabled the add-on "Tab Renamizer" everything started working fine.

  • How to change the icon for print dialog?

    Hello,
    I have a JTable, and with the print() method, I'm able to bring up the Print dialog and successfully print the contents of the table. Example:
    myTable.print( JTable.PrintMode.FIT_WIDTH, myHeaderFormat, myFooterFormat );This works great, but one small detail I'd like to change is the icon in the top-left corner of the dialog. The icon is currently the default Java coffee cup icon, while the rest of my application uses my custom icon. I couldn't find any documentation in the API or tutorials that Java has listed which shows how to change the icon, so I'm not even sure if it's possible (but why shouldn't it be?).
    My question is this: Is it possible to change the default icon in the print dialog? Or do I have to either make my own print dialog somehow, or use a third-party print dialog?
    Thanks

    tjacobs01: Appreciate the assistance (despite your sass). I've already searched the API, tutorials, and this forum. I'm already well aware of the setIconImage() method for JFrame -- after all, that's how I set the icon for my other frames as I previously mentioned. However, I want to set the icon for the print dialog called from the print() method of JTable.
    How would I use setIconImage() for the print() method of JTable? The print() method returns a boolean value, not a JFrame, so I'm just not sure how to implement what you're saying.
    Thanks

  • How to change the icon of coffee on the titile bar

    Hi!
    I am having this problem that
    how to change the icon of coffee on the titile bar
    if someone know how please respond
    Asif

    Next time please post your question in the appropriate forum, since this forum discusses the Java3D API.
    The answer is use the Frame.setIconImage method.

  • How to change the icon for 'windows group' in Java 1.6 [Windows XP] ?

    Hello,
    I was wondering if there is a possibility to change the icon for 'windows group' in Java 1.6...
    I'm using Windows XP SP2. Now the windows from my Java 1.6 application are grouped with the standard Sun icon [screen below] on the group.
    http://img382.imageshack.us/img382/8995/iconbl1.png
    I would like to change the icon for my own. Is there a way to do that ?
    Please help.

    Whichever icon I use for the main frame (I tried few), after grouping the main frame and other sub-frames the icon is changed to standard 'Java Sun' icon as you can see in the screenshot from my first post. The problem occurs only when frames are grouped, when the are separated in the task bar their titles and icons are ok...
    So how can I change the icon/title for the group only (for Java 1.6 in Windows XP) ?

  • How to change the icon of a spot in a dynpro application?

    Hi,
    I am trying to change the icons for the spots on the map in a dynpro application dynamically. Is it possible to change the icon for only some of the spots? If yes, which method should I use?
    The images for the icons are located in the mime repository and I added them to the application in the initialization of the application.
    Thanks and regards,
    Marc

    Hello Mark,
    The intended place for any UI technology is method DETERMINE_SPOT_ICONS of the control adapter. The default impl. resides in class CL_VBI_CONTROL_ADAPTER_GEO. There are two options for changing the icons:
    1. derive your own control adapter impl. and overwrite this method
    2. If the default pin assignment is sufficient you may simply replace the images. To do so provide an alternative MIME repository path to method GET_INITIAL_ZIP_ARCHIVE of class CL_VBI_GEOMAP_APPLICATION
    In the later case all pin images need to be available under the new path.
    Hope the answer your question.
    Cheers Uwe

  • How to change the Icon for a JFileChooser ?

    Has anyone figured out how to change the icon for an instance of JFileChooser from the coffee cup to something else?
    I'm on 1.4
    Thanks,
    Ken

    Never mind. I figured it out.
    You have to use an instance of JFrame in the call to showXxxxDialog(Component c). Set the icon of the JFrame to what you want the JFileChooser's icon to be.

  • How to change the icon in PPOME?

    Hi experts!!!
    I want to change the icon that appears in transaction PPOME, in Detail Area part. I want to put a "Tick" in address flap. I know I have to change it in SPRO Adjust tab Pages in Detail Area, but when I save the changes I make, it doesn't apper, can anybody help me???
    Thanks a lot,
    Regards,
    Rebeca

    Hello Rebeca,
    I am not sure but It all depends on your settings in table T77OMTABS. So perhaps you should check it again steps by steps for scenario OME0 "Organization and Staffing". Hope it helps,
    Kind Regards
    Christine

  • Why can't i change the icon in my flash drive?

    Hi all,
    I've been trying to do a simple task - but the mac won't have it.
    I want to change the icons on my flash drives, using Cmd-I, then copy and paste the icon (purchased from mac),  but all that comes up on the drive is a 'png' file pic.
    What am I doing wrong?
    thanks in anticipation

    THank you so much - I'd like to say 'rookie mistake', but I'm not a rookie!  Just having a bad day.
    Thanks Niel for your help.
    cheers

  • Why can't I change the icon of my file folders?

    I'm trying to follow these directions (pasted below) that I found in Finder Help, but can't do Step 3. There is no icon in the info window that I can select. Can you please help? I have some folders for which it would be extremely helpful to show an image from their contents rather than the generic blue folder.
    Thank you so much!
    To use your own picture or a picture from the web:
    Copy the picture you want to use to the Clipboard.One way to do this is to open the picture in Preview, choose Edit > Select All, and then choose Edit > Copy.
    Select the file or folder whose icon you want to replace and choose File > Get Info. 
    At the top of the Info window, click the picture of the icon to select it, and then choose Edit > Paste.

    Thank you SO much! Funny thing, I didn't even notice the tiny folder icon at the top of the info window until I saw it in the screen shot at the beginning of that article. 
    See, I have begun changing the icons of the folders of digital scrapbooking alphabets I have (screenshot below). Now it will be so much easier to scroll through my hundreds of alphas and choose one, because I can SEE them without going in and out of each folder.
    A million thank yous!!!!! 

  • Change the icon and the word "open" at the left upper corner of file dialog

    i wanna to change the icon and the word "open" at the left upper corner of a Jfilechooser...
    can any expert tell me how to do so?
    thx and thx...

    yeah u can change the JFileChooser's title by calling the setDialogTitle(String) method. i'm not sure of the icon change, i think it can't be done.

  • How do I change the icon of a usb?

    I just recently updated to OS X Mountain Lion, and it doesn't seem to let me change the icons of my usb drive.
    I use .icns type files, but it comes up as an ugly broken image. Anyone else have this problem?
    Any help would be very much appreciated.

    Hi,
    Use the method setIconImage (in Frame class).
    /Kaj

  • To change the icon name displayed by default while an ALV is displayed.

    Hi Experts ,
    Need to change the icon name EXPORT displayed by default , while an ALV is displayed to Download to Excel.
    How can this be achieved?
    Regards.

    Hi,
    You can copy the Status 'Standard' of the program 'SAPLKKBL' and create a Z. Change the icon name in the Z pf-status as wished. Now in the event slis_ev_pf_status_set of 'REUSE_ALV_GRID_DISPLAY' set the PF-Status to the Z that u created.
    Regards,
    Nikhil

Maybe you are looking for