设置  panel的 titleborder 时候 如何把titleborder 的标题设置为不同的颜色或者在其中加入    类似checkbox等类似的组件呢 小鸟求高手解答

解决方案 »

  1.   

    TitiledBorder的构造方法TitledBorder(Border border, String title, int titleJustification, int titlePosition, Font titleFont, Color titleColor) 
              用指定的边框、标题、标题对齐方式、标题位置、标题字体和标题颜色创建 TitledBorder 实例。
      

  2.   

    如果没有设置也可以用
    setTitleColor(Color titleColor) 来设置
      

  3.   

    构造一个TitledBorder
    TitledBorder(Border border, String title, int titleJustification, int titlePosition, Font titleFont, Color titleColor) 
          用指定的边框、标题、标题对齐方式、标题位置、标题字体和标题颜色
    1  创建这样一个TitledBorder实例,其中“Color”就是设置标题颜色的
    2  如果在创建实例的时候没有设置Color,之后可以使用TitledBorder.setTitleColor(Color titleColor)来设置带标题边框的标题颜色的。
    以上两种方法都可以实现的。
      

  4.   

    大家难道没有看清楚我的意思
    titleborder我要设置2种不同的颜色 你们都只给了一种颜色的方法啊 这个我知道~~
      

  5.   

    这个应该不能实现,Swing本身功能有待扩展