The jar provides three look and feels. You can have your application use one of them by adding the following code to the beginning of your application:
try {
UIManager.setLookAndFeel("org.fife.plaf.Office2003.Office2003LookAndFeel");
//UIManager.setLookAndFeel("org.fife.plaf.OfficeXP.OfficeXPLookAndFeel");
//UIManager.setLookAndFeel("org.fife.plaf.VisualStudio2005.VisualStudio2005LookAndFeel");
} catch (Exception e) {
System.err.println("Oops! Something went wrong!");
}
This will set the UI for all modified components, just like any other
Look and Feel.The jar also contains the icons used by Office XP and 2003 applications; they are located in the following directories:
org/fife/plaf/OfficeXP
org/fife/plaf/Office2003
These are standard images, including:
| Office XP | Office 2003 | Location | Office XP | Office 2003 | Location | ||
| About | ![]() |
![]() |
about.gif | Back | ![]() |
![]() |
back.gif |
| Close | ![]() |
![]() |
close.gif | Close All | ![]() |
![]() |
closeall.gif |
| Copy | ![]() |
![]() |
copy.gif | Cut | ![]() |
![]() |
cut.gif |
| Delete | ![]() |
![]() |
delete.gif | Find | ![]() |
![]() |
find.gif |
| Find Next | ![]() |
![]() |
findnext.gif | Forward | ![]() |
![]() |
forward.gif |
| Help | ![]() |
![]() |
help.gif | New | ![]() |
![]() |
new.gif |
| Open | ![]() |
![]() |
open.gif | Open in new window | ![]() |
![]() |
openinnewwindow.gif |
| Options | ![]() |
![]() |
options.gif | Paste | ![]() |
![]() |
paste.gif |
![]() |
![]() |
print.gif | Print Preview | ![]() |
![]() |
printpreview.gif | |
| Redo | ![]() |
![]() |
redo.gif | Replace | ![]() |
![]() |
replace.gif |
| Replace Next | ![]() |
![]() |
replacenext.gif | Save | ![]() |
![]() |
save.gif |
| Save All | ![]() |
![]() |
saveall.gif | Save As | ![]() |
![]() |
saveas.gif |
| Select All | ![]() |
![]() |
saveall.gif | Undo | ![]() |
![]() |
undo.gif |
All are in .gif format, are 16x16, and have transparent backgrounds. So, for example, you could create a "cut" toolbar button as follows:
ClassLoader cl = getClass().getClassLoader();
URL url = cl.getResource("org/fife/plaf/OfficeXP/cut.gif");
JButton cutButton = new JButton(new ImageIcon(url));
Here are some images of a real application that uses these look and feels:
If you use the look and feels in any project, please email me at robert_futrell@users.sourceforge.net and let me know! I'll provide a link to your project from the OfficeLnFs page if you like.
To try out the Office Look and Feels, please download from the Sourceforge project page. Also, please report any bugs or configuration problems you find there as well.
The Office Look and Feels are distributed with a BSD-style license. This means that you can use it in your own applications, even commercial ones, without having to worry about open-sourcing your project. All I ask is that you include the OfficeLnFs license with your project and mention your using OfficeLnFs in your documentation somewhere.