Ejemplo n.º 1
0
  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);
  }
Ejemplo n.º 2
0
 @Override
 public void repositionSecurityWarning() {
   if (warningWindow != null) {
     AWTAccessor.ComponentAccessor compAccessor = AWTAccessor.getComponentAccessor();
     Window target = getTarget();
     int x = compAccessor.getX(target);
     int y = compAccessor.getY(target);
     int width = compAccessor.getWidth(target);
     int height = compAccessor.getHeight(target);
     warningWindow.reposition(x, y, width, height);
   }
 }