Cannot find symbol - class DBCellRenderer.
Cannot find symbol - class DBCellRenderer.
What is the correct import statement needed in order to correct
these problems? I am using Jbuilder Foundation 2005, and also
have access to Developer 2005 (update 4).
The program below is an extract from the following Borland site
…info.borland.com/techpubs/jbuilder/jbuilder2005…JdbTable
Other errors are, variable super (2 occurrences), and
incompatible types found on the return statement
================================================== ====
package pvnaa;
import java.awt.*;
import javax.swing.*;
import com.borland.dbswing.*;
public class NegativeNumberRenderer
extends JdbTable.DBCellRenderer {
public NegativeNumberRenderer(JdbTable jdbTable) {
jdbTable.super();
}
public Component getTableCellRendererComponent(JTable table,
Object value,
boolean isSelected,
boolean hasFocus,
int row,
int column) {
super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
if (value != null) {
try {
// Compare numeric value of string to zero. This assumes that a negative
// value has a leading minus sign, so only handles simple numeric formats
if (Double.parseDouble( (String) value) < 0.0d) {
super.setForeground(Color.red);
}
}
// Use the default foreground if we can't get a number from the string
catch (NumberFormatException nfe) {
}
}
return this;
}
}
=============================================
|