下面列出了javax.swing.event.SwingPropertyChangeSupport#firePropertyChange() 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
/**
* Sets the current look and feel to {@code newLookAndFeel}.
* If the current look and feel is {@code non-null} {@code
* uninitialize} is invoked on it. If {@code newLookAndFeel} is
* {@code non-null}, {@code initialize} is invoked on it followed
* by {@code getDefaults}. The defaults returned from {@code
* newLookAndFeel.getDefaults()} replace those of the defaults
* from the previous look and feel. If the {@code newLookAndFeel} is
* {@code null}, the look and feel defaults are set to {@code null}.
* <p>
* A value of {@code null} can be used to set the look and feel
* to {@code null}. As the {@code LookAndFeel} is required for
* most of Swing to function, setting the {@code LookAndFeel} to
* {@code null} is strongly discouraged.
* <p>
* This is a JavaBeans bound property.
*
* @param newLookAndFeel {@code LookAndFeel} to install
* @throws UnsupportedLookAndFeelException if
* {@code newLookAndFeel} is {@code non-null} and
* {@code newLookAndFeel.isSupportedLookAndFeel()} returns
* {@code false}
* @see #getLookAndFeel
*/
public static void setLookAndFeel(LookAndFeel newLookAndFeel)
throws UnsupportedLookAndFeelException
{
if ((newLookAndFeel != null) && !newLookAndFeel.isSupportedLookAndFeel()) {
String s = newLookAndFeel.toString() + " not supported on this platform";
throw new UnsupportedLookAndFeelException(s);
}
LAFState lafState = getLAFState();
LookAndFeel oldLookAndFeel = lafState.lookAndFeel;
if (oldLookAndFeel != null) {
oldLookAndFeel.uninitialize();
}
lafState.lookAndFeel = newLookAndFeel;
if (newLookAndFeel != null) {
sun.swing.DefaultLookup.setDefaultLookup(null);
newLookAndFeel.initialize();
lafState.setLookAndFeelDefaults(newLookAndFeel.getDefaults());
}
else {
lafState.setLookAndFeelDefaults(null);
}
SwingPropertyChangeSupport changeSupport = lafState.
getPropertyChangeSupport(false);
if (changeSupport != null) {
changeSupport.firePropertyChange("lookAndFeel", oldLookAndFeel,
newLookAndFeel);
}
}
/**
* Sets the current look and feel to {@code newLookAndFeel}.
* If the current look and feel is {@code non-null} {@code
* uninitialize} is invoked on it. If {@code newLookAndFeel} is
* {@code non-null}, {@code initialize} is invoked on it followed
* by {@code getDefaults}. The defaults returned from {@code
* newLookAndFeel.getDefaults()} replace those of the defaults
* from the previous look and feel. If the {@code newLookAndFeel} is
* {@code null}, the look and feel defaults are set to {@code null}.
* <p>
* A value of {@code null} can be used to set the look and feel
* to {@code null}. As the {@code LookAndFeel} is required for
* most of Swing to function, setting the {@code LookAndFeel} to
* {@code null} is strongly discouraged.
* <p>
* This is a JavaBeans bound property.
*
* @param newLookAndFeel {@code LookAndFeel} to install
* @throws UnsupportedLookAndFeelException if
* {@code newLookAndFeel} is {@code non-null} and
* {@code newLookAndFeel.isSupportedLookAndFeel()} returns
* {@code false}
* @see #getLookAndFeel
*/
public static void setLookAndFeel(LookAndFeel newLookAndFeel)
throws UnsupportedLookAndFeelException
{
if ((newLookAndFeel != null) && !newLookAndFeel.isSupportedLookAndFeel()) {
String s = newLookAndFeel.toString() + " not supported on this platform";
throw new UnsupportedLookAndFeelException(s);
}
LAFState lafState = getLAFState();
LookAndFeel oldLookAndFeel = lafState.lookAndFeel;
if (oldLookAndFeel != null) {
oldLookAndFeel.uninitialize();
}
lafState.lookAndFeel = newLookAndFeel;
if (newLookAndFeel != null) {
sun.swing.DefaultLookup.setDefaultLookup(null);
newLookAndFeel.initialize();
lafState.setLookAndFeelDefaults(newLookAndFeel.getDefaults());
}
else {
lafState.setLookAndFeelDefaults(null);
}
SwingPropertyChangeSupport changeSupport = lafState.
getPropertyChangeSupport(false);
if (changeSupport != null) {
changeSupport.firePropertyChange("lookAndFeel", oldLookAndFeel,
newLookAndFeel);
}
}
/**
* Sets the current look and feel to {@code newLookAndFeel}.
* If the current look and feel is {@code non-null} {@code
* uninitialize} is invoked on it. If {@code newLookAndFeel} is
* {@code non-null}, {@code initialize} is invoked on it followed
* by {@code getDefaults}. The defaults returned from {@code
* newLookAndFeel.getDefaults()} replace those of the defaults
* from the previous look and feel. If the {@code newLookAndFeel} is
* {@code null}, the look and feel defaults are set to {@code null}.
* <p>
* A value of {@code null} can be used to set the look and feel
* to {@code null}. As the {@code LookAndFeel} is required for
* most of Swing to function, setting the {@code LookAndFeel} to
* {@code null} is strongly discouraged.
* <p>
* This is a JavaBeans bound property.
*
* @param newLookAndFeel {@code LookAndFeel} to install
* @throws UnsupportedLookAndFeelException if
* {@code newLookAndFeel} is {@code non-null} and
* {@code newLookAndFeel.isSupportedLookAndFeel()} returns
* {@code false}
* @see #getLookAndFeel
*/
public static void setLookAndFeel(LookAndFeel newLookAndFeel)
throws UnsupportedLookAndFeelException
{
if ((newLookAndFeel != null) && !newLookAndFeel.isSupportedLookAndFeel()) {
String s = newLookAndFeel.toString() + " not supported on this platform";
throw new UnsupportedLookAndFeelException(s);
}
LAFState lafState = getLAFState();
LookAndFeel oldLookAndFeel = lafState.lookAndFeel;
if (oldLookAndFeel != null) {
oldLookAndFeel.uninitialize();
}
lafState.lookAndFeel = newLookAndFeel;
if (newLookAndFeel != null) {
sun.swing.DefaultLookup.setDefaultLookup(null);
newLookAndFeel.initialize();
lafState.setLookAndFeelDefaults(newLookAndFeel.getDefaults());
}
else {
lafState.setLookAndFeelDefaults(null);
}
SwingPropertyChangeSupport changeSupport = lafState.
getPropertyChangeSupport(false);
if (changeSupport != null) {
changeSupport.firePropertyChange("lookAndFeel", oldLookAndFeel,
newLookAndFeel);
}
}
/**
* Sets the current look and feel to {@code newLookAndFeel}.
* If the current look and feel is {@code non-null} {@code
* uninitialize} is invoked on it. If {@code newLookAndFeel} is
* {@code non-null}, {@code initialize} is invoked on it followed
* by {@code getDefaults}. The defaults returned from {@code
* newLookAndFeel.getDefaults()} replace those of the defaults
* from the previous look and feel. If the {@code newLookAndFeel} is
* {@code null}, the look and feel defaults are set to {@code null}.
* <p>
* A value of {@code null} can be used to set the look and feel
* to {@code null}. As the {@code LookAndFeel} is required for
* most of Swing to function, setting the {@code LookAndFeel} to
* {@code null} is strongly discouraged.
* <p>
* This is a JavaBeans bound property.
*
* @param newLookAndFeel {@code LookAndFeel} to install
* @throws UnsupportedLookAndFeelException if
* {@code newLookAndFeel} is {@code non-null} and
* {@code newLookAndFeel.isSupportedLookAndFeel()} returns
* {@code false}
* @see #getLookAndFeel
*/
public static void setLookAndFeel(LookAndFeel newLookAndFeel)
throws UnsupportedLookAndFeelException
{
if ((newLookAndFeel != null) && !newLookAndFeel.isSupportedLookAndFeel()) {
String s = newLookAndFeel.toString() + " not supported on this platform";
throw new UnsupportedLookAndFeelException(s);
}
LAFState lafState = getLAFState();
LookAndFeel oldLookAndFeel = lafState.lookAndFeel;
if (oldLookAndFeel != null) {
oldLookAndFeel.uninitialize();
}
lafState.lookAndFeel = newLookAndFeel;
if (newLookAndFeel != null) {
sun.swing.DefaultLookup.setDefaultLookup(null);
newLookAndFeel.initialize();
lafState.setLookAndFeelDefaults(newLookAndFeel.getDefaults());
}
else {
lafState.setLookAndFeelDefaults(null);
}
SwingPropertyChangeSupport changeSupport = lafState.
getPropertyChangeSupport(false);
if (changeSupport != null) {
changeSupport.firePropertyChange("lookAndFeel", oldLookAndFeel,
newLookAndFeel);
}
}
/**
* Sets the current look and feel to {@code newLookAndFeel}.
* If the current look and feel is {@code non-null} {@code
* uninitialize} is invoked on it. If {@code newLookAndFeel} is
* {@code non-null}, {@code initialize} is invoked on it followed
* by {@code getDefaults}. The defaults returned from {@code
* newLookAndFeel.getDefaults()} replace those of the defaults
* from the previous look and feel. If the {@code newLookAndFeel} is
* {@code null}, the look and feel defaults are set to {@code null}.
* <p>
* A value of {@code null} can be used to set the look and feel
* to {@code null}. As the {@code LookAndFeel} is required for
* most of Swing to function, setting the {@code LookAndFeel} to
* {@code null} is strongly discouraged.
* <p>
* This is a JavaBeans bound property.
*
* @param newLookAndFeel {@code LookAndFeel} to install
* @throws UnsupportedLookAndFeelException if
* {@code newLookAndFeel} is {@code non-null} and
* {@code newLookAndFeel.isSupportedLookAndFeel()} returns
* {@code false}
* @see #getLookAndFeel
*/
public static void setLookAndFeel(LookAndFeel newLookAndFeel)
throws UnsupportedLookAndFeelException
{
if ((newLookAndFeel != null) && !newLookAndFeel.isSupportedLookAndFeel()) {
String s = newLookAndFeel.toString() + " not supported on this platform";
throw new UnsupportedLookAndFeelException(s);
}
LAFState lafState = getLAFState();
LookAndFeel oldLookAndFeel = lafState.lookAndFeel;
if (oldLookAndFeel != null) {
oldLookAndFeel.uninitialize();
}
lafState.lookAndFeel = newLookAndFeel;
if (newLookAndFeel != null) {
sun.swing.DefaultLookup.setDefaultLookup(null);
newLookAndFeel.initialize();
lafState.setLookAndFeelDefaults(newLookAndFeel.getDefaults());
}
else {
lafState.setLookAndFeelDefaults(null);
}
SwingPropertyChangeSupport changeSupport = lafState.
getPropertyChangeSupport(false);
if (changeSupport != null) {
changeSupport.firePropertyChange("lookAndFeel", oldLookAndFeel,
newLookAndFeel);
}
}
/**
* Sets the current look and feel to {@code newLookAndFeel}.
* If the current look and feel is {@code non-null} {@code
* uninitialize} is invoked on it. If {@code newLookAndFeel} is
* {@code non-null}, {@code initialize} is invoked on it followed
* by {@code getDefaults}. The defaults returned from {@code
* newLookAndFeel.getDefaults()} replace those of the defaults
* from the previous look and feel. If the {@code newLookAndFeel} is
* {@code null}, the look and feel defaults are set to {@code null}.
* <p>
* A value of {@code null} can be used to set the look and feel
* to {@code null}. As the {@code LookAndFeel} is required for
* most of Swing to function, setting the {@code LookAndFeel} to
* {@code null} is strongly discouraged.
* <p>
* This is a JavaBeans bound property.
*
* @param newLookAndFeel {@code LookAndFeel} to install
* @throws UnsupportedLookAndFeelException if
* {@code newLookAndFeel} is {@code non-null} and
* {@code newLookAndFeel.isSupportedLookAndFeel()} returns
* {@code false}
* @see #getLookAndFeel
*/
public static void setLookAndFeel(LookAndFeel newLookAndFeel)
throws UnsupportedLookAndFeelException
{
if ((newLookAndFeel != null) && !newLookAndFeel.isSupportedLookAndFeel()) {
String s = newLookAndFeel.toString() + " not supported on this platform";
throw new UnsupportedLookAndFeelException(s);
}
LAFState lafState = getLAFState();
LookAndFeel oldLookAndFeel = lafState.lookAndFeel;
if (oldLookAndFeel != null) {
oldLookAndFeel.uninitialize();
}
lafState.lookAndFeel = newLookAndFeel;
if (newLookAndFeel != null) {
sun.swing.DefaultLookup.setDefaultLookup(null);
newLookAndFeel.initialize();
lafState.setLookAndFeelDefaults(newLookAndFeel.getDefaults());
}
else {
lafState.setLookAndFeelDefaults(null);
}
SwingPropertyChangeSupport changeSupport = lafState.
getPropertyChangeSupport(false);
if (changeSupport != null) {
changeSupport.firePropertyChange("lookAndFeel", oldLookAndFeel,
newLookAndFeel);
}
}
/**
* Sets the current look and feel to {@code newLookAndFeel}.
* If the current look and feel is {@code non-null} {@code
* uninitialize} is invoked on it. If {@code newLookAndFeel} is
* {@code non-null}, {@code initialize} is invoked on it followed
* by {@code getDefaults}. The defaults returned from {@code
* newLookAndFeel.getDefaults()} replace those of the defaults
* from the previous look and feel. If the {@code newLookAndFeel} is
* {@code null}, the look and feel defaults are set to {@code null}.
* <p>
* A value of {@code null} can be used to set the look and feel
* to {@code null}. As the {@code LookAndFeel} is required for
* most of Swing to function, setting the {@code LookAndFeel} to
* {@code null} is strongly discouraged.
* <p>
* This is a JavaBeans bound property.
*
* @param newLookAndFeel {@code LookAndFeel} to install
* @throws UnsupportedLookAndFeelException if
* {@code newLookAndFeel} is {@code non-null} and
* {@code newLookAndFeel.isSupportedLookAndFeel()} returns
* {@code false}
* @see #getLookAndFeel
*/
public static void setLookAndFeel(LookAndFeel newLookAndFeel)
throws UnsupportedLookAndFeelException
{
if ((newLookAndFeel != null) && !newLookAndFeel.isSupportedLookAndFeel()) {
String s = newLookAndFeel.toString() + " not supported on this platform";
throw new UnsupportedLookAndFeelException(s);
}
LAFState lafState = getLAFState();
LookAndFeel oldLookAndFeel = lafState.lookAndFeel;
if (oldLookAndFeel != null) {
oldLookAndFeel.uninitialize();
}
lafState.lookAndFeel = newLookAndFeel;
if (newLookAndFeel != null) {
sun.swing.DefaultLookup.setDefaultLookup(null);
newLookAndFeel.initialize();
lafState.setLookAndFeelDefaults(newLookAndFeel.getDefaults());
}
else {
lafState.setLookAndFeelDefaults(null);
}
SwingPropertyChangeSupport changeSupport = lafState.
getPropertyChangeSupport(false);
if (changeSupport != null) {
changeSupport.firePropertyChange("lookAndFeel", oldLookAndFeel,
newLookAndFeel);
}
}
/**
* Sets the current look and feel to {@code newLookAndFeel}.
* If the current look and feel is {@code non-null} {@code
* uninitialize} is invoked on it. If {@code newLookAndFeel} is
* {@code non-null}, {@code initialize} is invoked on it followed
* by {@code getDefaults}. The defaults returned from {@code
* newLookAndFeel.getDefaults()} replace those of the defaults
* from the previous look and feel. If the {@code newLookAndFeel} is
* {@code null}, the look and feel defaults are set to {@code null}.
* <p>
* A value of {@code null} can be used to set the look and feel
* to {@code null}. As the {@code LookAndFeel} is required for
* most of Swing to function, setting the {@code LookAndFeel} to
* {@code null} is strongly discouraged.
* <p>
* This is a JavaBeans bound property.
*
* @param newLookAndFeel {@code LookAndFeel} to install
* @throws UnsupportedLookAndFeelException if
* {@code newLookAndFeel} is {@code non-null} and
* {@code newLookAndFeel.isSupportedLookAndFeel()} returns
* {@code false}
* @see #getLookAndFeel
*/
public static void setLookAndFeel(LookAndFeel newLookAndFeel)
throws UnsupportedLookAndFeelException
{
if ((newLookAndFeel != null) && !newLookAndFeel.isSupportedLookAndFeel()) {
String s = newLookAndFeel.toString() + " not supported on this platform";
throw new UnsupportedLookAndFeelException(s);
}
LAFState lafState = getLAFState();
LookAndFeel oldLookAndFeel = lafState.lookAndFeel;
if (oldLookAndFeel != null) {
oldLookAndFeel.uninitialize();
}
lafState.lookAndFeel = newLookAndFeel;
if (newLookAndFeel != null) {
sun.swing.DefaultLookup.setDefaultLookup(null);
newLookAndFeel.initialize();
lafState.setLookAndFeelDefaults(newLookAndFeel.getDefaults());
}
else {
lafState.setLookAndFeelDefaults(null);
}
SwingPropertyChangeSupport changeSupport = lafState.
getPropertyChangeSupport(false);
if (changeSupport != null) {
changeSupport.firePropertyChange("lookAndFeel", oldLookAndFeel,
newLookAndFeel);
}
}
/**
* Sets the current look and feel to {@code newLookAndFeel}.
* If the current look and feel is {@code non-null} {@code
* uninitialize} is invoked on it. If {@code newLookAndFeel} is
* {@code non-null}, {@code initialize} is invoked on it followed
* by {@code getDefaults}. The defaults returned from {@code
* newLookAndFeel.getDefaults()} replace those of the defaults
* from the previous look and feel. If the {@code newLookAndFeel} is
* {@code null}, the look and feel defaults are set to {@code null}.
* <p>
* A value of {@code null} can be used to set the look and feel
* to {@code null}. As the {@code LookAndFeel} is required for
* most of Swing to function, setting the {@code LookAndFeel} to
* {@code null} is strongly discouraged.
* <p>
* This is a JavaBeans bound property.
*
* @param newLookAndFeel {@code LookAndFeel} to install
* @throws UnsupportedLookAndFeelException if
* {@code newLookAndFeel} is {@code non-null} and
* {@code newLookAndFeel.isSupportedLookAndFeel()} returns
* {@code false}
* @see #getLookAndFeel
*/
public static void setLookAndFeel(LookAndFeel newLookAndFeel)
throws UnsupportedLookAndFeelException
{
if ((newLookAndFeel != null) && !newLookAndFeel.isSupportedLookAndFeel()) {
String s = newLookAndFeel.toString() + " not supported on this platform";
throw new UnsupportedLookAndFeelException(s);
}
LAFState lafState = getLAFState();
LookAndFeel oldLookAndFeel = lafState.lookAndFeel;
if (oldLookAndFeel != null) {
oldLookAndFeel.uninitialize();
}
lafState.lookAndFeel = newLookAndFeel;
if (newLookAndFeel != null) {
sun.swing.DefaultLookup.setDefaultLookup(null);
newLookAndFeel.initialize();
lafState.setLookAndFeelDefaults(newLookAndFeel.getDefaults());
}
else {
lafState.setLookAndFeelDefaults(null);
}
SwingPropertyChangeSupport changeSupport = lafState.
getPropertyChangeSupport(false);
if (changeSupport != null) {
changeSupport.firePropertyChange("lookAndFeel", oldLookAndFeel,
newLookAndFeel);
}
}
/**
* Sets the current look and feel to {@code newLookAndFeel}.
* If the current look and feel is {@code non-null} {@code
* uninitialize} is invoked on it. If {@code newLookAndFeel} is
* {@code non-null}, {@code initialize} is invoked on it followed
* by {@code getDefaults}. The defaults returned from {@code
* newLookAndFeel.getDefaults()} replace those of the defaults
* from the previous look and feel. If the {@code newLookAndFeel} is
* {@code null}, the look and feel defaults are set to {@code null}.
* <p>
* A value of {@code null} can be used to set the look and feel
* to {@code null}. As the {@code LookAndFeel} is required for
* most of Swing to function, setting the {@code LookAndFeel} to
* {@code null} is strongly discouraged.
* <p>
* This is a JavaBeans bound property.
*
* @param newLookAndFeel {@code LookAndFeel} to install
* @throws UnsupportedLookAndFeelException if
* {@code newLookAndFeel} is {@code non-null} and
* {@code newLookAndFeel.isSupportedLookAndFeel()} returns
* {@code false}
* @see #getLookAndFeel
*/
public static void setLookAndFeel(LookAndFeel newLookAndFeel)
throws UnsupportedLookAndFeelException
{
if ((newLookAndFeel != null) && !newLookAndFeel.isSupportedLookAndFeel()) {
String s = newLookAndFeel.toString() + " not supported on this platform";
throw new UnsupportedLookAndFeelException(s);
}
LAFState lafState = getLAFState();
LookAndFeel oldLookAndFeel = lafState.lookAndFeel;
if (oldLookAndFeel != null) {
oldLookAndFeel.uninitialize();
}
lafState.lookAndFeel = newLookAndFeel;
if (newLookAndFeel != null) {
sun.swing.DefaultLookup.setDefaultLookup(null);
newLookAndFeel.initialize();
lafState.setLookAndFeelDefaults(newLookAndFeel.getDefaults());
}
else {
lafState.setLookAndFeelDefaults(null);
}
SwingPropertyChangeSupport changeSupport = lafState.
getPropertyChangeSupport(false);
if (changeSupport != null) {
changeSupport.firePropertyChange("lookAndFeel", oldLookAndFeel,
newLookAndFeel);
}
}
/**
* Sets the current look and feel to {@code newLookAndFeel}.
* If the current look and feel is {@code non-null} {@code
* uninitialize} is invoked on it. If {@code newLookAndFeel} is
* {@code non-null}, {@code initialize} is invoked on it followed
* by {@code getDefaults}. The defaults returned from {@code
* newLookAndFeel.getDefaults()} replace those of the defaults
* from the previous look and feel. If the {@code newLookAndFeel} is
* {@code null}, the look and feel defaults are set to {@code null}.
* <p>
* A value of {@code null} can be used to set the look and feel
* to {@code null}. As the {@code LookAndFeel} is required for
* most of Swing to function, setting the {@code LookAndFeel} to
* {@code null} is strongly discouraged.
* <p>
* This is a JavaBeans bound property.
*
* @param newLookAndFeel {@code LookAndFeel} to install
* @throws UnsupportedLookAndFeelException if
* {@code newLookAndFeel} is {@code non-null} and
* {@code newLookAndFeel.isSupportedLookAndFeel()} returns
* {@code false}
* @see #getLookAndFeel
*/
public static void setLookAndFeel(LookAndFeel newLookAndFeel)
throws UnsupportedLookAndFeelException
{
if ((newLookAndFeel != null) && !newLookAndFeel.isSupportedLookAndFeel()) {
String s = newLookAndFeel.toString() + " not supported on this platform";
throw new UnsupportedLookAndFeelException(s);
}
LAFState lafState = getLAFState();
LookAndFeel oldLookAndFeel = lafState.lookAndFeel;
if (oldLookAndFeel != null) {
oldLookAndFeel.uninitialize();
}
lafState.lookAndFeel = newLookAndFeel;
if (newLookAndFeel != null) {
sun.swing.DefaultLookup.setDefaultLookup(null);
newLookAndFeel.initialize();
lafState.setLookAndFeelDefaults(newLookAndFeel.getDefaults());
}
else {
lafState.setLookAndFeelDefaults(null);
}
SwingPropertyChangeSupport changeSupport = lafState.
getPropertyChangeSupport(false);
if (changeSupport != null) {
changeSupport.firePropertyChange("lookAndFeel", oldLookAndFeel,
newLookAndFeel);
}
}
/**
* Sets the current look and feel to {@code newLookAndFeel}.
* If the current look and feel is {@code non-null} {@code
* uninitialize} is invoked on it. If {@code newLookAndFeel} is
* {@code non-null}, {@code initialize} is invoked on it followed
* by {@code getDefaults}. The defaults returned from {@code
* newLookAndFeel.getDefaults()} replace those of the defaults
* from the previous look and feel. If the {@code newLookAndFeel} is
* {@code null}, the look and feel defaults are set to {@code null}.
* <p>
* A value of {@code null} can be used to set the look and feel
* to {@code null}. As the {@code LookAndFeel} is required for
* most of Swing to function, setting the {@code LookAndFeel} to
* {@code null} is strongly discouraged.
* <p>
* This is a JavaBeans bound property.
*
* @param newLookAndFeel {@code LookAndFeel} to install
* @throws UnsupportedLookAndFeelException if
* {@code newLookAndFeel} is {@code non-null} and
* {@code newLookAndFeel.isSupportedLookAndFeel()} returns
* {@code false}
* @see #getLookAndFeel
*/
public static void setLookAndFeel(LookAndFeel newLookAndFeel)
throws UnsupportedLookAndFeelException
{
if ((newLookAndFeel != null) && !newLookAndFeel.isSupportedLookAndFeel()) {
String s = newLookAndFeel.toString() + " not supported on this platform";
throw new UnsupportedLookAndFeelException(s);
}
LAFState lafState = getLAFState();
LookAndFeel oldLookAndFeel = lafState.lookAndFeel;
if (oldLookAndFeel != null) {
oldLookAndFeel.uninitialize();
}
lafState.lookAndFeel = newLookAndFeel;
if (newLookAndFeel != null) {
sun.swing.DefaultLookup.setDefaultLookup(null);
newLookAndFeel.initialize();
lafState.setLookAndFeelDefaults(newLookAndFeel.getDefaults());
}
else {
lafState.setLookAndFeelDefaults(null);
}
SwingPropertyChangeSupport changeSupport = lafState.
getPropertyChangeSupport(false);
if (changeSupport != null) {
changeSupport.firePropertyChange("lookAndFeel", oldLookAndFeel,
newLookAndFeel);
}
}
/**
* Sets the current look and feel to {@code newLookAndFeel}.
* If the current look and feel is {@code non-null} {@code
* uninitialize} is invoked on it. If {@code newLookAndFeel} is
* {@code non-null}, {@code initialize} is invoked on it followed
* by {@code getDefaults}. The defaults returned from {@code
* newLookAndFeel.getDefaults()} replace those of the defaults
* from the previous look and feel. If the {@code newLookAndFeel} is
* {@code null}, the look and feel defaults are set to {@code null}.
* <p>
* A value of {@code null} can be used to set the look and feel
* to {@code null}. As the {@code LookAndFeel} is required for
* most of Swing to function, setting the {@code LookAndFeel} to
* {@code null} is strongly discouraged.
* <p>
* This is a JavaBeans bound property.
*
* @param newLookAndFeel {@code LookAndFeel} to install
* @throws UnsupportedLookAndFeelException if
* {@code newLookAndFeel} is {@code non-null} and
* {@code newLookAndFeel.isSupportedLookAndFeel()} returns
* {@code false}
* @see #getLookAndFeel
*/
public static void setLookAndFeel(LookAndFeel newLookAndFeel)
throws UnsupportedLookAndFeelException
{
if ((newLookAndFeel != null) && !newLookAndFeel.isSupportedLookAndFeel()) {
String s = newLookAndFeel.toString() + " not supported on this platform";
throw new UnsupportedLookAndFeelException(s);
}
LAFState lafState = getLAFState();
LookAndFeel oldLookAndFeel = lafState.lookAndFeel;
if (oldLookAndFeel != null) {
oldLookAndFeel.uninitialize();
}
lafState.lookAndFeel = newLookAndFeel;
if (newLookAndFeel != null) {
sun.swing.DefaultLookup.setDefaultLookup(null);
newLookAndFeel.initialize();
lafState.setLookAndFeelDefaults(newLookAndFeel.getDefaults());
}
else {
lafState.setLookAndFeelDefaults(null);
}
SwingPropertyChangeSupport changeSupport = lafState.
getPropertyChangeSupport(false);
if (changeSupport != null) {
changeSupport.firePropertyChange("lookAndFeel", oldLookAndFeel,
newLookAndFeel);
}
}
/**
* Sets the current look and feel to {@code newLookAndFeel}.
* If the current look and feel is {@code non-null} {@code
* uninitialize} is invoked on it. If {@code newLookAndFeel} is
* {@code non-null}, {@code initialize} is invoked on it followed
* by {@code getDefaults}. The defaults returned from {@code
* newLookAndFeel.getDefaults()} replace those of the defaults
* from the previous look and feel. If the {@code newLookAndFeel} is
* {@code null}, the look and feel defaults are set to {@code null}.
* <p>
* A value of {@code null} can be used to set the look and feel
* to {@code null}. As the {@code LookAndFeel} is required for
* most of Swing to function, setting the {@code LookAndFeel} to
* {@code null} is strongly discouraged.
* <p>
* This is a JavaBeans bound property.
*
* @param newLookAndFeel {@code LookAndFeel} to install
* @throws UnsupportedLookAndFeelException if
* {@code newLookAndFeel} is {@code non-null} and
* {@code newLookAndFeel.isSupportedLookAndFeel()} returns
* {@code false}
* @see #getLookAndFeel
*/
public static void setLookAndFeel(LookAndFeel newLookAndFeel)
throws UnsupportedLookAndFeelException
{
if ((newLookAndFeel != null) && !newLookAndFeel.isSupportedLookAndFeel()) {
String s = newLookAndFeel.toString() + " not supported on this platform";
throw new UnsupportedLookAndFeelException(s);
}
LAFState lafState = getLAFState();
LookAndFeel oldLookAndFeel = lafState.lookAndFeel;
if (oldLookAndFeel != null) {
oldLookAndFeel.uninitialize();
}
lafState.lookAndFeel = newLookAndFeel;
if (newLookAndFeel != null) {
sun.swing.DefaultLookup.setDefaultLookup(null);
newLookAndFeel.initialize();
lafState.setLookAndFeelDefaults(newLookAndFeel.getDefaults());
}
else {
lafState.setLookAndFeelDefaults(null);
}
SwingPropertyChangeSupport changeSupport = lafState.
getPropertyChangeSupport(false);
if (changeSupport != null) {
changeSupport.firePropertyChange("lookAndFeel", oldLookAndFeel,
newLookAndFeel);
}
}
/**
* Sets the current look and feel to {@code newLookAndFeel}.
* If the current look and feel is {@code non-null} {@code
* uninitialize} is invoked on it. If {@code newLookAndFeel} is
* {@code non-null}, {@code initialize} is invoked on it followed
* by {@code getDefaults}. The defaults returned from {@code
* newLookAndFeel.getDefaults()} replace those of the defaults
* from the previous look and feel. If the {@code newLookAndFeel} is
* {@code null}, the look and feel defaults are set to {@code null}.
* <p>
* A value of {@code null} can be used to set the look and feel
* to {@code null}. As the {@code LookAndFeel} is required for
* most of Swing to function, setting the {@code LookAndFeel} to
* {@code null} is strongly discouraged.
* <p>
* This is a JavaBeans bound property.
*
* @param newLookAndFeel {@code LookAndFeel} to install
* @throws UnsupportedLookAndFeelException if
* {@code newLookAndFeel} is {@code non-null} and
* {@code newLookAndFeel.isSupportedLookAndFeel()} returns
* {@code false}
* @see #getLookAndFeel
*/
public static void setLookAndFeel(LookAndFeel newLookAndFeel)
throws UnsupportedLookAndFeelException
{
if ((newLookAndFeel != null) && !newLookAndFeel.isSupportedLookAndFeel()) {
String s = newLookAndFeel.toString() + " not supported on this platform";
throw new UnsupportedLookAndFeelException(s);
}
LAFState lafState = getLAFState();
LookAndFeel oldLookAndFeel = lafState.lookAndFeel;
if (oldLookAndFeel != null) {
oldLookAndFeel.uninitialize();
}
lafState.lookAndFeel = newLookAndFeel;
if (newLookAndFeel != null) {
sun.swing.DefaultLookup.setDefaultLookup(null);
newLookAndFeel.initialize();
lafState.setLookAndFeelDefaults(newLookAndFeel.getDefaults());
}
else {
lafState.setLookAndFeelDefaults(null);
}
SwingPropertyChangeSupport changeSupport = lafState.
getPropertyChangeSupport(false);
if (changeSupport != null) {
changeSupport.firePropertyChange("lookAndFeel", oldLookAndFeel,
newLookAndFeel);
}
}
/**
* Sets the current look and feel to {@code newLookAndFeel}.
* If the current look and feel is {@code non-null} {@code
* uninitialize} is invoked on it. If {@code newLookAndFeel} is
* {@code non-null}, {@code initialize} is invoked on it followed
* by {@code getDefaults}. The defaults returned from {@code
* newLookAndFeel.getDefaults()} replace those of the defaults
* from the previous look and feel. If the {@code newLookAndFeel} is
* {@code null}, the look and feel defaults are set to {@code null}.
* <p>
* A value of {@code null} can be used to set the look and feel
* to {@code null}. As the {@code LookAndFeel} is required for
* most of Swing to function, setting the {@code LookAndFeel} to
* {@code null} is strongly discouraged.
* <p>
* This is a JavaBeans bound property.
*
* @param newLookAndFeel {@code LookAndFeel} to install
* @throws UnsupportedLookAndFeelException if
* {@code newLookAndFeel} is {@code non-null} and
* {@code newLookAndFeel.isSupportedLookAndFeel()} returns
* {@code false}
* @see #getLookAndFeel
*/
public static void setLookAndFeel(LookAndFeel newLookAndFeel)
throws UnsupportedLookAndFeelException
{
if ((newLookAndFeel != null) && !newLookAndFeel.isSupportedLookAndFeel()) {
String s = newLookAndFeel.toString() + " not supported on this platform";
throw new UnsupportedLookAndFeelException(s);
}
LAFState lafState = getLAFState();
LookAndFeel oldLookAndFeel = lafState.lookAndFeel;
if (oldLookAndFeel != null) {
oldLookAndFeel.uninitialize();
}
lafState.lookAndFeel = newLookAndFeel;
if (newLookAndFeel != null) {
sun.swing.DefaultLookup.setDefaultLookup(null);
newLookAndFeel.initialize();
lafState.setLookAndFeelDefaults(newLookAndFeel.getDefaults());
}
else {
lafState.setLookAndFeelDefaults(null);
}
SwingPropertyChangeSupport changeSupport = lafState.
getPropertyChangeSupport(false);
if (changeSupport != null) {
changeSupport.firePropertyChange("lookAndFeel", oldLookAndFeel,
newLookAndFeel);
}
}
/**
* Sets the current look and feel to {@code newLookAndFeel}.
* If the current look and feel is {@code non-null} {@code
* uninitialize} is invoked on it. If {@code newLookAndFeel} is
* {@code non-null}, {@code initialize} is invoked on it followed
* by {@code getDefaults}. The defaults returned from {@code
* newLookAndFeel.getDefaults()} replace those of the defaults
* from the previous look and feel. If the {@code newLookAndFeel} is
* {@code null}, the look and feel defaults are set to {@code null}.
* <p>
* A value of {@code null} can be used to set the look and feel
* to {@code null}. As the {@code LookAndFeel} is required for
* most of Swing to function, setting the {@code LookAndFeel} to
* {@code null} is strongly discouraged.
* <p>
* This is a JavaBeans bound property.
*
* @param newLookAndFeel {@code LookAndFeel} to install
* @throws UnsupportedLookAndFeelException if
* {@code newLookAndFeel} is {@code non-null} and
* {@code newLookAndFeel.isSupportedLookAndFeel()} returns
* {@code false}
* @see #getLookAndFeel
*/
public static void setLookAndFeel(LookAndFeel newLookAndFeel)
throws UnsupportedLookAndFeelException
{
if ((newLookAndFeel != null) && !newLookAndFeel.isSupportedLookAndFeel()) {
String s = newLookAndFeel.toString() + " not supported on this platform";
throw new UnsupportedLookAndFeelException(s);
}
LAFState lafState = getLAFState();
LookAndFeel oldLookAndFeel = lafState.lookAndFeel;
if (oldLookAndFeel != null) {
oldLookAndFeel.uninitialize();
}
lafState.lookAndFeel = newLookAndFeel;
if (newLookAndFeel != null) {
sun.swing.DefaultLookup.setDefaultLookup(null);
newLookAndFeel.initialize();
lafState.setLookAndFeelDefaults(newLookAndFeel.getDefaults());
}
else {
lafState.setLookAndFeelDefaults(null);
}
SwingPropertyChangeSupport changeSupport = lafState.
getPropertyChangeSupport(false);
if (changeSupport != null) {
changeSupport.firePropertyChange("lookAndFeel", oldLookAndFeel,
newLookAndFeel);
}
}