How to change The Standard JOptionPane Icon?

in this simple code
i want to change the Standard JOptionPane icon to a different icon
how could it be?
thank you
import java.awt.*;
import javax.swing.*;
import java.awt.event.WindowListener;
import java.awt.event.WindowEvent;
import javax.sound.sampled.*;
import javax.swing.JPanel;
import javax.swing.JFrame;
import javax.swing.ImageIcon;
import javax.swing.Icon;
import java.awt.event.*;
  public class MyFrame extends JFrame 
JLabel label=new JLabel("Hello");
  MyInner inner;
      MyFrame ()
        setupGUI();
    private void setupGUI()
       JFrame f =new JFrame();
    //   f.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE);
       f.setTitle("Window Event");
        f.setSize(550,350);
        f.setResizable(false);
        f.setLayout(new BorderLayout());
        f.add("Center",label);
        f.show(true);
         inner=new  MyInner();
         f.addWindowListener(inner);
               class MyInner extends WindowAdapter
       public void windowClosing(WindowEvent ee)
                     Toolkit tool = Toolkit.getDefaultToolkit();
              tool.beep();
                  JOptionPane.showMessageDialog(null, "Nice Work! " );
                  System.exit(0);
      public  static void main(String[]args)
         MyFrame frame=new MyFrame ();
}

For instance:
    class MyInner extends WindowAdapter
        public void windowClosing(WindowEvent ee)
            Toolkit tool = Toolkit.getDefaultToolkit();
            tool.beep();
            JOptionPane.showMessageDialog(null, "Nice Work! ");
            ImageIcon myImageIcon = new ImageIcon("myPic.jpg"); // needs proper path here
            JOptionPane.showMessageDialog(null, "Better Work!", "Dang, I'm smart!", JOptionPane.ERROR_MESSAGE, myImageIcon);
            System.exit(0);
    }

Similar Messages

  • How to change the node's icon in a tree when the node collapse or expand?

    how to change the node's icon in a tree when the node collapse or expand?

    Hi,
    You may need to use custom skin for that.
    -Arun

  • How to change the standard layout sets in ALV List

    Hi Gurus,
    How to change the standard layout sets in ALV list.
    Is there any standard program ? or specific way to acheive this?
    Kindly drop some clues?Every valuable clues rewarded more points........
    Thanks in Advance,
    Dharani

    Hello Dharani
    All required function modules can be found in function group SLVC (assuming that you are using OO-based ALV or, at least, fm REUSE_ALV_GRID_DISPLAY_LVC):
    LVC_VARIANT_DEFAULT_GET (Read default display variant (description only, w/o field catalog))
    LVC_VARIANT_EXISTENCE_CHECK
    LVC_VARIANT_F4 (Display variant selection dialog box)
    LVC_VARIANT_SELECT (Read a display variant)
    For a sample report using LVC_VARIANT_DEFAULT_GET have a look at BCALV_GRID_10.
    Regards,
      Uwe

  • How to change the default JAD Icon image in JStudio

    Dear friends,
    I have one dought,how to change the default icon JAD image in jstudio application.Its very important to me.And one find answer please tell .

    Dear friends,
    I developed one application in jstudio.And need to set an special icon for my application.While i download my application in to mobile. The icon should be displayed in the mobile.To show my application as unique from other applications.But i dont know how to set an icon for my application. If any one find answer please reply as soon as possible.
    Thank you

  • How to change the size of icons on the desktop?

    Please help to know how to change the size of the icons on the desktop.  How do I access the font family for the desktop if that's the way to do it?
    Thanks

    Click on the Finder/Desktop
    From the View menu > Show View options.
    This is as large as they go
    If your having trouble seeing when web browsing I have a alternative for that.
    Firefox + NoSquint + Theme Font & Size Changer

  • How to change the standard data type in xi

    Hi,
    presently we have SCM.i want to change the standard data type i.e" Replinishment order notification ".i want to change the length of the field .
    but there is no edit option for that data type.
    i even modified Software component version( http//sap.com/xi/scmbasis/global)with objects are original objects and objects are modifible(tick the check box)
    thanks in advance.
    atmakur

    Hi Atmakur,
      <i>i even modified Software component version( http//sap.com/xi/scmbasis/global)with objects are original objects and objects are modifible(tick the check box)</i>
        After doing this have you activated the change list? If not please do it and refresh it..and try to open..it will work..
    Regards,
    Prasanthi.

  • How to change the standard category thumbnails?

    This month I upgraded to PE6. I don't like the dark gray background and miss some of the features I got used to, but I can live with that. On the other hand, I extremely disliked the standard category thumbnails for places, people, events and other. Why on earth did Adobe change the appealing thumbnails for those categories in PE4? The present ones are dull and because I can't make anything of the fine details in the new thumbnails I keep forgetting what they stand for.
    So far I have made several attempts to revert to the old thumbnails. I replaced the *.png picture files in the shared_assets\bitmaps\tag_palette with the old picture files (which are, by the way, present in the same directory, as "legacy" files). Didn't make any difference.
    The second attempt was to add the old picture files to the shared_assets\caticons directory. They then appeared in PE6 as possible alternate choices for the thumbnails. I changed all four categories. Took some time, but it worked. However, next time I started PE6, everything was back to the original situation. Heavy sigh... Where does PE6 hide the new stupid thumbnails??

    There's something about those legacy icons that's built-in to PSE 6. Here's a recipe that worked for me:
    - Copy shared_assets\bitmaps\LegacyCatIcon_People.png to shared_assets\caticons\MyPeople.png.
    - Invoke the full editor on MyPeople.png and change one pixel to a slightly different color.
    - Save MyPeople.png.
    - Edit the People category and select the icon for MyPeople.png.
    - Restart PSE 6 Organizer.

  • How to change the java cup icon for all the JFrames?

    Hi,
    I would like to know if I can change the Java cup defult icon that appears in the upper left corner of the JFrames in one time, instead of setting the JFrame's icon in every created JFrame.
    Regards,
    Gabriel

    Then don't set the parent to null. If you don't want a parent, just set it to
    JOptionPane.showMessage(new IconFrame(), ...
    [\code]
    where IconFrame extends JFrame and sets the icon in it's constructor.  The optionpane will then use the icon from it's parent frame.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How to change the standard time in ical

    Hi!
    When I create a new date in iCal, which is after 4 pm, iCal alway wants to set the ending of this date automatically on the next day. ( 8 hours standard)
    how can I change the preferrences for creating a new date less than 8 hours, for example 4 hours? Do I have to change it in the terminal?
    Many, many Thanx in advance!!!

    Hi!
    When I create a new date in iCal, which is after 4 pm, iCal alway wants to set the ending of this date automatically on the next day. ( 8 hours standard)
    how can I change the preferrences for creating a new date less than 8 hours, for example 4 hours? Do I have to change it in the terminal?
    Many, many Thanx in advance!!!

  • How to change the standard Fields short description in KNVV table

    Hi All,
    Our system is recently upgraded from 4.7 to ECC 6. When we compared both versions we found the KNVV table fields descriptions are changed in 4.7(customer modifications done in 4.7) and same these customer modifications are not copied to ECC 6 from 4.7 version.
    So I tried to change the short description at domain level with the help of access key. But the description is not changed. Can you please let me know is there any procedure that how can we change the fields description for standard tables.
    KNVV table in 4.7                                                        ECC 6
    Fields                       Short Description                     Short Description
    1. KVGR1               Gen.Bus.Terms print                Customer group 1
    2. KVGR2               VAT on FOC                            Customer group 2
    3. KVGR3               Confirmation status                 Customer group 3
    4. KVGR4               Collect Billing                           Customer group 4
    5. KVGR5               SC Surchge Excl                    Customer group 5
    Regards,
    Jyothi CH.

    You need not use access key to change field labels
    Transaction CMOD -> Go to -> Text Enhancements -> Keyword -> Change.
    Here you can change all data element KNVGR1 to KVGR5

  • How to change the individual node Icon based on the user action?

    Hi all,
    I just want to change the icon of the selected node when user clicks the button.
    I've gone through some examples in the tutorials and someother websites,
    but it looks very big for this simple need.
    Please help me in a simple way.
    Thanks a lot.

    Anandababu_Babu wrote:
    node represents a node in a JTree.
    I don't have a code for this problem, i just have a idea to implement this on my application,
    for better user interaction.Read the API for JTree and follow the link to the Swing tutorial on How to Use Trees where you will find a section on Responding to Node Selection and a link to another section on Editors and Renderers. After trying out what you learn there, feel free to ask here if you have a more specific question than "I don't know how to do it"
    luck, db

  • How to change the standard query "Create a Master Agreement" by a custom one

    Hello Sourcing CLM experts,
    I would need to replace the standard query displayed when the user tries to create a Master Agreement by a custom query to filter the MA types according to some criteria:
    According to this post: Re: Create security profile for a document template in SAP Sourcing, I've tried to achieve it by doing the following steps:
    Create a new query as a copy of exsiting query FCI-ContractTypes
    Modify query group FCI-ContractTypesBP to include my custom query instead of the standard one to only list the MAType "Standard Master Agreement"
    Following you can see the change done into the query group FCI-ContractTypesBP:
    However, standard query has not been replaced and same set of MA Types are listed.
    Therefore, I would like to ask you:
    Is it possible to do this kind of modifications? If so, which query group need to be modified?
    If it is not possible, is there any other way to achieve that requirement?
    Thanks in advance for your time and support!
    Best regards,
    Isaac

    Hello again experts,
    If this query cannot be modified, is there any option to disable button below? Or at lease, to disable the query group to avoid the listing of MA Types when it is pressed?
    The reason is because we are going to set up the system in the way that only it will be possible to create Master Agreements from Template. However, if user keep on using that button he will be able to create MA from document types.
    Any ideas?
    Thanks again and best regards,
    Isaac

  • How to change the standard purchase order ???

    Hi,
       i am trying to change the output form of standard purchase order.for that i copied the standard script/form to my own created script/smart form.i modified it as per user requirement and i have given the same name in NACE>EF>output type>NEU>processing routine..in place of the standard one.and i have also activated the standard program i.e. SAPFM06P.but when i am going to me22n and print preview the previous form format is coming...
    if i will create my own smartform then it is difficult for mapping all the fields to me22n...user can not input other fields in me21n if i am giving my print program name in NACE...
    can anybody please help me...????
    pls reply soon,....
    Regards
    Amayika

    Hi,
    Are you sure you have set it for medium 1 (print output) and specify the program, FORM routine, and the Form/Script correctly?
    Another reason is the output type is not set up yet at the PO. Go to ME22N and click Messages button (next to Print preview button) and check whether your output type is already there. If it is not, then create one.
    Please also check that you have copy client the form/script from development client to test client (SAPScript need this but no need for Smartform) using T-Code SCC1. And the config is configured properly in test client.
    Regards,
    Teddy

  • How to change the style of icons used on the tool bars mainly the forward and backwards arrows

    Hi .
    There always used to be a way of changing the look of firefox the arrowws ect at the moment i have just outline type arrows for forwards and backwards i would far rather have the older Green arrows far easier to see and look far better how do i cange this now
    This is on Firefox 9.0.1 64 bit on Arch Linux current

    Ok well this has only recently happened that the arrows have gone to these horrible outline things i use themes and personas but this is a new effect so looks like ity is down to canning either themes or personas because those arrows are to put it politely disgusting

  • How to change the color of icons

    Hello all...
    Is there a way to change color of an icon??? It seem to me that I was able to do this in a previous OS but I have lost the way to accomplish the task.

    Thanks for your reply Templeton; however, your method only changes the color of the label not the icon itself. I'm looking to change the color of the icon.

Maybe you are looking for

  • How to create a top include for module pool program

    hi all..   I want to add my global declarations in one top inlcude.. There are so many other includes in my pgm. But how can i create top include explicitly. Also I have one normal report pgm attached with this module pool.

  • Connectivity with MySQL in Windows

    How can I connect JSP with MySQL in Windows?           I Tried out the following code but It did not work           Class.forName("org.gjt.mm.mysql.Driver");           Connection cn = DriverManager.getConnection("jdbc:mysql:///test");           

  • Session variable using :GROUP variable in init block

    I'd like to filter using session variable. This session variaible should be build using :GROUP special session variable I'd like do something like this (init block): select  case when instr(upper(':GROUP'), 'ADMINISTRATOR')>0 then 'Yes' else 'No' end

  • Problem With Actionscript Working in Player 7 and Up

    Can some one please help me, I have been working with an old action script file that works in flash player 6 but not any thing above that. Any help would be great. As a side note the spline function no longer works either. onClipEvent (load) { functi

  • Is could install the BI suite on windows 7 at 64 bits ??

    I´m trying install the bussines explorer suite on windows seven but when I want use the web application desginer or query designer, the programs don´t run. someone can help me ?