Code Snippets

JTaskPane & JTaskPaneGroup:

JDirectoryChooser:

Frequently Asked Questions

Q: I'm using JTaskPane in my application. I met problems with applying Metal Look&Feel themes to it. If I change theme/L&F after JTaskPane is created nothing happens (other components change its appearance, including JTaskPane child components). If L&F theme is set BEFORE JTaskPane is created everything looks ok.

A: The JTaskPane (and other L2FProd.com Common Components) provides its own pluggable look and feel. When you change the look and feel with UIManager.setLookAndFeel(new MetalLookAndFeel()); the JTaskPane is not notified of such change and does not update its look. To tell JTaskPane you changed the look and feel, import com.l2fprod.common.swing.plaf.LookAndFeelAddons; and add a call to:
LookAndFeelAddons.setAddon(LookAndFeelAddons.getBestMatchAddonClassName()); after your call to UIManager.setLookAndFeel(...); but before you call SwingUtilities.updateComponentTreeUI.

-

Q: Hi, is there a way to extend the property table to only show editable bean properties? we have some beans that have alot of properties and a small number of those properties editable.

A: With the PropertySheet, you have full control over the properties shown in the table. If you use PropertySheetPanel#setBeanInfo, all properties of your bean will be shown. You can easily filter these properties. Instead use the method PropertySheetPanel#setProperties as follow:

PropertyDescriptor[] beanProperties = beanInfo.getPropertyDescriptors();
// you will have to write this filter method.
// Just look for "getWriteMethod() != null" to find if a property is editable
beanProperties = filterEditableProperties(beanProperties);
sheet.setProperties(beanProperties);

Now only editable properties are shown. Similar approach can be used to show only basic properties (as opposed to expert/hidden properties).

 

 

 


 
Copyright © 2004-2006 L2FProd.com