Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
Source distribution: help - contains the files of the online help, used by Ant. license - contains copies of the GNU General Public License and the GNU Lesser General Public License. src - contains the TinyLaF sources. themes - contains some TinyLaF theme files, used by Ant. build.xml - an Ant build file to build the TinyLaF binaries. javadoc.xml - an Ant build file to extract the javadoc documentation. manifest.txt - the manifest for tinycp.jar, used by Ant. readme.html - this file. tinycp.xml - an Ant build file to build the TinyLaF binaries including the control panel.
Binary distribution: docs - contains the javadoc documentation. license - contains copies of the GNU General Public License and the GNU Lesser General Public License. readme.html - this file. tinycp.jar - an executable JAR containing the Tiny Look and Feel and the TinyLaF control panel. tinylaf.jar - the Tiny Look and Feel (without the control panel).
Note: tinycp.jar is equivalent to tinylaf.jar of previous releases whereas the new tinylaf.jar is less than half the size and doesn't contain the control panel. For minimum file size, tinylaf.jar is compiled without debugging information.
1.4.0 or later. Recommended: 1.4.2 or later.
Ant build filesTop of page
The source distribution contains three Ant buildfiles.
To build tinylaf.jar, cd to the TinyLaF directory and execute:
> ant
To build the executable tinycp.jar, cd to the TinyLaF directory and execute:
> ant -f tinycp.xml
To build the javadoc documentation, cd to the TinyLaF directory and execute:
> ant -f javadoc.xml
(this command will create a new docs directory)
Running the TinyLaF control panelTop of page
Using the control panel you can create and save your own themes.
To start the control panel, either double-click tinycp.jar or cd to the TinyLaF directory and execute:
> java -jar tinycp.jar Making TinyLaF the current LookAndFeelTop of page
To make TinyLaF the current LAF of your application, include this line:
at the beginning of your main method (you will have to catch any exceptions).
(Additional ways to define the LAF can be found at Sun's Java documentation)
TinyLaF looks for a default theme file named 'Default.theme' (case-sensitive). If it finds one, this
file will be loaded at startup.
(The 'Default.theme' file is an ordinary TinyLaF .theme file, just with a special name, you can take any .theme file and rename it to 'Default.theme').
TinyLaF will search the following URLs:
TinyLookAndFeel.class.getResource("/Default.theme");
- finds 'Default.theme' if it is inside tinylaf.jar
Thread.currentThread().getContextClassLoader().getResource("Default.theme");
- finds 'Default.theme' if it is inside your application's JAR
new File(System.getProperty("user.home"), "Default.theme").toURI().toURL();
- finds 'Default.theme' if it is inside the home directory
new File(System.getProperty("user.dir"), "Default.theme").toURI().toURL();
- finds 'Default.theme' if it is inside the working directory
By default, TinyLaF specifies the 'Tahoma' font to be used by text components. 'Tahoma' is a relatively small font with a relatively small number of glyphs. The supplied 'Unicode' theme specifies the 'SansSerif' font (a logical Java font) instead of the 'Tahoma' font. To make it the default theme, follow the instructions given in the The default theme section. Alternatively you can make any theme Unicode-compliant by specifying a Unicode font for both 'Fonts | Plain Font' and 'Fonts | Bold Font'.
Decorated frames and dialogsTop of page
To try the 'Decorated Frames' feature, include the following two lines (or maybe just one) in your source code before the first frame is made visible:
JFrame.setDefaultLookAndFeelDecorated(true); // to decorate frames JDialog.setDefaultLookAndFeelDecorated(true); // to decorate dialogs
To eliminate flickering on resize (decorated frames only), include this code before you set the LAF:
// continuous layout on frame resize Toolkit.getDefaultToolkit().setDynamicLayout(true); // no flickering on resize System.setProperty("sun.awt.noerasebackground", "true");
How to bundle tinylaf.jar with your packed applicationTop of page
When JARing your application you should specify the relative path to tinylaf.jar as (one) value of the manifest's Class-Path attribute.
If you are new to manifest files:
The first line should specify the manifest version (until now there's only version 1.0): Manifest-Version: 1.0
The second line specifies the main class of your application, providing its fully-qualified class name: Main-Class: package1.package2.YourMainClass
The third line should read like this (tinylaf.jar resides in lib directory): Class-Path: lib/tinylaf.jar
The fourth (last) line MUST be a blank line.
When JARing your application, you say: > jar cmf nameOfManifestFile nameOfJar contentsOfJar ...
What you get is an executable JAR which automatically finds tinylaf.jar if the directory layout is as follows: .../applicationDirectory/nameOfJar.jar .../applicationDirectory/lib/tinylaf.jar TinyLaF and Java Web StartTop of page
TinyLaF should work with Java Web Start without tinylaf.jar needing to be signed (but note: if one of your JARs needs to be signed, you must also sign tinylaf.jar).
Because, in general, the 'Default.theme' file will not be inside tinylaf.jar you may want
to give tinylaf.jar the attribute download="lazy" in your JNLP file (so the JAR including
the 'Default.theme' file loads beforetinylaf.jar).
Theme switchingTop of page
All predefined themes (YQ, Forest, Golden, Nightly, Plastic, Silver and Unicode) are now included in the JAR file. Additionally Tiny searches both the user directory and the working directory for theme files. Theme.getAvailableThemes() returns an array of ThemeDescription objects. Once you have obtained the array, you can call ThemeDescription.getName() for each object to build a menu presenting the available themes. As a user selects a ThemeDescription, you can pass it as argument to Theme.loadTheme(ThemeDescription).
After loading a theme, you should re-install the Tiny Look and Feel and recreate the ui:
// re-install the Tiny Look and Feel
UIManager.setLookAndFeel(new TinyLookAndFeel());
// Update the ComponentUIs for all Components. This
// needs to be invoked for all windows.
SwingUtilities.updateComponentTreeUI(rootComponent);
(The javadoc documentation of the Theme class contains more information on theme switching.)
Sortable table data with TinyLaFTop of page
Since version 1.3.6 TinyLaF supports sortable table data (user can sort column values by clicking inside the column header). Sortable column headers visualize rollovers and display up/down arrows. TinyLaF supports single-column sort and multi-column sort.
Note: Of course you can also use the sorting capabilities that came with Java 1.6 with TinyLaF.
To make table data sortable, a TableModel must implement de.muntjak.tinylookandfeel.table.SortableTableData, here are the interface methods:
boolean isColumnSortable(int column)
Return true if the specified column is sortable, false otherwise. Non-sortable column headers will not react to mouse clicks or rollovers.
Parameters:
column - a column index
Returns:
true if the specified column is sortable, false otherwise
boolean supportsMultiColumnSort()
Return true if the table model supports multiple sorted columns, false otherwise. (Supporting multi column sort makes sense only with columns containing some equal values.)
The TinyLaF user gestures concerning multi column sort are:
Ctrl-Click: If clicked column was already sorted, change sorting direction, else add clicked column to sorted columns.
Alt-Click: If clicked column was already sorted, remove from sorted columns. Ignore if clicked column was not sorted.
Click (without Ctrl or Alt): The clicked column becomes the only sorted column. If the clicked column already was sorted, change sorting direction.
Returns:
true if the table model supports multiple sorted columns, false otherwise
Sort the data according to the given arguments. If argument arrays are empty, the original state of the data will be restored, if there is no original state then no action will be performed.
Note for implementors: If your data is dynamically changing you should think about storing copies of the arguments so you can re-sort data after each change. It may also be a good idea to call fireTableDataChanged() after sorting (this makes sure that the table is updated).
Parameters:
columns - array of column indices sorted by priority (highest priority first).
sortingDirections - array containing the sorting direction for each sorted column. Values are either
SORT_ASCENDING - sort column data in ascending order, or
SORT_DESCENDING - sort column data in descending order
table the table displaying the data. Might be useful, for example, to restore selected cells after sorting.
The source distribution contains an implementations of this interface, see de.muntjak.tinylookandfeel.controlpanel.TinyTableModel (performing multi-column sort).
In class de.muntjak.tinylookandfeel.TinyTableHeaderUI there are two further methods related to sorting.
Call this method to programmatically initiate sorting on (sortable) table models. Especially if your data is sorted by default, you should call this method before the table is displayed the first time.
Parameters:
columns - array of column indices sorted by priority (highest priority first)
sortingDirections - array containing the sorting direction for each sorted column. Values are either
de.muntjak.tinylookandfeel.table.SortableTableData.SORT_ASCENDING or
java.lang.IllegalArgumentException - If any of the arguments is null or if columns argument and sortingDirections argument are of different length
void setHorizontalAlignments(int[] alignments)
Sets horizontal alignments of table header renderers where an index in the argument array corresponds to a column index.
Note: If the length of the argument array is less than the number of columns, unspecified columns default to CENTER alignment. If the length of the argument array is greater than the number of columns, surplus information will be ignored.
Parameters:
alignments - array of the following constants defined in SwingConstants: LEFT, CENTER, RIGHT, LEADING or TRAILING
Each table header has its own instance of de.muntjak.tinylookandfeel.TinyTableHeaderUI. You can obtain it with code like this:
JTable table = new JTable(new MySortableTableModel());
TableHeaderUI headerUI = table.getTableHeader().getUI();
if(headerUI instanceof TinyTableHeaderUI) {
// do your thing ...
}
TinyLaF was first released in May 2003. It is based on the XP Look and Feel written by Stefan Krause.
V 1.1.0(2003-6-9)Top of page
Fixed
JProgressBar.getFont() returning null. Aditionally one can now set the font of JProgressBar.
Fixed
JProgressBar now displays strings even when in indeterminate mode.
Fixed
Defining TinyLaF as the standard LAF in swing.properties threw exceptions (PanelUI not found).
Fixed
ButtonUI now honours isBorderPainted and isContentAreaFilled properties.
Fixed
Border of JToolBar now isn't painted if set to null or isBorderPainted resolves to false.
Fixed
Border of JTextField and JComboBox now isn't painted if set to null.
Fixed
Due to a bug in BasicProgressBarUI (unfortunately in a private method, caused by a private member) sometimes a NullPointerException was thrown soon after the ControlPanel started. Because this exception is harmless, I decided to catch it.
Changed
Removed Popup Font.
Changed
Added ProgressBar Font together with two additional text colors in Decoration/ProgressBar.
Changed
File format changed slightly due to previous changes. 1.0-themes can still be loaded, but saved themes are not compatible with TinyLaF-1.0
Icons for JMenuItems were painted disabled when menu item was selected.
Fixed
The selection background and selection foreground for text components were both set to white.
Fixed
Double-clicking the title bar of a frame maximized the frame without respect to the screen insets (while clicking the maximize button did respect screen insets).
Changed
Simplified the paint routine for progress bar border to be faster so it doesn't conflict with the animation speed in javax.swing.plaf.basic.BasicProgressBarUI.
Now changing to TinyLookAndFeel from another LAF works - changing from TinyLookAndFeel to another LAF still causes problems (certain properties are not updated, I guess this will never be fixed)
Changed
Before searching "user.dir" for a 'Default.theme' file, TinyLaF searches "user.home", e.g. you can set a global default theme if you put it in "user.home".
Bug with scrollbar button arrows not changing direction when scrollbar orientation changes.
Fixed
ArrayIndexOutOfBoundsException thrown in TinyTabbedPaneUI when trying to remove a tab by manipulating the tab.
Fixed
Sub-menus painting partially above children.
Fixed
JTabbedPane now honours tab background color set with setBackgroundAt(int, Color).
Fixed
Menus and menu items now honour background and foreground properties set with setBackground(Color) resp. setForeground(Color). Additionally menus and menu items now are displayed with foreground colors defined in 'Menu Font' resp. 'Menu Item Font' by default.
Fixed
Windows 98 style only: Arrowbuttons of JSpinner now draw themselves correctly.
Fixed
Button margins were calculated without respect to the button border, so a margin of 0 made the button text obscure the border.
Fixed
JToggleButton displayed the default icon instead of the selected icon if model was both selected and rollover.
Fixed
JFormattedTextField of JSpinner editor did loose focus with each click on arrow buttons. Therefore, with SpinnerDateModel, it was not possible to select distinct date fields.
Fixed
If the JFrame.setDefaultLookAndFeelDecorated property is true and the frame is maximized, the frame border now is supressed. This is also true for internal frames.
Fixed
JOptionPane.showInternalXXXDialog() bringing up dialogs which painted no decorations at all.
Fixed
JComboBox now updates its display size as the model changes.
Fixed
Usage in applets: the theme is now reloaded as the applet is reloaded.
Fixed
Editable text fields in ColorChooser now work as expected.
Changed
The Windows XP style mutated to YQ style, the Windows 98 style mutated to 99 style. The YQ style is now the default style and will run with every operating system. To get rid of copyright issues I decided to replace both Windows 98 and XP icons with a custom icon set. Therefore I improved the algorithm to colorize icons.
Changed
On startup TinyLaF now displays a message via System.out, reporting the version and the path to the 'Default.theme' file.
Changed
In the past, radio buttons and check boxes painted rather slow. Though both paint more aesthetically now, painting speed increased drastically (by painting icons only once and caching the result - this speeds up painting by a factor of 80 and more).
Changed
Radio buttons and checkboxes now have an editable margin. Please note: A Metal checkbox (or radio button) has border insets of (2, 2, 2, 2) which adds to the margin of (2, 2, 2, 2), so, if you want a TinyLaF checkbox to behave as a Metal checkbox, you must set its margin to (4, 4, 4, 4).
Changed
The thumb of a scrollbar now has a minimum height/width of 17 pixels.
Changed
JComboBox now calculates its preferred size more realistic (and less space-consuming). The rollover border for JComboBox is now disabled by default.
Changed
The rollover border for JSpinner is now disabled by default.
Changed
If frames or dialogs are decorated, they now have a minimum width of 104 pixels. Internal frames now have a minimum width of 32 px. Internal frames defined as palettes now can additionally display an iconify and a maximize button. Palette buttons are smaller now than internal frame buttons.
Changed
You can now define separate title bar fonts for (decorated) frames, internal frames and internal palettes.
Changed
Buttons are now opaque by default (this was a trick of the XPLookAndFeel). This change doesn't affect rendering of buttons, just the value of the opaque property.
YQ-Buttons now shift their text if the button is pressed.
There is an additional flag: "ENTER 'presses' focused button". If it is selected, the ENTER key triggers the buttonPressed action on JButton, JToggleButton, JCheckBox and JRadioButton (same as SPACE key). JButton, JToggleButton, JCheckBox and JRadioButton now support a focus border. You can disable this by deselecting 'Paint Focus Border'.
Changed
Toolbar buttons now have a definable margin and separate backgrounds and borders for their deselected-, rollover-, pressed- and selected state which makes them much more flexible to use.
Changed
JProgressBar now looks like a WinXP progress bar.
Changed
Added a SeparatorUI (see Decoration | Separator).
Changed
Added a PasswordFieldUI (that just duplicates the settings from JTextFieldUI).
Changed
Added the following UIs which support a default background color: EditorPaneUI, TextPaneUI and DesktopPaneUI (see Decoration | Miscellaneous).
Changed
JSplitPane now has a divider size of 7 pixels (instead of 6 as before), oneTouchButtons have become smaller.
Changed
JTree now supports arbitrary text colors. (Note: A JTree's text color is NOT its foreground color (and not a JTree property at all)). Additionally you can now adjust the line color (see Decoration | Tree).
Changed
JComboBox now has its own background and foreground colors (see Decoration | ComboBox).
Changed
Lists now support a background and a foreground color (see Decoration | List).
Changed
Added support for floatable tool bars (see Decoration | ToolBar).
Changed
You can now set the colors of toolbar separators (see Decoration | ToolBar).
Changed
You can now set the colors of popup menu borders (see Decoration | Menu).
Changed
Added borders for table and table headers (see Decoration | Table). The header border adds an inset of 1 pixel in each direction.
Changed
Added some colors for disabled tabbed panes (see Decoration | TabbedPane).
The 'Paint Focus' flag disappeared, instead there is a 'Ignore Selected Bg' flag. If this flag is on, a selected tab will not change background color.
Tab insets and tab area insets now are editable.
Added a 'Fixed Tab Positions' flag - it switches from Java-Metal behaviour (the selected tab is always in the lowest tab row) to Windows behaviour (tabs never change positions).
Changed
Text components now additionally support a caret color.
Changed
Now you can specify the border, background and foreground colors for disabled tool tips.
Changed
Combobox button, spinner previous/next buttons and window buttons now are non-focusable. This means, they will not be included in a FocusTraversalPolicy.
Changed
The JFileChooser dialog is now opened at a larger size so you see more files at a time.
Changed
File format changed. Pre-1.3-themes can still be loaded, but saved themes are not compatible with TinyLaF versions prior to 1.3.
Code for calculating the clicked tab of JTabbedPane (SCROLL_TAB_LAYOUT mode only) didn't work with JRE 1.5. (The only way to make it work was to execute different code dependent on JRE version).
Fixed
Internal frames used a special DesktopManager, now the default DesktopManager is used and DesktopManager methods will be called as expected.
Fixed
JButton text is shifted one pixel right/down as the button is pressed. Now a test is performed if the button's text is null or of zero length and, if it is an icon-only button, no shifting occurs.
New
The control panel has a new checkbox (Decoration | Button | Shift button text) allowing you to disable text shifting for JButton.
New
Added an Ant buildfile to the source distribution (build.xml).
Bug introduced in 1.3.1 where JProgressBar was not set to opaque and therefore setting the track color had no effect.
Fixed
The "armed" thing of JCheckBox and JRadioButton (click the component, then drag the mouse outside the component's bounds, then drag it back again...) - wonder why noone reported this as being a bug.
New
JSlider now paints a focus indicator. Additionally the shape of the slider thumb now changes dependent on whether ticks are painted or not.
New
JTabbedPane now paints a focus indicator.
New
Added 'Help |Check for Updates...' menu.
Changed
Improved antialiasing of JRadioButton symbol.
Changed
JTabbedPane: The default tab font is now plain instead of bold.
Changed
Font size selectors now display font sizes up to 24 pt.
Changed
File format changed. Pre-1.3.5 themes can still be loaded, but saved themes are not compatible with TinyLaF versions prior to 1.3.5.
Problems with menu item mnemonics. If a menu contained at least on sub-menu, it could happen that mnemonics of menu items following the sub-menu were not recognized.
Fixed
In TinyProgressBarUI.installDefaults() i did use a method new in Java 1.5, making TinyLaF non-Java-1.4-compliant. (Introduced in 1.3.5).
Fixed
JSpinner now fires a ChangeEvent each time the user inputs a new value and presses Return.
New
'Alt' key closes opened menus and context menus (not only with Java 1.6 but also with Java 1.4 and 1.5).
New
Implemented support for sortable table data. Three new properties control the appearance of sortable table headers: 'Header Rollover Background', 'Header Rollover Color' and 'Header Arrow Color' (see Decoration | Table).
Changed
Border of table headers in YQ style now look more like those in WinXP.
Changed
File format changed. Pre-1.3.6 themes can still be loaded, but saved themes are not compatible with TinyLaF versions prior to 1.3.6.
The "armed" thing of toolbar buttons (click the button, then drag the mouse outside the button's bounds, then drag it back again...) now works as expected.
Fixed
JComboBox: Arrow buttons were included in focus traversal.
Fixed
ControlPanel: Since v1.3.6 changing border colors of JCheckBox and JRadioButton seemed to have no effect.
Fixed
ControlPanel: Tooltip texts of color fields ("Main Color", "Background Color", "Disabled Color" and "Frame Color") were not updated as themes were switched.
New
On Linux OS, the "FileChooser.readOnly" UIManager property will now be set to true (this disables editing of file names).
New
JFileChooser: The details table now is sortable. Removed the file attributes column.
Changed
JFileChooser: The icon-only buttons now look and behave like toolbar buttons.
Changed
Toolbar buttons: The default margin has changed from Insets(4, 4, 4, 4) to Insets(5, 5, 5, 5). Also border colors have changed.
Changed
JProgressBar border (JProgressBar is non-opaque again).
The "armed" thing of window buttons (click the button, then drag the mouse outside the button's bounds, then drag it back again...) now works as expected.
Fixed
JSpinner arrow buttons: Now spinner value will stop changing if the mouse is dragged out of the arrow button.
Fixed
JMenuBar's background color is now propagated to top menus.
Fixed
JToolBar's background color is now propagated to tool bar buttons.
Fixed
JFormattedTextField: Actions specific for formatted text fields are now enabled.
Fixed
JButton: With 'Paint Rollover Border' deselected, buttons didn't change background color on rollover.
Fixed
JButton: If a button's focusPainted property was false, the 'Paint Focus Border' setting had no effect.
Fixed
JScrollBar: If there wasn't enough space to display the thumb at its minimum size, scroll buttons were painted disabled.
Fixed
Sometimes window cursor not restored to default cursor after resize.
Fixed
Bug appearing with 1.6 JREs: Title panes of frames and dialogs not painted.
Fixed
JPasswordField didn't reflect its non-editable state.
New
There now is a javadoc API documentation. It documents how to switch themes and how to implement sortable table models.
New
Refactored the TinyLaF classes so it is possible to build the Tiny look and feel without the control panel.
New
Introduced theme switching.
New
ControlPanel: Implemented unlimited Undo/Redo. Added an online help. Implemented a magnifier.
New
JSplitPane: One can now specify the color of the optional "One-touch" buttons.
New
JTabbedPane: One can now specify border colors for disabled tabbed panes.
New
JList: One can now specify the border color of focused items.
New
JTable: One can now specify the border color of focused cells.
New
JTextField: One can now specify the background color of non-editable text fields.
New
JToggleButton: One can now specify the background color of selected toggle buttons (previously this was the background color of pressed JButton).
New
JCheckBoxes inside tables (renderer or editor) are now rendered flat (with line border and no background).
New
Popup menus can now optionally have a shadow border (see 'Decoration | Menu | Popup Shadows').
New
You can now adjust the size of scroll bars (between 14 and 64 px.). (Note: When enlarging scroll bars you should also reduce their 'Spread Light' value.)
New
JTable: You can now specify an alternate row color (introduced with Java 1.6). For the TinyLaF default theme, the alternate row color is equal to the table background color, so it has no visual effect. Setting it for pre-1.6 JREs has no effect but does no harm.
Changed
Removed support for 99 Style. You will now see an error message when trying to load a 99 theme.
Changed
JFileChooser: Rewrote TinyFileChooserUI because it was using sun.awt.shell.ShellFolder class. Due to this change, the details table is now sortable only with 1.6.0 or higher JREs.
Changed
Created a new set of JOptionPane icons (information, question, warning, error).
Changed
JMenu: Reduced the horizontal distance between adjacent top menu items (so menus require less space).
Changed
JMenuItem: Rewrote the code responsible for laying out and rendering menu items. JCheckBoxMenuItem and JRadioButtonMenuItem now can display an addtitional icon.
Changed
Menu navigation using the arrow keys, SPACE and RETURN now works very similar to navigation on MS Windows.
Changed
ControlPanel: Frames now are decorated by default.
Changed
Frames, dialogs and internal frames: Now titles are rendered antialiased and have a shadow.
Changed
Window buttons were improved and plain dialogs now show an icon and have a system menu.
Changed
Improved performance by caching the results of drawing JButton, window buttons, JSpinner arrow buttons, JComboBox arrow button and scroll bar thumb.
Changed
In previous releases, JSpinner border was textfield border, now it is de.muntjak.tinylookandfeel.borders.TinySpinnerBorder. Due to this change there is a new property: 'Decoration | Spinner | Border Color', controlling both the spinner border color and the spinner button border color.
Changed
JSlider: Rewrote the draw routine for disabled sliders.
Changed
File format changed. Pre-1.4.0 themes can still be loaded, but saved themes are not compatible with TinyLaF versions prior to 1.4.0.
- A tabbed pane in SCROLL_TAB_LAYOUT mode doesn't respect client components' preferred sizes (4 pixels at
the bottom of the client area are cut). This is a bug in BasicTabbedPaneUI.TabbedPaneScrollLayout
(which is declared private) and fixing it would require too much effort on my side.
Thanks ...Top of page
... to everybody who helped me improve TinyLaF by sending bug reports and feature requests.
Have fun creating your own themes.
27.8.2009 Hans Bickel
Contact the authorTop of page