有谁用过Synth,今天在写XML文件时,编译通不过,代码如下
<style id="scrollBarThumbStyle">
<state>
<imagePainter method="scrollBarThumbBackground"
direction="horizontal"
path="images/scroll_thumb_horiz_grip.png"
paintCenter="true"
/>
</style>
<bind style="scrollBarThumbStyle" type="region" key="ScrollBarThumb" />
目的是想把图片居中,但是这样写提示Error parsing: org.xml.sax.SAXException: property: you must specify sourceInsets null
如果直接定义sourceInsets的值发现图片不是居中的。
<style id="scrollBarThumbStyle">
<state>
<imagePainter method="scrollBarThumbBackground"
direction="horizontal"
path="images/scroll_thumb_horiz_grip.png"
paintCenter="true"
/>
</style>
<bind style="scrollBarThumbStyle" type="region" key="ScrollBarThumb" />
目的是想把图片居中,但是这样写提示Error parsing: org.xml.sax.SAXException: property: you must specify sourceInsets null
如果直接定义sourceInsets的值发现图片不是居中的。
解决方案 »
- 继承问题
- 我想复制一个BufferedImage对象,但无法使用clone()方法,大家说怎么办?
- DES加密 windws上加密,linux不能解密
- 关于存储过程
- hibernate分页问题——请教高手
- http://www.2qq.cn/vip.htm?qq=282232 腾讯过大年,六位数的QQ不要要钱,点击马上申请!看看有分。呵呵,
- 求救....rh9下装jdk1.4出现问题。。。。。
- 如何把对象和一般数据写入同一个txt文件
- 用java程序得到http/1.1的相关信息,急!!!(100分)
- java中关于内部类访问属性的问题
- java中如何使填入的图像自动适合控件的大小
- 如何在java中GUI画图程序中显示鼠标移动轨迹
这是我从网上看到的一段示例代码,希望对楼主有用:
<imagePainter
path="bg.jpg"
method="panelBackground"
sourceInsets="2 2 2 2"
paintCenter="true" />
<insets top="4" left="6" bottom="4" right="6"/>