本文整理汇总了Python中javax.swing.JTable.prepareRenderer方法的典型用法代码示例。如果您正苦于以下问题:Python JTable.prepareRenderer方法的具体用法?Python JTable.prepareRenderer怎么用?Python JTable.prepareRenderer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.JTable
的用法示例。
在下文中一共展示了JTable.prepareRenderer方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: prepareRenderer
# 需要导入模块: from javax.swing import JTable [as 别名]
# 或者: from javax.swing.JTable import prepareRenderer [as 别名]
def prepareRenderer(self, renderer, row, column):
c = JTable.prepareRenderer(self,renderer, row, column)
impressionColor = {self._extender._enfocementStatuses[0]:Color.RED,
self._extender._enfocementStatuses[1]:Color.YELLOW,
self._extender._enfocementStatuses[2]:Color.GREEN}
for impression in impressionColor:
if self._extender.getValueAt(row,1) == impression:
c.setBackground(impressionColor[impression]);
return c
示例2: prepareRenderer
# 需要导入模块: from javax.swing import JTable [as 别名]
# 或者: from javax.swing.JTable import prepareRenderer [as 别名]
def prepareRenderer(self, renderer, row, column):
c = JTable.prepareRenderer(self,renderer, row, column)
selectedRow = self._extender.logTable.getSelectedRow()
if row == selectedRow:
return c
if self._extender.getValueAt(row,4) == "Green":
c.setBackground(Color.GREEN)
elif self._extender.getValueAt(row,4) == "Red":
c.setBackground(Color.RED)
else:
c.setBackground(None)
return c
示例3: prepareRenderer
# 需要导入模块: from javax.swing import JTable [as 别名]
# 或者: from javax.swing.JTable import prepareRenderer [as 别名]
def prepareRenderer(self, renderer, row, col):
comp = JTable.prepareRenderer(self,renderer, row, col)
value = self._extender.getValueAt(row,col)
if (value == "Authorization bypass!" and ((col == 5) or (col == 6))):
comp.setBackground(Color(255,135,31))
elif (value == "Authorization enforced??? (please configure enforcement detector)" and ((col == 5) or (col == 6))):
comp.setBackground(Color(255,255,133));
elif (value == "Authorization enforced!" and ((col == 5) or (col == 6))):
comp.setBackground(Color(192,250,20));
else:
comp.setBackground(Color.white);
return comp