void initTextField() { setVisible(target.isVisible()); setBounds(x, y, width, height, SET_BOUNDS); AWTAccessor.ComponentAccessor compAccessor = AWTAccessor.getComponentAccessor(); foreground = compAccessor.getForeground(target); if (foreground == null) foreground = SystemColor.textText; setForeground(foreground); background = compAccessor.getBackground(target); if (background == null) { if (((TextField) target).isEditable()) background = SystemColor.text; else background = SystemColor.control; } setBackground(background); if (!target.isBackgroundSet()) { // This is a way to set the background color of the TextArea // without calling setBackground - go through accessor compAccessor.setBackground(target, background); } if (!target.isForegroundSet()) { target.setForeground(SystemColor.textText); } setFont(font); }