Change Icons DefaultSingleCDockable

Hi! It is my first post, I want to know how can I change the icon for minimize, maximize and close a DefaultSingleCDockable. Thanks for your help. :wink:

Access the IconManager and change them:

icons.setIconClient( key, icon );```

Where "key" is one of:

close
locationmanager.maximize
locationmanager.minimize

(you can search the "icons.ini" files if you want a list of all the keys that are used).

Thanks for your answer, sorry I have a question, what is “control”? I use CControl but this don´t show me the .getController().getIcons(); [COLOR=black]method. Thank you again.[/COLOR]

Then you are using an old version :slight_smile: . Try „CControl.intern().getController().getIcons()“, the „setIconClient“ method should exist in your version anyway.

Hi! thank you vey much for your answer, it works very well. I have a new question, how can I change the legend „minimize“ for exemple when I put the cursor over a icon? I want to change it in another language. Thank you again :stuck_out_tongue:

You will need a new version of 1.1.0 for the following code to work:

TextManager texts = control.getController().getTexts();

// possibility one, loading a bundle:
Locale locale = <your language>
ResourceBundle bundle = ResourceBundle.getBundle( "<your path>", locale, this.getClass().getClassLoader() );
DefaultTextScheme scheme = new DefaultTextScheme( bundle );
texts.setScheme( Priority.CLIENT, scheme );

// posibility two, overriding only one entry:
m.put( Priority.CLIENT, id, resource );

// where id is one of the keys found in the *.properties files in the folder "data/locale" and "data/bibliothek/gui/dock/locale"
// where resource is the new value or null

In an old version you would have to add/modify the *.properties files directly.

Thank you very much, I´ll try it. Thank you again :stuck_out_tongue: