use the function named "setContentAreaFilled(boolean b)",you can see the demo of jdk,there are many samples about all the swing component!

解决方案 »

  1.   

    不出现灰色背景:什么意思?jbuilder中的工具栏就是平面式按狃。如果想做平面式按狃,不要用JToolBar,应该自己做,用JPanel上面加JButton,设置JButton的paintborder属性为false,再自己处理JButton的mouseclick事件。
      

  2.   

    若是用swing组件,在初始化之前加入
            UIManager.put("controlDkShadow",Color.black);
                                            ===========
    用你需要的颜色代.
      

  3.   

    更正下我说的话,是mouse enter/leave事件,不是mouseclick
    sorry
      

  4.   

    >若是用swing组件,在初始化之前加入
    >       UIManager.put("controlDkShadow",Color.black);
                                            ===========
    >用你需要的颜色代.
    楼主需要的应该是这个意思