Change colors in the png - keep transparency

I load a png-file as ImageIcon into a JLabel as setIcon(). A color of the png (generally color white) is defined for transparency, that in the JLabel is represented correctly as transparency.
I want to convert now another dark color in ImageIcon like new Color (0,0,0) into a bright-grey-color like new Color (244,244,244), after the transformation transparency effect should kept by color white.
How can that be done, please?

BufferedImage is the easiest interface to the pixels yes. You can always load your images as BufferedImage instances and pass those to your ImageIcon objects; if you ever want the image back you simply cast the return value of ImageIcon.getImage() to BufferedImage.

Similar Messages

  • How to change color in the title line?

    Hi experts, How to change color in the title line, i show an image for explained better
    !http://img688.imageshack.us/img688/9259/imagenjar.png!
    thanks

    in Views.css file
    file below object.and change border-color as you desired to reflect.
    .TitleTable {
         font-family: arial, helvetica, sans-serif;
         border-width: 0 0 4px 0;
         border-style: solid;
         border-color: #6666cc; ----> change here.
    hope this helps !
    -Niranjan K

  • I need help highlighting an expiration date on my Numbers '09 spreadsheet. I want the text/fill of a cell to change color when the expiration date of an item is within 180 days of the current date.

    I need help highlighting cells on my Numbers '09 spreadsheet.  I want the cell text/fill to change color when the date is 180 days or less from the current date.  I already have a cell with the current date in it.  I also know how to change the fill/text colors.  All the cells have been formatted to show date only.  I am having trouble with the formula.  I can get to the Conditional Formatting menu and select "With Dates" but after that I am lost.  Can anyone help?
    Thank you for any assistance.
    B

    Set a Conditional Format rule as shown in the illustration below. The rule has been applied to all dates in column B of the table.
    Regards,
    Barry

  • I am unable to change colors. The boxes stay grey. Can anyone help?

    When entering text on a photo I can't change colors. I am unable to change colors with the bucket or brush. Any ideas?

    You can try resetting your iPhone. Make sure to make a backup of your data.

  • Using the retouch tool, how do you make it change color? The old iPhoto one did, this one seems to be flesh-tone only, which is not how I need it to be. In old iPhoto, used the local color to blend, it was great.

    Using the retouch tool, how do you make it change color? The old iPhoto one did, this one seems to be flesh-tone only, which is not how I need it to be. In old iPhoto, used the local color to blend, it was great.

    I don't know which old version you're referring to but iPhoto 6's,  7's and 8's retouch tool works exactly the same as iPhoto 9's. The color of the enhance tool's area while applying is a light brown color but the retouch works on any color using the surrounding colors as a basis.
    During retouching:
    After retouching:
    OT

  • IOS 7: Will there be updates to change colors for the Notes

    iOS 7: Will there be updates to change colors for the Notes & Text msgs? The white background washes out the text.

    Nobody here has any knowledge of what Apple may or may not include in future updates.
    You can send feedback to Apple about your wishes though - http://www.apple.com/feedback/

  • Change colors in the calendar

    I saw that there is the possibility to change color to present a variety of calendars.
    My webcal in particular should be on existing services WEBCAL, eg, the lunar calendar.
    I change color, but every time my iPad or iPhone sync, returns the default color!
    What can I do?

    Yep, I just noticed this behavious on my iPhone 4 as well. Built-in calendars ("On My iPhone") stay locked in their colours, but subscribed calendars keep changing theirs. It's quite annoying.

  • Change color of the showDetailItem in panelTabbed in 11G

    Dear All,
    I have to change the color of showDetailItem in panelTabbed from gray to dark blue. But when I am trying to set the color from style the color of whole panel gets changed. I want to change the color of of the tab only.
    Please help its Urgent.
    Thanks in advance.

    I was having this same problem, and found another issue with the scroll bar coloring. The ScrollBar.thumb UI property cannot use a color that has a reduced alpha value.
    I wanted the JList hightlight and JScrollBar thumb to be a lighter version of the background color, but I found that the color.brighter() method returns a color that does not necessarily match the original color very well. For example, if you call it multiple times, the resulting color can be completely different. If I constructed a new color by lowing the alpha value of the original color (using the code below), the JList highlights were perfect, but the JScrollBar thumb had a large black "blob" in the middle of it.
    Color c = this.getBackground();  //"this" refers to a JPanel
    Color cb = new Color(c.getRed(),c.getGreen(),c.getBlue(),50);  //alpha value of 50The only way to get rid of the black "blob" on the JScrollBar thumb, is to use the following line of code where you set this property:
    UIManager.put("ScrollBar.thumb", new ColorUIResource(cb));Unfortunately, the ColorUIResource object does not appear to support altering the alpha value, so it strips it away, leaving you with the darker version of the color (completely negating your efforts to lighten the color).
    Does anyone know how to resolve this issue?

  • How to change color of the caret (text cursor) in a TLFTextField used for input.

    This might be a very simple Question, but I have looked and searched everywhere and don't find how to change the color of the caret in a input TextField.
    any ideas?
    Thank you in forward.
    GV

    This was driving me crazy, too--and the previous answers did not seem to work. I eventually found that if I click one of the data symbols in the graph in exactly the right spot (see below), it selects only the data symbols and not the line. I can tell this because the little selection dots will be around each data symbol, but no selection dots will be on the line between the data symbols - like the graphic in Yvan's answer. Then and only then will the color symbol in the tool bar show the color of the data symbol, instead of the color of the line. I believe that you then have to first click on the color swatch in the toolbar and then select your color (or choose Show Colors and select from the color tool). Just clicking a color in the crayon box, for example, did not seem to work unless I first clicked on the color swatch in the toolbar, then clicked Show Colors on that dropdown, and +only then+ clicked the crayon or whatever.
    _The right spot to click_ seems to be just above the exact center of the data symbol, at least for the diamond shape symbol that I prefer. Sometimes it takes several tries to hit the right spot. If I miss it, the whole line is selected, which is indicated by the little selection dots on the line, between the data symbols. When I click the right spot, those selection dots go away, leaving only the data symbols selected. Then I can change the color, as described above.
    I hope this works for you too.

  • Is it possible to change  color on the line strip/code view in CS6?

    Hello -
    I did some research on this and cant seem to see if this can be done - I was hoping to change the color of the blue line menu on the code view screen.
    Eric

    I take it you're referring to that vertical line in the left hand side of Code View? I don't think it's possible to change the color.  If you disable line numbers (#), it's a bit less noticeable.
    Nancy O.

  • Change color of the scroll bar?

    I am trying to turn my entire application black with white or some light colored text.
    Is there some way I can change the color of the scroll bar?
    Also, if I have a JTable, there is a bright grey border I would like to dim down a bit.
    Any guidance would is appreciated.

    Hi,
    This code will show you the current UI settings.
    If you want to change ie. the scrollbar background use:
    UIManager.put("Scrollbar.background", your Color);
    Hope this helps.
    Regards,
    Matt
    Java Developer Technical Support
    Sun Microsystems
    import javax.swing.UIManager;
    import javax.swing.UIDefaults;
    import java.util.*;
    class UIList {
        public static void main(String args[]) {
            // Groups of item objects
            Vector itemGroups = new Vector();
            Hashtable itemList = new Hashtable();
            UIDefaults uiDefaults = UIManager.getDefaults();
            for (Enumeration enum = uiDefaults.keys(); enum.hasMoreElements(); ) {
                Object setting = enum.nextElement();
                String settingName = setting.toString();
                int dotIndex = settingName.indexOf(".");
                if (dotIndex != -1)
                    settingName = settingName.substring(0, settingName.indexOf("."))
                if (itemList.containsKey(settingName)) {
                    Integer groupNum = (Integer)itemList.get(settingName);
                    Vector group = (Vector)itemGroups.elementAt(groupNum.intValue())
                    group.add(setting);
                else {
                    itemList.put(settingName, new Integer(itemGroups.size()));
                    Vector group = new Vector();
                    group.add(setting);
                    itemGroups.add(group);
            for (int counter = 0; counter<itemGroups.size(); counter++) {
                Vector items = (Vector)itemGroups.elementAt(counter);
                System.out.println("");
                for (int counter2 = 0; counter2<items.size(); counter2++) {
                    Object setting = items.elementAt(counter2);
                    System.out.println(setting + " = " + uiDefaults.get(setting));
            System.out.println("\nDone.");
            System.exit(0);
    }

  • Changing color on the title bar

    How can I during runtime change the color of the title bar? I want to flash the title bar to warn, but I haven't found the function to set the color of it yet...
    Thanks in advance!
    Regards,
    Andreas

    since 1.4 you can use
    JFrame.setDefaultLookAndFeelDecorated( true );
    JDialog.setDefaultLookAndFeelDecorated( true );to get jframes and jdialogs looking like jinternalframes. but i don't know if it is now possible to change the color.
    tobias

  • Pacman now needs to change color, but the types are incompatible ...

    Hi, my book sucks and I need your help again , Thanks In Advance !!!
    OK, now pacman can move in all directions and make a random move, but there needs to be a button to make him change color...
    I have come up with the following code but when I try to compile I get incompatible types for my new Pacmancolors...
    package pacman;
    import java.applet.*;
    import java.awt.*;
    import java.awt.event.*;
    public class Autopacman extends Applet implements ActionListener
    boolean Packleur1;
    boolean Packleur2;
    boolean Packleur3;
    boolean Packleur4;
    boolean Packleur5;
    boolean Packleur6;
    int klikken = 1;
    int x = 200, y = 200; //beginpositie pacman
    int width = 50, height = 50; //formaat pacman
    int stap = 20; //standaard stapgrootte
    int stapVerander = 10; //stapgrootte wijziging
    int angleA = 5; //beginhoeken pacman
    int angleB = 345;
    public void init(){
    Button links = new Button("links"); //knoppen worden gemaakt en gelabeld
    Button rechts = new Button("rechts");
    Button omhoog = new Button("omhoog");
    Button omlaag = new Button("omlaag");
    Button harder = new Button("harder");
    Button zachter = new Button("zachter");
    Button random = new Button("Random actie");
    Button kleur = new Button("Kleur veranderen");
    links.addActionListener(this); //action events worden aan knoppen gekoppeld
    rechts.addActionListener(this);
    omhoog.addActionListener(this);
    omlaag.addActionListener(this);
    harder.addActionListener(this);
    zachter.addActionListener(this);
    random.addActionListener(this);
    kleur.addActionListener(this);
    add( links ); //knoppen worden op canvas gezet
    add( rechts );
    add( omhoog );
    add( omlaag );
    add( harder );
    add( zachter );
    add( random );
    add( kleur );
    public void paint(Graphics g){
    g.setColor( Color.black);
    g.drawLine( 0, 34, 600, 34 );
    Packleur1 = g.setColor( Color.yellow );
    Packleur2 = g.setColor( Color.red );
    Packleur3 = g.setColor( Color.blue );
    Packleur4 = g.setColor( Color.green );
    Packleur5 = g.setColor( Color.white );
    Packleur6 = g.setColor( Color.black );
    g.fillArc(x, y, width, height, angleA, angleB); //teken de pacman voor het eerst
    public void actionPerformed(ActionEvent e){
    String str = e.getActionCommand();
    if( str.equals("Kleur veranderen")){
    klikken++;
    if( klikken = 2 )
    {Packleur2 = true;}
    if( klikken = 3 )
    {Packleur3 = true;}
    if( klikken = 4 )
    {Packleur4 = true;}
    if( klikken = 5 )
    {Packleur5 = true;}
    if( klikken = 6 )
    {Packleur6 = true;}
    return false;
    if(klikken == 7)
    {klikken = 1;}
    if( str.equals("Random actie") ){       //Die stomme random functie
    int i = (int)(Math.random() * 10);
    switch(i){
    case 1: case 7 : str = "omlaag"; break;
    case 2: case 8 : str = "omhoog"; break;
    case 3: case 9 : str = "links"; break;
    case 4: case 10 : str = "rechts"; break;
    case 5: case 0: str = "harder"; break;
    case 6: str = "zachter"; break;}
    if( str.equals("harder") ){ stap = stap + stapVerander;} //stap wordt 10 groter
    if( str.equals("zachter") ){ stap = stap - stapVerander;} //stap wordt 10 kleiner
    if( stap < 0){stap = 1;} //Stapgrootte wordt nooit negatief of nul
    if( str.equals("links") ){ x -= stap;     //linksknop laat pacman links kijken en bewegen
    angleA = 185;
    angleB = 345;}
    if( str.equals("rechts") ){ x += stap;    //rechtsknop laat pacman rechts kijken en bewegen
    angleA = 5;
    angleB = 345;}
    if( str.equals("omhoog") ){ y -= stap;    //omhoogknop laat pacman omhoog kijken en bewegen
    angleA = 95;
    angleB = 345;}
    if( str.equals("omlaag") ){ y += stap;    //omlaagknop laat pacman omlaag kijken en bewegen
    angleA = 275;
    angleB = 345;}
    if( x <= 0){ x = 0;} // houdt de pacman tegen als hij links/rechts wil verdwijnen
    if( x > 550){ x = 550;}
    if( y <= 35){ y = 35;} // houdt de pacman tegen als hij boven/onder wil verdwijnen
    if( y > 550){ y = 550;}
    repaint(); // zet de pacman opnieuw op het canvas
    Can anyone help me with this?
    Thanks a bundle!
    Menno.

    Thanks a lot!
    Say if you want to see how it works just compile this source :
    /* Autopacman spelletje
    Menno Hagens, I108
    2001
    Autopacman.
    Maak via overerving van de klasse Packman uit week 4 een nieuwe klasse 'AutoPackman'.
    Deze klasse moet de volgende extra functionaliteit bevatten.
    De kleur van de Packman moet kunnen worden ingesteld.
    Er moet een methode komen die een willekeurige opdracht aan de Packman geeft.
    (naarLinks, naarRechts, gaSneller, gaTrager, etc.)
    Maak vervolgens een applet met vier Packmannetjes en ��n knop 'Beweeg'.
    Als je op deze knop drukt, moeten alle Packmannetjes ��n stap in een willekeurige
    richting doen.
    Programmeer dit efficient met arrays en loops.
    Als je na afloop nog moed hebt kun je de klasse en de applet zo aanpassen dat een
    spel ontstaat, waarbij een Packman die op de positie van een andere komt, de andere
    Packman opeet. Degene die overblijft heeft gewonnen.
    package pacman;
    import java.applet.*;
    import java.awt.*;
    import java.awt.event.*;
    public class Autopacman extends Applet implements ActionListener
    boolean Packleur1;
    boolean Packleur2;
    boolean Packleur3;
    boolean Packleur4;
    boolean Packleur5;
    boolean Packleur6;
    int klikken = 1;
    int x = 200, y = 200; //beginpositie pacman
    int width = 50, height = 50; //formaat pacman
    int stap = 20; //standaard stapgrootte
    int stapVerander = 10; //stapgrootte wijziging
    int angleA = 5; //beginhoeken pacman
    int angleB = 345;
    public void init(){
    Button links = new Button("links"); //knoppen worden gemaakt en gelabeld
    Button rechts = new Button("rechts");
    Button omhoog = new Button("omhoog");
    Button omlaag = new Button("omlaag");
    Button harder = new Button("harder");
    Button zachter = new Button("zachter");
    Button random = new Button("Random actie");
    Button kleur = new Button("Kleur veranderen");
    links.addActionListener(this); //action events worden aan knoppen gekoppeld
    rechts.addActionListener(this);
    omhoog.addActionListener(this);
    omlaag.addActionListener(this);
    harder.addActionListener(this);
    zachter.addActionListener(this);
    random.addActionListener(this);
    kleur.addActionListener(this);
    add( links ); //knoppen worden op canvas gezet
    add( rechts );
    add( omhoog );
    add( omlaag );
    add( harder );
    add( zachter );
    add( random );
    add( kleur );
    public void paint(Graphics g){
    g.setColor( Color.black);
    g.drawLine( 0, 34, 600, 34 );
    g.setColor( Color.yellow);
    if( klikken == 1 )
    {g.setColor(Color.yellow);}
    if( klikken == 2 )
    {g.setColor(Color.red);}
    if( klikken == 3 )
    {g.setColor(Color.blue);}
    if( klikken == 4 )
    {g.setColor(Color.black);}
    if( klikken == 5 )
    {g.setColor(Color.green);}
    if( klikken == 6 )
    {g.setColor(Color.white);}
    g.fillArc(x, y, width, height, angleA, angleB); //teken de pacman voor het eerst
    public void actionPerformed(ActionEvent e){
    String str = e.getActionCommand();
    if( str.equals("Kleur veranderen")){klikken++;}
    if(klikken == 7)
    {klikken = 1;}
    if( str.equals("Random actie") ){       //Die stomme random functie
    int i = (int)(Math.random() * 17);
    switch(i){
    case 1: case 7 : case 11: case 15 : str = "omlaag"; break;
    case 2: case 8 : case 12: case 16 : str = "omhoog"; break;
    case 3: case 9 : case 13: case 17 : str = "links"; break;
    case 4: case 10 : case 14: case 0 :str = "rechts"; break;
    case 5: str = "harder"; break;
    case 6: str = "zachter"; break;}
    if( str.equals("harder") ){ stap = stap + stapVerander;} //stap wordt 10 groter
    if( str.equals("zachter") ){ stap = stap - stapVerander;} //stap wordt 10 kleiner
    if( stap < 0){stap = 1;} //Stapgrootte wordt nooit negatief of nul
    if( str.equals("links") ){ x -= stap;     //linksknop laat pacman links kijken en bewegen
    angleA = 185;
    angleB = 345;}
    if( str.equals("rechts") ){ x += stap;    //rechtsknop laat pacman rechts kijken en bewegen
    angleA = 5;
    angleB = 345;}
    if( str.equals("omhoog") ){ y -= stap;    //omhoogknop laat pacman omhoog kijken en bewegen
    angleA = 95;
    angleB = 345;}
    if( str.equals("omlaag") ){ y += stap;    //omlaagknop laat pacman omlaag kijken en bewegen
    angleA = 275;
    angleB = 345;}
    if( x <= 0){ x = 0;} // houdt de pacman tegen als hij links/rechts wil verdwijnen
    if( x > 550){ x = 550;}
    if( y <= 35){ y = 35;} // houdt de pacman tegen als hij boven/onder wil verdwijnen
    if( y > 550){ y = 550;}
    repaint(); // zet de pacman opnieuw op het canvas

  • Can I change colors of the UI Elements related to WebDynPro Java

    Can I Change the colors of the UI Elements which are embedded in the view, for ex., Button, Label, Tray, etc... and Can I change other attributes like font style, size, etc...

    hi,
    just check out these links , may not be precise to your question but are useful
    Changing the colours of Table and Group Headers in Web Dynpro
    How to change color of label in web dynpro?
    /people/sap.user72/blog/2006/04/25/colourful-table-in-web-dynpro
    Regarding Design of background color in a Web Dynpro Table
    Colors in WD - Java
    displaying color for a particular column item in a table
    hope it helps
    regards

  • CHANGE COLOR OF THE WINDOW TITLE

    Hi,
    I am working on forms6.
    Can I change the color of the window title dynamically? Please help.
    Thanks.
    Phebe.

    private void initLookAndFeel(){
    try{
    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
    UIManager.put("MenuItem.background",SystemColor.info);
    UIManager.put("Menu.background",SystemColor.info);
    SwingUtilities.updateComponentTreeUI(this);
    }catch(Exception e){}
    }

Maybe you are looking for

  • HT4528 With the new iOS 6 will it put Siri on my iPhone 4?

    With the new iOS 6 when I update will it put Siri on my iPhone 4?

  • Size matters. How can I tell the length of an edited  clip?

    I knew the length of my clip when I launched it in to the Timeline, but, now that I have cut out all the bits I don't want, is there an easy way to determine the new, shorter duration of my clip? I tried selecting the parts I wanted to time in aggreg

  • Distiller failure on a portion of text in the document

    I have a question that I'm hoping someone can assist me with, we have a Mac running Acrobat 8.1.6 (Distiller version 8.1.3) that continually fails on a portion of text in the document when creating a PDF from an EPS file. I have verified that this ma

  • Bold Text

    I often have trouble getting text to bold in dreamweaver. I have copied some text from Word text document (and I am using a .txt extension). I have bolded some of the words, the html adds the "strong" code, yet when I test it in a browser, the words

  • Send mail from SAP system to another SAP system

    Hello Xperts I need to send a mail from one SAP box (ECC) to another SAP box (SRM,CRM, EP etc). I know how to send mail from SAP to external address but unable to find the parameters in this case. Kindly help. thkx Prabhu PS: Kindly DONOT post on "Ho