How to use/create icons with transparent background ?

I would like to use icons with transparent background on JButtons, but I can't find how to do it. Until now, I've been using the ImageIcon class to create icons from GIF images. These images were created with MSPaint (sorry, I don't know what I could have used instead of that). Here is how I create my buttons :
bPencil = new JButton(new ImageIcon("Pencil.GIF"));What could I do to make the background transparent and/or what software could I use instead of M$Paint ?
P.S. : sorry if my question seems silly, but I'm a newbie in Java coding...

Transparent images are GIF (256 colours) and PNG (true-colour, half transparency).
You can store the image with your code, *.class files. You then even can deliver all inside a clickable, executable .jar file.
This kind of usage is called "resource," and hence use getResource like this:
    java.net.URL imgURL = getClass().getResource("pencil.gif");
    ImageIcon icon = null;
    if (imgURL != null) {
        icon = new ImageIcon(imgURL, description);
    }You can use paths.
There exist versions of MSPaint that easily loose their transparent colour on saving.
For GIFs try internet palettes, or try to save as PNG (recent version).
Start with a transparent image from elsewhere.

Similar Messages

  • Creating animations with transparent backgrounds?

    I'm running into some problems when using After Effects to create animations with transparent backgrounds for Keynote...
    I use animated gifs and short quicktime movies with uniform backgrounds as source files, use color keying to take out the backgrounds, preview them to see if they look OK, render the results as RGB+alpha, and... they don't show up as transparent in Keynote. They work in Powerpoint, however. I've tried outputting as .mov, as .gif, as premultiplied vs straight alpha... no joy. Can someone explain (or point me to an explanation) of how Keynote differs from other programs in its handling of transparency? What am I missing?

    Using a TYPE_INT_ARGB BufferedImage worked beautifully. I had played around with Image for hours, but it never occurred to me that BufferedImage would be needed. :)
    many, many thanks,
    Steven

  • Using animated gifs with transparent background.

    Hi guys,
    Keynotes 6.2.
    I have been onto apple support with this problem.
    I add a transparent animated gif to my project.
    It show as a movie correctly in the presentation but when exported as quicktime or HTML the movies fail.
    We eventually found out that quicktime does not support animated gifs. ( support.apple.com/kb/ht3775 )
    So I exported the animation onto a folder with all the frames separately and brought them into final cut pro.
    I then followed these tutorials on how to export with transparent background. ( http://provideocoalition.com/mspencer/video/fcp-x-and-alpha-channels and http://www.larryjordan.biz/fcp-export-transparency ).
    I now have a quicktime movie that if I bring back into Final Cut Pro it has a transparent background.
    However when I bring into keynotes it still has a black background. (presumably keynotes does not recognise the  Apple Prores 444).
    Any ideas how I can achieve what I need. ?
    I am using a program called crazytalk animator and can output with transparent background. Animated Gif or a series of image stills BMP, JPEG, TGA or PNG.
    Cheers
    SteveW

    This has been an ongoing issue for me since I switched from Powerpoint to Keynote. Most of the animated gifs with transparent backgrounds that I used with Powerpoint are no longer transparent in Keynote. You may want to search for those earlier threads on this topic...
    To summarize: I've had to open up my animated gifs in After Effects and use the Color Key effect to restore transparency, with mixed success.
    Good luck!

  • How to create Icon with transparent shape inside

    Hi All
    I would like to create a vector icon with a transparent shape inside it, like in this image below:
    So everything should be transparent except of course the dark grey area...
    How Do I do that?
    Below is a link to my AI file if you want it:
    AI File
    Thank you!

    With just the book icon selected, release clipping mask. Select both items, Minus Front.
    Is that what you did? What Illy version?
    this is what I get, green rectangle was placed behind to see the "hole."
    Mike

  • How to I move gif with transparent background to jpg background?

    I am using the Master Squite CS 5.5 trail on Windows XP Pro with SP3.  I am not a Photoshop expert, but have done a fair amount for work with iit.
    I am trying to build some headers for websites and I know how to combine JPG images and text to ceate a header image.
    Now I have a couple of logos that I got in JPG format, converted them to GIF and made the backgrounds transparent.
    The "Move" tool doesn't seem to allow me to drag and drop a GIF image with a transparent background onto a JPG header background.  I tried converting the JPG header background to a GIF image too, but it won't let me move the transparent image to this background.
    I really need to get this to work somehow to create the professional look I want.
    Thanks!

    Your mistake is in assuming you need GIF anywhere in the process.
    Try this instead:  Paste your logo JPEG over the background as a separate layer, then remove the pixels you want to be transparent by either Deleting them or Masking them.
    -Noel

  • How to make animations float with transparent background

    I am taking a graduate course in adv. web design for an ed
    tech program at a university. Neither my instructor nor anyone else
    in my class knows how to get Flash animations to have a transparent
    background, or even if this is possible. On behalf of us all, I am
    wondering if it is possible to create a Flash animation without a
    background--or with a transparent background, and then superimpose
    it onto a web page so that the web page's background shows through
    all but the animated part. We are using Flash 8. If it is possible,
    can someone please tell us how to do it? I have seen web pages
    where the animations float over the web page. Are these animations
    made with Flash or with another program? Thank you!

    Yes, it's easy, but haven't done it for a while, and not
    since all the new ActiveX stuff on MS IE requires Java Script to
    make the dotted outline go away.
    To do it well takes a combination of Flash with the
    publish-settings HTML Window Mode set to Transparent Windowless,
    and tightly-designed CSS with your animation positioned in a div
    that lies or overlays the exact place on the HTML page where you
    want it. You can even have it scale to the entire visible window,
    which can be quite cool. I did one for the holidays with snow
    falling over an HTML page. It can block lnks from working, though,
    so you can have the div (and animation) disappear when the
    animation is done.

  • How to export animated gif with transparent background and glow effect?

    I've been having issues lately with creating animated gifs in flash. I finally figured out a way to export a gif with a transparent background but I'm now having an issue with it again because I'm using a glow effect. When the gif is exported the glow effect changes into a very poor quality and becomes less of a glow and more like a solid color. I've even exported a png sequence from flash and put it into photoshop then created a gif from there but I'm still having the same issue. Is there anyway I can properly export this in gif form so the quality is the same as when I test it in flash?
    I've provided an image of what my issue looks like and the settings (I've messed around with the settings and this is the best I can come up with) . This is in photoshop but the result is similar in flash. The left one is what it originally looks like and the right is what it will look like after exporting. As you can see as I said before the glow changes into more of a solid color kind of like a border. Any help would be greatly appreciated, thanks in advance!

    A GIF is limited to 256 colors while a glow effect likely wants to tie up thousands (let's just say 'lots') of variations of tone.

  • Using PNG files with transparent background - Please Help

    I just purchased Elements to do a very specific task which I can’t do in Aperture. I am a former photoshopper (V.5) and excited to be back.
    I am doing a book/scrapbook and the majority of my text will be my own handwriting. I use white paper and black ink and I scan in at the highest settings. My goal is to create my handwriting on a transparent background so I can place it in my book as I choose. For this specific project (which is very large in scope) I wanted to keep my image/file management within Aperture.
    So I import my file (of my handwriting) from Aperture and successfully saved with a transparent background. Adobe said I had to save it as a PNG file. I noticed when I saved in Photoshop there was a warning saying I had to save as a copy.
    Aperture does not see the file when I try to import it back. My interchange between aperture and photoshop is fine otherwise. This problem only seems to be with “unflattened” layered images. When I flatten the image it is recognized by Aperture, but I lose the transparent background in Photoshop.
    If anyone sees flaws here or has a suggestion to “isolate” and save my personal handwriting image files I would greatly appreciate it. Thanks!

    Would probably work best if you first export from Aperture as PSD (if possible, like Lightroom) and then save to preserve layers.
    From the PSD save as PNG24 rather than PNG8 which is better for preserving transparency.

  • How to use create ExchangeService with TokenCredentials?

    I wanted to use the EWS Managed API in my Office Mail App.  I would like to obtain the credential from the mailbox in JS and then pass it to the code behind to create the
    Microsoft.Exchange.WebServices.Data.ExchangeService
    object.  I was able to create the object if I use the WebCredential with username and password, but I would like to use the credential in the mailbox, so I don't have to ask the user for username and password again.  I saw that there
    is an identitytoken available in JS
    Office.initialize = function () {
    // Checks for the DOM to load using the jQuery ready function.
    $(document).ready(function () {
    // After the DOM is loaded, app-specific code can run.
    _mailbox = Office.context.mailbox;
    _mailbox.getUserIdentityTokenAsync(getUserIdentityTokenCallback);
    _Item = _mailbox.item;
    $(mailID).val(_Item.itemId);
    $(url).val(_mailbox.ewsUrl);
    function getUserIdentityTokenCallback(asyncResult) {
    $(token).val(asyncResult.value);
    so, I tried to use this token to create the ExchangeService object and get the mail item like below.
    public Item Test(string email, string token, string mailID, string url)
    ServicePointManager.ServerCertificateValidationCallback = CertificateValidationCallBack;
    exchangeService = new ExchangeService(ExchangeVersion.Exchange2013_SP1);
    exchangeService.Credentials = new TokenCredentials(token);
    exchangeService.TraceEnabled = true;
    exchangeService.TraceFlags = TraceFlags.All;
    exchangeService.Url = new Uri(url);
    Item item = null;
    try
    item = this.GetEmail(mailID);
    catch (Exception ex)
    string a;
    return item;
    public Item GetEmail(string mailID)
    if (!string.IsNullOrEmpty(mailID))
    Logger.ErrorLog("GetEmail: mailID =" + mailID);
    ItemId itemID = new ItemId(mailID);
    Item emailItem = Item.Bind(exchangeService, itemID);
    emailItem.Load(new PropertySet(Exchange.BasePropertySet.FirstClassProperties, ItemSchema.MimeContent));
    return emailItem;
    else
    throw new Exception("mailID is null or empty");
    I get the following exception:
    "The request failed. The remote server returned an error: (401) Unauthorized."}
    on  Item emailItem = Item.Bind(exchangeService, itemID); in the GetEmail function.  How do I properly retrieve tokens in JS in the mailbox to create a EWS Managed API ExchangeServices?
    Thank, Hilda

    Ok, I got it to work with "getCallbackTokenAsync".  Use the token that this function delivers and attach to Exchange services with it like so... (I persist the token I receive for all future communications in a global var)
    try
    ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2013)
    Credentials = new OAuthCredentials(in.cnxToken),
    Url = new Uri(in.uriEws)
    ItemId itemID = new ItemId(in.itemId);
    message = Item.Bind(service, itemID);
    catch (Exception ex)
    eaResp.status = "Error: Exchange GetItem failed.\n" + ex.Message.ToString();
    return eaResp;

  • How to read a picture with Transparent Background?????

    i read a png file - a picture with transperent back ground - with READ PNG File and display it in my program using a Draw Flattened Pixmap function.
    i get a very dark background- black coulour- in the picture created.
    How can i resolve this problem???
    Please give your suggestions
    Many thanks in advance
    RENN
    Kudos always welcome for helpful posts

    continue discussion here

  • How can I create pages with different backgrounds

    Hello,
    I'm creating flash site which will have different backgrounds for each page. I'll load the individual pages with "MovieClipLoader." My understanding about MovieClipLoaders is that, it doesn't matter the background of your mc, the page to which you are loading will maintain it's background.
    How do I achieve that?
    Thank you!

    Hello,
    Thanks for the reply, I think it's a very good suggestion. I'm going to try it out and I hope to fill you in.
    Thanks once again.

  • How to use created report with cube

    Hi Friends,
    I have created a report based on an Cube.
    How can I view the report?
    I tried to open in Report viewer, but it says unsuported object.
    Any help is appreciated.
    RG. Jimbob

    Hi
    the CR Server does not support SAP data source neither. I would suggest to install either BO Enterprise or BO Edge, install the int.Kit for SAP (both on your server and on the machine your CR2008 designer runs on) and build your reports based on SAP access drivers delivered with the int.Kit.
    You can find more information about the installation of the intKit and how to build and publish your reports in Ingo's blogs:
    BusinessObjects and SAP - Overview
    /people/ingo.hilgefort/blog/2008/02/07/businessobjects-and-sap-part-i
    Crystal Reports and BI Queries
    /people/ingo.hilgefort/blog/2008/02/19/businessobjects-and-sap-part-2
    Install Part #1
    /people/ingo.hilgefort/blog/2008/09/17/businessobjects-and-sap--installation-and-configuration-part-1-of-4
    Install Part #2
    /people/ingo.hilgefort/blog/2008/09/17/businessobjects-and-sap--installation-and-configuration-part-2-of-4
    Install Part #3
    /people/ingo.hilgefort/blog/2008/09/17/businessobjects-and-sap--installation-and-configuration-part-3-of-4
    Install Part #4
    /people/ingo.hilgefort/blog/2008/09/17/businessobjects-and-sap--installation-and-configuration-part-4-of-4
    SAP Authentication
    /people/ingo.hilgefort/blog/2008/09/19/businessobjects-and-sap--configure-sap-authentication
    Publishing part 1
    /people/ingo.hilgefort/blog/2008/09/23/businessobjects-and-sap--publishing-of-crystal-reports-part-1-of-3
    Publishing part 2
    /people/ingo.hilgefort/blog/2008/09/24/businessobjects-and-sap--publishing-of-crystal-reports-part-2-of-3
    Publishing part 3
    /people/ingo.hilgefort/blog/2008/09/24/businessobjects-and-sap--publishing-of-crystal-reports-part-3-of-3
    XC, CR and LO Part 1 of 4
    /people/ingo.hilgefort/blog/2008/10/03/businessobjects-and-sap-part-1-of-4--creating-a-xcelsius-dashboard-on-top-of-sap-bi
    XC, CR and LO Part 2 of 4
    /people/ingo.hilgefort/blog/2008/10/07/businessobjects-and-sap-part-2-of-4--creating-a-xcelsius-dashboard-on-top-of-sap-bi
    XC, CR and LO Part 3 of 4
    /people/ingo.hilgefort/blog/2008/10/07/businessobjects-and-sap-part-3-of-4--creating-a-xcelsius-dashboard-on-top-of-sap-bi
    XC, CR and LO Part 4 of 4
    /people/ingo.hilgefort/blog/2008/10/10/businessobjects-and-sap-part-4-of-4--creating-a-xcelsius-dashboard-on-top-of-sap-bi
    Technical Material
    /people/ingo.hilgefort/blog/2008/11/19/businessobjects-integration-with-sap-netweaver-bi--technical-material
    Regards,
    STratos

  • How to draw a box with transparent background ?

    Hi there,
    I want to do an effect where after I display the text, there will be drawing effect where it draws a rectangle around the text ?
    During the days of Final Cut Express, I bought plugins from LiveType, it has effects to do this.
    But dow to I do this now in FCPX ?
    Thanks

    Thanks Jim,
    It is a good tips that LiveType still works on Maverick !
    Now I gotta ransack my store room to look out for the LiveType dvd/disc ...
    Motion ? I thought Motion is very difficult to learn ... more difficult than After Effects ?
    Ok, i better look out for some tutorials on Motion then ... Motion can integrate with FCPX ?
    I just checked, the Motion that I have is Ver 5.0.7 (got this as a birthday gift). Is this compatible with Maverick ?
    Thnaks
    Jim Wanamaker wrote:
    A couple of thoughts. Livetype still works in Mavericks although I don't know about your plugins. You would have to try them. Obviously you can not send a livetype project to FCP X, but you could design your title and export it and then import to FCP X. That should work although you couldn't make any changes in FCP X. A second thought is to use Motion if you have it. You can easily create a title in Motion to do what you want by opening a title template, add and format text. Then add a bezier shape for your rectangle and use the write on behavior. Very simple to do.

  • Creating images with transparent backgrounds

    Hello all,
         I've got a swing app drawing program where you have multiple layers, with each layer containing many components that can be moved and resized. So, in the most simple form, I have a JComponent which has a list of images to be drawn. If I setOpaque to false, the background (and other layers) can be seen through the empty spaces of this component, as expected.
         The problem was that once the number of components grew above 300, performance started suffering. So I decided to optimize it. Instead of redrawing all of the components each time I need to paint, I 'cache' that layer by drawing all of the components in a layer onto an Image's graphic. Then I do a 'graphics.drawImage(cachedImage);' in my main JComponent's paint method.
         Very fast, but now I can't see the background (and other layers) beneath the topmost one.
         So now the question. Is there a way to preserve the 'setOpaque(false)' call when painting to the image. To be more specific, I want an image that is transparent except for graphics that I've drawn into it. I've even tried first filling the image with a 'new Color(255,255,255,0)', but I'm still getting an opaque image.
    thanks for any help,
    Steven     
    A Dynamic character with an ability to survive certain death, and a questionable death scene leaving no corpse? Face it, we'll never see her again... - Riff from Sluggy Freelance

    Using a TYPE_INT_ARGB BufferedImage worked beautifully. I had played around with Image for hours, but it never occurred to me that BufferedImage would be needed. :)
    many, many thanks,
    Steven

  • Fancy zoom pics with transparent background

    hello,
    i have successfully setup fancy zoom in my iweb site (based on the various tutorials found on the web), but there is one problem i'm having. the pics i'm using are .png with transparent background and the background renders properly in safari. however in firefox the background always shows as white. i have double checked my pics and i believe they are fine and again in safari the background renders transparent, but i can't figure out what's causing the background to show white in firefox? i'm guessing it's something in the css maybe but i'm not sure. any ideas at all? i have noticed some people posting in the forum regarding fancy zoom so hopefully someone know... note: the zooming part is working fine in either browser...
    thanks,
    rick

    I love you!!!
    Well, you know what I mean.
    It worked, thank you, thank you, thank you.
    I figured it was a simple solution, and it was. Thanks Varkgirl.

Maybe you are looking for

  • Re-connecting Elements 9 to a New Location

    I have copied all my images - around 500Gb - to a new (larger) external Hard Drive.  The transfer took about 16 hours. Can anyone advise how I move/reconnect the Adobe Elements catalog to point to the new location? The answer I'd not like to hear is

  • Trouble recording a guitar line in.

    Hey guys, I'll try to make this as short and detailed as possible. I plug my guitar into my computer using the Line In, using a ME-70 as a preamp, but the computer doesn't register any sound. Let me try to explain how I'm setting it up: -My guitar is

  • Bug editing report attributes in Firefox

    Has anybody logged this problem before? It occurs in Apex 2.2 and 3.0 and FireFox 2.2, but I cannot reproduce it using IE6. Open a page with a report region and go to the report attributes. Look at the Headings Type and remember the setting. Edit one

  • Importing RAW from Nikon 1

    I recently bougth a nikon 1 camera and took photos using RAW extension. When I first imported to Apperture, I could saw the pictures!!! But when the imports ended and I erased the files from the SD Card, photos are still there in Apperture Library bu

  • Firefox is opening new tabs on corrupted sites on it's own

    I am using Firefox on a Samsung NC10 running XP Professional. About 4 weeks ago I was hit with a fake Malware virus, which I have successfully removed using Malwarebytes and Registry Mechanic. Since then Firefox is periodically opening new tabs for n