What is it?OfficeLnFs is a Swing LookAndFeel suite that mimics Microsoft Office-style applications as closely as possible. It currently includes three different LookAndFeels that simulate Office 2003, Office XP, and Visual Studio 2005.
The Looks detect Windows' current theme, and use colors that mimic what the real Office applications would use in that theme.
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. Sending us a note letting us know would be nice as well!
How to UseThe 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 LookAndFeel.
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("icons/org/fife/plaf/OfficeXP/cut.gif"); JButton cutButton = new JButton(new ImageIcon(url));
ScreenshotsHere are some images of a real application that uses these look and feels:
Quick Links- Download the latest release from SourceForge.
- View the source code online.
- Check out a copy from the Subversion repository.



















































