title: draw red border around wrong text
body: <p>I'm trying to implement a method which draws a red border around a Control like a text, if the user didn't enter anything. i'm using eclipse swt.
  My Method looks like that:</p>
  
  <pre><code>protected void drawRedBorder(Control cont){
      final Control control = cont;
      cont.getParent().addPaintListener(new PaintListener(){
          public void paintControl(PaintEvent e){
              GC gc = e.gc;
              Color red = new Color(null, 255, 0 ,0);
              gc.setBackground(red);
              Rectangle rect = control.getBounds();
              Rectangle rect1 = new Rectangle(rect.x - 2, rect.y - 2,
                      rect.width + 4, rect.height + 4);
              gc.setLineStyle(SWT.LINE_SOLID);
              gc.fillRectangle(rect1);
          }
      });
  }
  </code></pre>
  
  <p>It works fine, when i call it when the dialog with the Textfield is created. However it doesn't work, when i call it in a Method like checkInput() which checks if the user hast entered something.</p>
  
  <p>I tried to solve the problem by calling redraw() or update(), but nothing worked. Any clue how i can solve this problem?</p>