title: How center label inside composite SWT Java
body: <p>I have created a Java SWT application and I have a composite containing a label with dimensions that change from time to time. The label displays an Image and have listener.
  How can I center the label inside the composite?</p>
  
  <p>I have created a shell with:</p>
  
  <pre><code>Composite conteinerBox = new Composite(shell, SWT.NONE);
  conteinerBox.setBackground(SWTResourceManager.getColor(SWT.COLOR_RED));
  conteinerBox.setBounds(342, 10, 410, 384);
  
  Label imageContainer = new Label(conteinerBox,SWT.NONE);
  imageContainer.setBackground(SWTResourceManager.getColor(SWT.COLOR_WIDGET_DARK_SHADOW));
  </code></pre>
  
  <p>I used this function: </p>
  
  <pre><code>private void openImage() {
  
      if(isAnImage(file.getPath())){
          System.out.println("FILE OPEN : " + file.getPath());
          Image image = getImage(file.getPath());
  
  
          //attach image
  
            imageContainer.setSize(image.getBounds().width,image.getBounds().height);
          imageContainer.setImage(image);
  
                     //set image mouse listener
          imageContainer.addMouseMoveListener(new MouseMoveListener() {
  
              @Override
              public void mouseMove(MouseEvent event) {
  
                  x_mouse_cordinate.setText("" + event.x);
                  y_mouse_cordinate.setText("" + event.y);
  
              }
          });
  }
  </code></pre>
  
  <p>The label containing the image is attached on point(0,0) but I want to center it inside the composite.....suggestions?</p>