我的代码是:
package com.example.upravnik_dokumenata;
import java.io.File;
import javax.servlet.annotation.WebServlet;
import com.vaadin.annotations.Theme;
import com.vaadin.annotations.VaadinServletConfiguration;
import com.vaadin.data.util.FilesystemContainer;
import com.vaadin.server.VaadinRequest;
import com.vaadin.server.VaadinServlet;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.ComboBox;
import com.vaadin.ui.Label;
import com.vaadin.ui.UI;
import com.vaadin.ui.VerticalLayout;
@SuppressWarnings("serial")
@Theme("upravnik_dokumenata")
public class UprUI extends UI {
FilesystemContainer dokumenta = new FilesystemContainer(new File("C:\\Users\\x\\Desktop\\Informatika"));
ComboBox combo = new ComboBox("Documents", dokumenta);
@Override
protected void init(VaadinRequest request) {
setContent(combo);
}
}
很简单,但不起作用。顺便说一下,我正在使用Eclipse Luna 4.4.1,Tomcat 8.0v。