Boa noite pessoal… tenho esta classe abaixo e gostaria de saber como posso usala como um componente visual na paleta no netbens
import com.lowagie.text.Font;
import java.awt.Color;
import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;
import javax.swing.BorderFactory;
import javax.swing.JTextField;
import javax.swing.border.Border;
public class myTextFild extends JTextField implements FocusListener {
private static Color defaultBackground = new Color (223, 223, 223);
private static Color focusedBackground = new Color (255, 255, 255);//223,223,223 vermelho claro anterior
private static Border defaultBorder = BorderFactory.createLineBorder (Color.DARK_GRAY);
private static Border focusedBorder = BorderFactory.createLineBorder(Color.DARK_GRAY, 1);
private static Color defaultForeground = Color.BLACK;
private static Color defaultReadonlyBackground = Color.WHITE;
private static Border defaultReadonlyBorder = BorderFactory.createEmptyBorder();
private static Border designTimeReadonlyBorder = BorderFactory.createEmptyBorder();
public myTextFild () {
setForeground(defaultForeground);
addFocusListener (this);
}
public void focusGained(FocusEvent e) {
defaultBackground = getBackground();
defaultBorder = getBorder();
setBackground (focusedBackground);
setBorder(focusedBorder);
}
public void focusLost(FocusEvent e) {
setBackground (defaultBackground);
setBorder(defaultBorder);
}
}
De já agradeço…
Luís