jEdit Community home jEdit Community Wiki > Main > CustomIcons jEdit Community Wiki webs:
Main | Plugins | Know | TWiki | Sandbox
Main . { Whats New | Users | Groups | Changes | Index | Search | Go }

Custom Icons

The toolbar icons (and other images) for jEdit are stored within the jedit.jar file (found at org/gjt/sp/jedit/icons)

These icons are PNG files (except for a few than are GIF images) and are loaded into jEdit are startup.

Once jEdit is running, you can assign custom icons to the toolbar by going into Utilities -> Global Options -> Tool Bar and editing or adding a command, and assign an icon by loading an image file.

There is another method of loading custom icons. (Which requires jEdit 4.2pre6 or later.) To do this, you will need to create a directory named 'icons' and put in any icons you wish to use by giving them the proper names. For instance if you want new icons for Cut, Copy, and Paste, you would need to name the files Cut.png, Copy.png, and Paste.png, respectively. (For a list of all of icons jEdit uses, you'll need to get at the icons stored in the jedit.jar file mentioned above, see below for instructions on how to do this.)

Once you have the icons you desire in your 'icons' directory, you will need to create a jar file. If you are familiar with the command line it's as simple as typing:

jar cfv customicons.jar icons

while in the directory containing your 'icons' directory.

Once this is done, you will need to copy the 'customicons.jar' to your 'jars' folder. This is located within your .jedit folder - normally found in your home folder.

There is one more step to get the icons to load. You'll need a startup script written in Bean Shell. (See Startup Scripts for more on this.) Create a file named 'customicons.bsh' and save it into the 'startup' folder of your .jedit folder.

The startup script should contain the following line:


GUIUtilities.setIconPath("jeditresource:/customicons.jar!/icons/");

That will tell jEdit to load the customicons.jar file we created.

Once this is all done, you can start jEdit and any replacement icons in your customicons.jar file will replace the normal jEdit icons. The normal jEdit icons will still be loaded and appear when you do not have a replacement icon in your jar file. Remember to go into Utilities -> Global Options -> Tool Bar to see the new choices under 'Use built-in icon' when you add or edit a toolbar command.


Extracting the jEdit Icons

Do you want to extract the icons from the jedit.jar file? This is how to do it:

Copy the jedit.jar file to a new folder. (Make sure you use a copy!)

You'll need to use the command line, so cd to the directory holding the copy of the jedit.jar file and type:

jar xfv jedit.jar

This will expand the jar file and you can then find the icons at: org/gjt/sp/jedit/icons


-- Pete Prodoehl - 13 Nov 2003

Topic CustomIcons . { Edit | Attach | Ref-By | Printable | Diffs | r1.3 | > | r1.2 | > | r1.1 | More }
Revision r1.3 - 13 Nov 2003 - 15:47 GMT - Pete Prodoehl Copyright © 1999-2011 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding jEdit Community Wiki? Send feedback.
Get jEdit at !SourceForge.net. Fast, secure and Free Open Source software downloads