textdisplayerbeaninfo.java

来自「java 完全探索的随书源码」· Java 代码 · 共 26 行

JAVA
26
字号
import java.beans.*;public class TextDisplayerBeanInfo extends SimpleBeanInfo {   // override the getPropertyDescriptors method to provide that info.   public PropertyDescriptor[] getPropertyDescriptors() {      PropertyDescriptor[] properties = new PropertyDescriptor[4];      try {         properties[0] = new PropertyDescriptor( "Text String",            BeanClass, "getOutputText", "setOutputText" );         properties[1] = new PropertyDescriptor( "Text Color",            BeanClass, "getFontColor", "setFontColor" );         properties[2] = new PropertyDescriptor( "Text Font",            BeanClass, "getTextFont", "setTextFont" );         properties[3] = new PropertyDescriptor( "Background Color",            BeanClass, "getBGColor", "setBGColor" );      } catch( IntrospectionException e ) {         return( null ); // exit gracefully if you get an exception.      }      return( properties );   }   private Class BeanClass = TextDisplayer.class;}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?