Having trouble finding information on the thing I'm after as I'm not sure what the process is called. As an example, check out the code below.
When making a GUI, the following is used (copy/paste from internet):
regionSelectionTable = new JTable()
{
public Component prepareRenderer(TableCellRenderer renderer, int row, int col)
{
//Do some stuff
Component comp = super.prepareRenderer(renderer, row, col);
JComponent jcomp = (JComponent)comp;
if (comp == jcomp)
{
jcomp.setToolTipText((String)getValueAt(row, col));
}
return comp;
};
};
I'm not so interested in what happens inside the prepareRenderer() method; but rather, is the JTable object being given a method in the above code? If true:
- what is this process called?
- why isn't the method being passed as an argument to the constructor or via a setter method?
If this is not what is happening, please explain what is happening and what this process is called.