upload single click layout issue

i have the following class that implement the single Upload example

package com.example.singleuploadclick;

import com.vaadin.Application;
import com.vaadin.ui.*;
import com.vaadin.ui.Upload.FailedEvent;
import com.vaadin.ui.Upload.FinishedEvent;
import com.vaadin.ui.Upload.StartedEvent;
import com.vaadin.ui.Upload.SucceededEvent;

/**

  • Main application class.
    */
    public class SingleuploadclickApplication extends Application {

    /**
    *
    */
    private static final long serialVersionUID = 1L;
    private Label status;
    private Upload upload;
    private MyReceiver receiver = new MyReceiver();

    @Override
    public void init() {
    Window mainWindow = new Window(“Singleuploadclick Application”);
    Label label = new Label(“Hello Vaadin user”);

     mainWindow.addComponent(label);
     
     status = new Label("Please select a file to upload");
     upload = new Upload(null, receiver);
    
     upload.setImmediate(true);
     upload.setButtonCaption("Select file");
    
     upload.addListener(new Upload.StartedListener() {
         /**
          *
          */
         private static final long serialVersionUID = 1L;
    
         @Override
         public void uploadStarted(StartedEvent event) {
             upload.setVisible(false);
             status.setValue("Uploading file \"" + event.getFilename() + "\"");
         }
     });
    
     upload.addListener(new Upload.ProgressListener() {
         /**
          *
          */
         private static final long serialVersionUID = 1L;
    
         @Override
         public void updateProgress(long readBytes, long contentLength) {
         }
    
     });
    
     upload.addListener(new Upload.SucceededListener() {
         /**
          *
          */
         private static final long serialVersionUID = 1L;
    
         @Override
         public void uploadSucceeded(SucceededEvent event) {
             status.setValue("Uploading file \"" + event.getFilename() + "\" succeeded");
         }
     });
    
     upload.addListener(new Upload.FailedListener() {
         /**
          *
          */
         private static final long serialVersionUID = 1L;
    
         @Override
         public void uploadFailed(FailedEvent event) {
             status.setValue("Uploading interrupted");
         }
     });
    
     upload.addListener(new Upload.FinishedListener() {
         /**
          *
          */
         private static final long serialVersionUID = 1L;
    
         @Override
         public void uploadFinished(FinishedEvent event) {
             upload.setVisible(true);
             upload.setCaption("Select another file");
         }
     });
    
     mainWindow.addComponent(status);
     mainWindow.addComponent(upload);            
     setMainWindow(mainWindow);
    

    }
    }

When running the application I get strange layout display of upload component, see attachment. So i need upload component just with one upload button, that why i used : upload.setImmediate(true);

18401.png