title: how to pop up calendar when button is clicked in Java SWT?
body: <p>I am trying to develop Java SWT application in eclipse.
  I need to populate text box using DateTime Calendar in SWT when a button is clicked.
  I tried the following code but not able to see the Calendar, though it is created.
  Any help would be appreciated.
  Thanks</p>
  
  <pre><code>public void createPartControl(final Composite parent) {
          Button button;
          Label label;
          final Display dev = parent.getDisplay();        
          Image image = new Image(dev,"C:\\Users\\rm186021\\Desktop\\Calendar.gif");
          GridLayout gridLayout = new GridLayout();
          gridLayout.numColumns = 3;
          parent.setLayout(gridLayout);       
          label = new Label(parent, SWT.NULL);
          label.setText("Start date ");
   final Text start = new Text(parent, SWT.SINGLE | SWT.BORDER);
   Button calButton = new Button(parent, SWT.PUSH);
          calButton.setImage(image);
          calButton.addSelectionListener(new SelectionAdapter() {
                @Override     
                public void widgetSelected(SelectionEvent e) {
                  final Display display = new Display();
                 final Shell shell2 = new Shell(display);
                 shell2.addListener(SWT.CALENDAR, new Listener() {
                   public void handleEvent(Event event) {
                   final DateTime calendar = new DateTime(shell2,SWT.CALENDAR | SWT.POP_UP);
                   calendar.addSelectionListener (new SelectionAdapter () {
                      public void widgetSelected (SelectionEvent e) {
                        start.setData(" " + calendar.getYear() + "-" + (calendar.getMonth() + 1) + "-" + calendar.getDay());
                        System.out.println(start.getData());
                        //calendar.dispose();                   
                      }
                  }); 
                  }
                  }); 
               }
          });  
  </code></pre>