# Power Table and JComponent - strange border

**URL:** <https://forum.inductiveautomation.com/t/power-table-and-jcomponent-strange-border/45904>\
**Category:** Ignition\
**Tags:** ignition80\
**Created:** [April 22, 2021, 11:08am UTC](https://forum.inductiveautomation.com/t/power-table-and-jcomponent-strange-border/45904 "2021-04-22T11:08:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![stra](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/stra/32/23678_2.png) [@stra](https://forum.inductiveautomation.com/u/stra)\
**Post date:** [April 22, 2021, 11:08am UTC](https://forum.inductiveautomation.com/t/power-table-and-jcomponent-strange-border/45904/1 "2021-04-22T11:08:06Z")

</div>

I’m playing with “javax.swing.table.TableCellEditor” to make the table a little bit special.  
I have a strange phenomenon when the component is a JCheckBox:  
a small blue rectangle appears to the left of the cell.  
has anyone else noticed this phenomenon?

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/3/030f1341355405048659370309a7df280e6829a8.png)

```auto
	from javax.swing import AbstractCellEditor,JComboBox, JTextField, JCheckBox, SwingConstants
	from javax.swing.table import TableCellEditor
	from java.awt.event import ItemListener, ItemEvent
	import json		
	from shared.tools.pretty import p
	
	
	class myTableCellEditor(TableCellEditor, AbstractCellEditor):	
	
		def __init__ (self, tableComponent):
			self.table = tableComponent
			self.editor = None
			# defind the options for the drop down
			self.options = []
		
		
			
		def getTableCellEditorComponent(self, table, value, isSelected, rowIndex, colIndex):
			#print 'sono qua'
			def str2bool(value):
				return value.lower() in ("yes", "true", "open", "on", "t", "1")
			self.options = json.loads(self.table.data.getValueAt(rowIndex,'options'))									
			try:

				if 'edit' in self.options:
					type = self.options['edit']
					print type
					if type in ['checkBox','comboBox']:
						if type == 'checkBox':
							print 'sono un check box'
							self.editor = JCheckBox()
							self.editor.setSelected(str2bool(value))
							self.editor.setHorizontalAlignment(SwingConstants.CENTER)
						elif type == 'comboBox':
							print 'sono un combo box'
							if self.options['translation list']:
								lst_k = [k for k,v in self.options['translation list'].iteritems()]
								lst = [int(v) for k,v in self.options['translation list'].iteritems()]
								print lst_k
								print lst
								index = 0
								try:
									val = int(value)
								except:
									val = 0
								if val in lst:
									index = lst.index(val)
								self.editor = JComboBox(lst_k)
								self.editor.setSelectedIndex(index)	
					else:
						print 'non so cosa sono'				
				else:
					# create a text field for default editor
					self.editor = JTextField(value)
					print 'sono un textfield'
			except:
				self.editor = JTextField()
				print 'disastro'
	
			return self.editor
		
		def getCellEditorValue(self):
			# is the editor a combobox?
			if type(self.editor) is JComboBox:
				# get the combobox value
				selectedValue = self.editor.getSelectedItem()
				 
				# convert back to the options value
				newValue = self.options['translation list'][selectedValue]
			elif type(self.editor) is JCheckBox:
				return self.editor.isSelected()
			else:
				# get the text field value
				newValue = self.editor.getText()
		
			return newValue
		

			
	if colName == "value":
		m = myTableCellEditor(self)
		return {"editor":m}
			
		

```
