<!-- 表格 -->
<style id="table">
<object class="javax.swing.plaf.ColorUIResource" id="color">
<int>255</int>
<int>0</int>
<int>0</int>
</object>
<defaultsProperty key="Table.focusCellForeground" type="idref" value="color"/>
<object class="javax.swing.plaf.ColorUIResource" id="gridColor">
<int>255</int>
<int>0</int>
<int>0</int>
</object>
<defaultsProperty key="Table.gridColor" type="idref" value="gridColor"/>
<object id="background" class="org.refworld.narcotics.app.frame.TbackgroundPainter"/>
<defaultsProperty key="Table.background" type="idref" value="background"/>
<painter method="paintTableBackground" idref="background"/>
<property key="Table.rendererUseTableColors" type="boolean" value="false"/>
<property key="Table.rendererUseUIBorder" type="boolean" value="false"/>
</style>
<bind style="table" type="region" key="Table"/>
TbackgroundPainter.java文件内容:
package org.refworld.narcotics.app.frame;import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import javax.swing.plaf.synth.SynthContext;
import javax.swing.plaf.synth.SynthPainter;/**
*
* @author Blues
*/
public class TbackgroundPainer extends SynthPainter{
/** Creates a new instance of TbackgroundPainer */
public TbackgroundPainer() {
}
public void paintTableBackground(SynthContext context,Graphics g,int x,int y,int w,int h)
{
Graphics2D g2 = (Graphics2D)g;
g2.setColor(Color.BLUE);
g2.fillRect(x, y, w, h);
}
}
这是我写的代码但是执行后表格网格线和背景色都没变
请问到底哪里出错
<style id="table">
<object class="javax.swing.plaf.ColorUIResource" id="color">
<int>255</int>
<int>0</int>
<int>0</int>
</object>
<defaultsProperty key="Table.focusCellForeground" type="idref" value="color"/>
<object class="javax.swing.plaf.ColorUIResource" id="gridColor">
<int>255</int>
<int>0</int>
<int>0</int>
</object>
<defaultsProperty key="Table.gridColor" type="idref" value="gridColor"/>
<object id="background" class="org.refworld.narcotics.app.frame.TbackgroundPainter"/>
<defaultsProperty key="Table.background" type="idref" value="background"/>
<painter method="paintTableBackground" idref="background"/>
<property key="Table.rendererUseTableColors" type="boolean" value="false"/>
<property key="Table.rendererUseUIBorder" type="boolean" value="false"/>
</style>
<bind style="table" type="region" key="Table"/>
TbackgroundPainter.java文件内容:
package org.refworld.narcotics.app.frame;import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import javax.swing.plaf.synth.SynthContext;
import javax.swing.plaf.synth.SynthPainter;/**
*
* @author Blues
*/
public class TbackgroundPainer extends SynthPainter{
/** Creates a new instance of TbackgroundPainer */
public TbackgroundPainer() {
}
public void paintTableBackground(SynthContext context,Graphics g,int x,int y,int w,int h)
{
Graphics2D g2 = (Graphics2D)g;
g2.setColor(Color.BLUE);
g2.fillRect(x, y, w, h);
}
}
这是我写的代码但是执行后表格网格线和背景色都没变
请问到底哪里出错
解决方案 »
- 一个android写的程序,本机调试总是不成功,跪求帮忙,万分感谢!
- 帮忙!类型转换问题!急!
- 新手提问,关于自己写的一个银行类
- 在applet的init里 好像不能使用循环语句 建立网络套接字 readLine()好像也被限制了
- 新手求救??
- 怎么把int型的birth当成字符型用了??
- j2sdk-1_4_2-beta-solaris-sparc.sh 安装,运行java 出错
- 编译技术里的语法分析实现该如何下手?
- [急救]数据库问题
- 网站的站内搜索是怎么实现的?怎么做?在网页的头元素中有一关键词元素,是不是就是给站内搜索用的?如果我在Sina中登记我的网站,那么是不是
- 在线等! 急!-能编译能运行!就是JtableI不显示!(求教高手!)不胜感激!!高手指一下哪错了??
- Synth 设置
你的问题解决了没有啊?