Is it possible to change the look of an ImageIcon? (grey it out)?

I'm making this card game. Ive got a sequence of cards (the player hand) in a JLayeredPane and theyre displaying nicely. Theyre displaying just as the card look in microsoft hearts. Ive added mouselisteners to all of the cards and what I want to happen is when a card is clicked (pressed and not released) I would like to modify the imageIcon in some graphical way so as to indicate that the card is being selected. Preferabbly by the card going dark, grayscale.
Is there any possible way to do this? if so how would this be done?
I know how to implements the mouselisteners etc. I need help withthe imageIcon image specifically. There does not seem to be any method for ImageIcon which does what I need.

Here's a quick demo. It's a one-line operation.
import java.awt.*;
import java.awt.color.*;
import java.awt.image.*;
import java.net.*;
import javax.imageio.*;
import javax.swing.*;
public class Test {
    public static void main(String[] args) {
        EventQueue.invokeLater(new Runnable(){
            public void run() {
                launch();
    static void launch(){
        try {
            URL url = new URL("http://blogs.sun.com/roller/resources/jag/SouthParkJAG-small.png");
            BufferedImage image = ImageIO.read(url);
            ColorSpace csGray = ColorSpace.getInstance(ColorSpace.CS_GRAY);
            BufferedImage gray = new ColorConvertOp(csGray, null).filter(image, null);
            display(image, gray);
        } catch (Exception e) {
            throw new RuntimeException(e);
    static void display(Image... images) {
        JPanel cp = new JPanel();
        for(Image image : images) {
            cp.add(new JLabel(new ImageIcon(image)));
        JFrame frame = new JFrame ();
        frame.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE);
        frame.setContentPane(cp);
        frame.pack();
        frame.setLocationRelativeTo(null);
        frame.setVisible(true);
}This just converts to grayscale with making it look "disabled" -- washed out.

Similar Messages

  • Is It Possible To Change The Look Of The PayPal Button?

    Can I make a PayPal button look different? I want the same function only to make it as a proper button with roll over effect.

    I mean just changing the image of the button.

  • How to change the look of the ESS Overview page

    Hi,
    We are implementing ESS/MSS and would like to change the look (font size and color, background color, ...) of only the Overview page (Area Group Page). From what I understand when a theme (css) is used it is applied to an entire Portal Desktop, not to a single page. And since the Overview page is a Web Dynpro application (part of the Floor Plan Manager), it doesn't seem possible to change the look besides using themes.
    Of course we would like to keep the possibility to configure this page using IMG so rebuilding it from scratch is not really an option.
    Any idea how this could be done?
    Thanks,
    Martin

    Thanks Srikanth,
    As far as I know it is not possible to change the font size or color of the overview page using IMG.
    But I found a way of applying a theme to a single Web Dynpro application running inside the portal, like the Overview page. You need to specify the theme in the iView property editor using the Application parameter sap-cssurl. The feature is there and more or less documented, the only problem I am still not able to make it work, the portal theme is always used. It is also possible to change the theme of <i>all</i> the Web Dynpro applications running on the server (by changing WD a property in the J2EE Visual Admin, see this <a href="https://forums.sdn.sap.com/thread.jspa?threadID=367022">post</a> for example) but this is not what I want to do.
    Regards,
    Martin

  • Can I change the look of the mouse pointer?

    I was wondering if it’s possible to change the look/style of the mouse pointer just like you can in Windows?

    Unsanity's Mighty Mouse is the only one I know of that can.
    They also have this page of cursors they've already made you can use with the program.

  • Changing the looking like of JInitiator?

    Is it possible to change the "looking like" of the Jinitiator-Applet???
    for example another icon.
    Also the text:
    "Oracle Developer Forms Runtime - Web" is not really usefull. Also the "Oracle Developer Server"-image while loading the fmx is not usefull ... I would like to change that all.
    Does anybody knows how?
    ... or simply tell me, that it is not possible = (

    you can add some parameters to your html file to control the way forms displays thing
    splashScreen=NO will eliminate the splash image
    webformsTitle can control the title.
    you can find a list of all of them on metalink.oracle.com :
    Note:118632.1

  • Is it possible to change the brown leather look in 10.7 to something else?

    Is it possible to change the brown leather look in 10.7 to something else?

    Northscape,
    Try:
    1. MacNix: Change Mac OS X 10.7 Lion iCal and Address Book Skins from Leather to Aluminium - Easy Method
    2. How to remove the faux leather in iCal for OS X Lion | Simple and Usable

  • Is it possible to change the chart of accounts in Oracle Financials?

    Dear Colleagues,
    Is it possible to change the chart of accounts in Oracle Financials?
    Thank you in advance.
    Andrey

    It is not an easy change. Oracle typically recommends against it but sometimes company structure or processes change so much that you are forced to do it.
    Take a look at http://www.vantagesolutions.com/media/SCOUG_May_2004.pdf as well as http://www.erpstuff.com/forums/topic.asp?TOPIC_ID=6381.
    If you google "change oracle chart of accounts", you will find some more hits as well. This is a big project.
    If you other business reasons to do a reimplementation, then changing COA as part of that will be very easy.
    For a lot of companies debating between reimplementation and upgrade, a need to change COA becomes the last straw in favor of reimplementation.
    Hope this helps,
    Sandeep Gandhi

  • Is it possible to change the URL of an application?

    Hi All,
              I was working with the oracle apex and created few applications almost a year back, due to my higher studies there is a gap with the tool..and finally I am in.
    Am planning to create an application which will be similar like a personal website.My doubt here is ..whether it's possible to change the URL by keeping a simple one which includes my name also
    instead of having this big..
    http://apex.oracle.com/pls/apex/f?p=10221:1:116416608594529
    I can understand that the whole URL describes the appln no,page no and session ID but its my doubt possible or not..If possible then how to proceed?
    Thanks
    with Regards,
    Ramya.

    My doubt here is ..whether it's possible to change the URL by keeping a simple one which includes my name also
    instead of having this big..
    http://apex.oracle.com/pls/apex/f?p=10221:1:116416608594529
    I can understand that the whole URL describes the appln no,page no and session ID but its my doubt possible or not..If possible then how to proceed?
    If you are just looking for a nice and short URL to start your application, why not just use a URL shortener service like goo.gl ?
    Just put in your long URL and it will create a nice and short URL for you... for example, the above URL is now http://goo.gl/FijYxn
    - Morten
    http://ora-00001.blogspot.com

  • ** Is it possible to change the IP of the existing Technical System in SLD?

    Hi Friends,
    I want to do RFC to RFC scenario. When I try to import the RFC from the Business System, RFC is not imported. When I looked the corresponding technical system in the SLD, it is having the old IP address. That's why I am not able to import. So, is it possible to change the IP of the existing technical system in the SLD ?
    Kindly reply.
    Kind Regards,
    Jegatheeswaran P

    Reason being : We can associate n business syatems with one tech system with and we configure the scenarios via business systems which itself uses Tech system , if we will make changes in tech system later on it will affect the other scenarios also which are  using the same tech system

  • Is it possible to change the position of beining of text in a standard report

    Hi,
         I am wondering wether it is possible to change the position of the test (the starting point) in a standard report. I would like to print a label with different texts at different positions. If its not possible in a standard report is there any other way to do it.
    Thank you,
    Mudda.

    Hi Mudda, I don't see any way myself to set any particular starting position for your text. It looks like the best way to emulate this behavior would be to add a new line with lots of tab characters or spaces to place your new text at a specific offset from the left. You can also use Append Table to Report and wire in a 2D string array with only a few positions filled in with your various text labels as shown below. This will space text labels pretty well across the page. Try it out and see if it works for you. You could be more clever and build the 2D array programmatically if you wanted more control over position.
    Message Edited by Jarrod S. on 06-02-2006 05:37 PM
    Jarrod S.
    National Instruments
    Attachments:
    Set_Report_Position.JPG ‏69 KB

  • Is it possible to change the user status of a TECO Order

    Hello Folks
    Is it possible to changes the user status of a TECO Order?
    I have tried to change it using the FM 'STATUS_CHANGE_EXTERN'. Its working fine for NON TECO Orders but not for TECO Orders.
    On the other hand I was able to manually change the user status for a TECO Order in transaction IW32.
    I need to change the user status from NFBK to FBK.
    Please provide some inputs for the same.
    Thanks n Regards
    Ramesh

    The simple way is via the Internationalization settings via ARD or RDP or Screen Sharing, either via System Preferences or (if enabled) via the menu bar. If you're looking for a lower-level approach, there's not AFAIK a direct command for this. As for one possible approach, might [threadID=2106201|http://discussions.apple.com/thread.jspa?threadID=2106201] help?

  • Is it possible to change the owning schema when generating datetime dimensions in the datasource?

    When creating a date time dimension using the dimension wizard and generate schema wizard, i would like to be able to change the owning schema from dbo to something else. The field is greyed out and I am unable to change it.
    Is it possible to change the owning schema when generating datetime dimensions in the datasource?

    Hi rkbjr,
    Thank you for your question.  
    I am currently looking into this issue and will give you an update as soon as possible. 
    Thank you for your understanding and support. 
    Thanks,
    Bin Long
    TechNet Subscriber Support
    If you are TechNet Subscription user and have
    any feedback on our support quality, please send your feedback here.
    Bin Long
    TechNet Community Support

  • Is it possible to change the default language of a computer remotely?

    Hi
    Is it possible to change the default language of a computer remotely?
    We have Apple Remote desktop and network home folders with managed prefs but i don't seem to be able to use either of these to change the default language of all of our macs to "British English".
    is there a UNIX command that can do this?

    The simple way is via the Internationalization settings via ARD or RDP or Screen Sharing, either via System Preferences or (if enabled) via the menu bar. If you're looking for a lower-level approach, there's not AFAIK a direct command for this. As for one possible approach, might [threadID=2106201|http://discussions.apple.com/thread.jspa?threadID=2106201] help?

  • Possible to change the xml output of the Inbound Interface?

    Hi All,
    I hav a scenarion where a third party system receives the XML from XI. the output of the xml from XI looks as follows:
      <?xml version="1.0" encoding="UTF-8" ?>
    - <ns0:Messages xmllns:ns0="http://sap.com/xi/XI/SplitAndMerge">
    <ns0:Message1>
    - <ns1:WMSItalyItemReplication xmlns:ns1="http://cpe.com/cpe_ftp_wms/ItemReplication">
    - <item_dl dt_tm_created="2006-06-29 09:02:23">
    - <item action="" owner_id="CIB" itm_num="3143832ZZ99">
      <itm_desc>Ageflex ACM50 Test</itm_desc>
      <unt_dol_val>1</unt_dol_val>
      <lic_ctrl_flg>Y</lic_ctrl_flg>
      <lot_ctrl_flg>Y</lot_ctrl_flg>
      <shelf_life>999</shelf_life>
      <product_life>999</product_life>
      <incubate_prd>0</incubate_prd>
      <hold_ord_flg>N</hold_ord_flg>
      <kit_type>N</kit_type>
      <prelabel_flg>N</prelabel_flg>
      <rcv_only_flg>N</rcv_only_flg>
      <convey_flg>N</convey_flg>
      <front_flip_flg>N</front_flip_flg>
      <pick_shp_bp>N</pick_shp_bp>
      <side_flip_flg>N</side_flip_flg>
      <rotate_flg>N</rotate_flg>
      <itm_udef_a />
      <itm_udef_b />
      <itm_udef_c>Constant1</itm_udef_c>
      <itm_udef_d />
      <multi_conf_flg>N</multi_conf_flg>
      </item>
      </item_dl>
      </ns1:WMSItalyItemReplication>
      </ns0:Message1>
      </ns0:Messages>
    And the output that the third party expects is as follows:
    <?xml version="1.0" encoding="UTF-8" ?>
    <!DOCTYPE item_dl SYSTEM "http://localhost/dtd/item_dl.dtd">
    <item_dl><item><itm_desc>Ageflex ACM50 Test</itm_desc>
    <unt_dol_val>1</unt_dol_val>
    <lic_ctrl_flg>Y</lic_ctrl_flg>
    <lot_ctrl_flg>Y</lot_ctrl_flg>
    <shelf_life>999</shelf_life>
    <product_life>999</product_life>
    <incubate_prd>0</incubate_prd>
    <hold_ord_flg>N</hold_ord_flg>
    <kit_type>N</kit_type>
    <prelabel_flg>N</prelabel_flg>
    <rcv_only_flg>N</rcv_only_flg>
    <convey_flg>N</convey_flg>
    <front_flip_flg>N</front_flip_flg>
    <pick_shp_bp>N</pick_shp_bp>
    <side_flip_flg>N</side_flip_flg>
    <rotate_flg>N</rotate_flg>
    <itm_udef_a></itm_udef_a>
    <itm_udef_b></itm_udef_b>
    <itm_udef_c>Constant1</itm_udef_c>
    <itm_udef_d></itm_udef_d>
    <multi_conf_flg>N</multi_conf_flg>
    </item>
    </item_dl>
    Observe the first two lines of the second output.
    I tried to generate the second xml using a java mapping. and it is working fine when i test it in the Interface mapping's test tab. but it is not working when i test the scenario end to end. It is giving some runtime error.
    is it possible to change the namespace, etc in the output of the XML coming out of XI? if v change those namespace stuff, does XI recongnise the message and send it to the appropriate reciever?
    Please suggest me any solution.
    any help wud b greatly appreciated.

    The first XML is a Split msg XML..Where there are multiple messages within a single XML document..Thats why u have a <ns0:Messages xmllns:ns0="http://sap.com/xi/XI/SplitAndMerge">
    <ns0:Message1>
    Tags..
    Recheck what ur target system needs are & change ur mapping in XI.

  • Is it possible to change the settings in AR Properties Advanced tab with Adobe Acrobat XI?

    I noticed when I went to print a PDF double sided, that despite the following the guidelines from Adobe on this process, it still printed single sided.  I checked the properties of the PDF itself and on the Advanced tab, the DuplexMode was set to Simplex and was greyed out.
    Is it possible to change the settings in that tab with Adobe Acrobat XI?
    Regards
    Sharon

    Dear Sara
    Thank you for your reply.
    I have two printers, both support automatic duplexing.  Any PDF we receive
    or create we are unable to print double sided on our mac mini¹s.  I didn¹t
    make it clear in my question that we were fine on Windows XP, but, having
    recently changed to Mac have encountered this frustrating problem.
    I did a lot of research prior to recording the question and it appears I am
    not the only one who has come across this problem, and I have followed the
    guidelines that Adobe promote on their website to be able to print double
    sided, which doesn¹t work on the mac mini Osx Mavericks.
    Because the Properties, Advanced tab has ³Print Dialog Presets² that are set
    to simplex  and greyed out I took that to mean that no matter what printer
    settings I make, and I think I¹ve gone through all that I can, the pdf will
    not print double sided on Mac but will on XP.
    Sorry this isn¹t the reply you must have been hoping for and look forward to
    receiving further advice in regard to this matter.
    Regards
    Sharon

Maybe you are looking for