How to change an icon of a button

hi guys,
i want to change the icon of a button when it is click
how can i do it?
thanks

You register a listener for that button, e.g.:
button.addActionListener(new...)
Then add code to the listener class:
button.setIcon(new...)
If you've not come across listeners yet though, you'll need to explore these a bit first.
Andy.

Similar Messages

  • How to change the icon of the news in Portal?

    Do you know how to change the icon of the news in Portal?
    I use NewBrowser to Browser the news, but I think the Icon of the News is not good,I want change it ? what should I do?
    Thanks for your help!

    Hi,
    if you are talking about the NewsBrowser of Knowledge Management (Content Management -> Explorer -> News), you should see a button "Edit" on the right side of the news.
    Press this button and fill in a new URL in the input field "Image URL". After saving the new settings, the new image should be displayed.
    Kind regards,
    Ralf

  • How I change the icon for iTunes songs?

    When I drag iTunes songs onto my desktop the icon is white with a gray iTunes icon. How can change this icon for all of my iTunes songs?

    Thanks Patrick. I used Control-Click on the actual audio file on my desktop opened the Show View Options menu and turned off the icon preview option. That changed my icons from gray with a white background to red with a white background which is exactly what I wanted.  You pointed me in the right direction. Appreciate it.

  • 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 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 Application Icons

    Does anyone know how to change the Icon on an application that iTunes shows the Artwork, but I can't copy or paste it to change icons. Any thought's?

    You can not change the icon for an application.

  • How to change status icons in Kopete?

    Default icons are really bad. There is an option to change smilies, but I can't find the option how to change status icons (online, offline, etc.).

    I think you'll have better chance of getting an answer for this on forum.kde.org.
    Or you could search KDElook for special kopete icons...

  • 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");
    }

  • How to change the movie clip a button links to???

    I am working on a website in Flash that had already been
    designed by someone else. There are a number of buttons across the
    website that are linked to the same symbol. Those buttons link to
    movie clips, in the button's actions, that pop up as small windows
    providing more information in regards to the button clicked. The
    problem is that I cannot figure out how to properly change the link
    association between button and movie clip.
    Here is the action script for one of the buttons:
    on (release) {
    _root.scrHEIGHT=100
    _root.scroller.scroller.gotoAndStop(2);
    _root.scroller._x = 100;
    _root.scroller._y = 150.7;
    _root.TM_title = "About Chris Smith";
    _root.READ = 3;
    When I change the number after "root.READ =" it will change
    it to another movie clip but I how do I know what that association
    is based on? For instance if I make a duplicate movie clip how can
    I make the above script link to it? Also, what exactly does that
    last line in the above script mean? When I tested various numbers,
    like 3 and 6, they would link to the same movie clip.
    Please help! This is driving me crazy!
    Thanks!!!

    Hi,
    buttons can be defined with static icon/text, or dynamically via a variable (containing @08\Qtooltip@text for example). You choose the pushbutton type when you define your button using the screen painter. For the dynamic definition, you must tick the "output only" checkbox, enter a global variable name, that you'll fill in your program, preferably using ICON_CREATE function module.
    BR
    Sandra

  • How to change the text of a button dynamically in module pool

    hi gurus,
    how to change the text of button dynamically

    Hi ,
    Declare a variable in TOP Include with your button name.
    Example : P_BUTTON(20) TYPE C.
    Place button with name P_BUTTON on you screen. Do not forget to mark it as "Output Field". [ Double click on button, Attributes --> Program tab --> tick "Output Field".
    In you PBO / PAI , whereever you want to change your text -
    Assign value to P_BUTTON.
    Example -
    iF COND1..
    P_BUTTON = 'EDIT'.
    ELSEIF COND2.
    P_BUTTON = 'DISPLAY'.
    ENDIF.
    Regards,
    Mohaiyuddin

  • 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 do change my icon from i photo back to color

    how do i change my icon from iphoto back to color

    What icon? Do you mean the icons on the left hand pane of the iPhoto Window? You can't.
    IPhoto menu -> Provide iPhoto Feedback and let them know what you think.
    Regards
    TD

  • How to change windows icons

    Hİ, 
    İ have apple icons and I would like to change windows 7 icons. 
    How can I do?
    subject edited

    you may need to install 3rd party applications to change the icons.
    which operation system do you have?
    http://www.microangelo.us/mod.asp

  • How to change screen icons and album art?

    Does anyone know of an application, or otherwise know how to change the screen icons individually, one at a time? I don't mean adding or changing to a different summerboard. Ideally, I'd like to change a few of the icons to either photographs from my files, or to some other photo or drawing of my choosing.
    While I'm asking questions, another one concerns album covers in iTunes. ITunes gives you the ability to add more than one cover to an album but I can't see how to display one other than the original one added. Also, I can't see how to delete a cover once it's been added. I was manually adding cover art for albums that didn't have any and accidently put the wrong picture on one album. Nothing I have been able to do allows me to delete that picture. I did add the correct picture but I can't get it to display. Of course, whatever I do in iTunes I'd like for it to properly sync to the touch.
    Any ideas???

    As for your first question, there is no way of changing icons without jailbraking, which we're not allowed to discuss here.
    To view more than one artwork, simply click on the little arrow appearing in the artwork window.
    To delete it, right-click, Get Info -> Artwork and delete the picture.
    Hope this helps.

Maybe you are looking for

  • Unable to change gl account in purchasing document rows of item type(8.8 ve

    Hi all, In previous sap b1 version ,in purchase document rows of item type -- system allows to change the gl account in rows. But in current 8.8 it is missing ,can any one know how to activate this or is there any logical reason to lock this. Regards

  • How to customize the *Search Help ID* in selecion parameters of FBL5N?

    Hi All, I'd like to know if is possible to customize the Search Help ID in the selecion parameters of FBL5N Thanks for Your Help G.

  • Reverse one item after F110 payment

    Dear ALL: is it possible to reverse one item after F110 payment? it seems when I reset and reverse the payment document for this line item, the table REGUH still has this line items record, if I delete the output for this , it will delete all the ite

  • Deleting specific sequence numbers

    Gurus! I have a scenario in which , I would like to revoke / delete the disabled java.io.filepermissions on a Specific Oracle9i Schema. i tried to delete the KEY values from DBA_JAVA_POLICY / USER_JAVA_POLICY then i came to a point that as these both

  • RFC Errors  in GUIXT

    Hi , How solve the RFC Errors , I am working on GUIXT ,during script deployment in SAP Web Repository ,  I am getting below RFC errors , have no idea about this error. Please give me  directions to sort this out.  Apologies If I am posting this in wr