我使用此代码为不同颜色的ly jtable行着色:
table.setDefaultRenderer(Object.class, new DefaultTableCellRenderer()
{
@Override
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column)
{
final Component c = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
c.setBackground(row % 2 == 0 ? Color.WHITE : Color.LIGHT_GRAY);
return c;
}
});
Run Code Online (Sandbox Code Playgroud)
它有效,现在我想将用户选择的行着色为与上述颜色不同的另一种颜色:
table.setSelectionBackground(Color.RED);
Run Code Online (Sandbox Code Playgroud)
但它做了什么我怎样才能做到这一点?
先感谢您
我有这个链接:
<a href = "" ><img src="images_cartographie/cartographie3_05.gif" width="207" height="47" alt=""></a></td>
Run Code Online (Sandbox Code Playgroud)
我想在用户通过我测试的链接时更改图像:
#planification:hover{
background-image:"images_cartographie/cartographie3_03.gif";
}
Run Code Online (Sandbox Code Playgroud)
但是图像没有改变,它被忽略了,(我测试了背景颜色它的工作原理(然后问题不在url或...))
当我使用背景图像时没有像这样悬停:它没有出现:
#planification{
background-image:"images_cartographie/cartographie3_03.gif";
}
Run Code Online (Sandbox Code Playgroud)
注意:我用photoshop生成了这个页面
你有什么主意吗
我使用此函数来验证一个输入元素:
function validerInput(qte, qtemax) {
var floatRegex = /^((\d+(\.\d *)?)|((\d*\.)?\d+))$/;
if (floatRegex.test(qte.value)) {
var a = qte.value;
var b = qtemax;
if (a > b) {
alert('if qtemax : ' + qtemax + ', qte : ' + qte.value);
qte.value = '';
}
else {
alert('else qtemax : ' + qtemax + ', qte : ' + qte.value);
}
}
else {
qte.value = '';
}
}
Run Code Online (Sandbox Code Playgroud)
但问题始终是启动其他人的警报,第一个从来不知道问题
你有什么主意吗 :
启动的警报包含例如234和5.66