Time for action – using a custom field factory
We are going to implement an editable table with two columns: Login and Password. We are very concerned about users' privacy, security, confidentiality, and protection. We have to protect passwords against intruders watching our screen. Follow the given steps:
Create a new Vaadin project called fieldfactory.
Now create a table with the two required properties and some testing rows:
public class FieldfactoryUI extends UI { @Override protected void init(VaadinRequest request) { final VerticalLayout layout = new VerticalLayout(); layout.setMargin(true); setContent(layout); Table table = new Table("Users"); table.setPageLength(0); table.setEditable(true); table.addContainerProperty("Login", String.class, ""); table.addContainerProperty("Password", String.class, ""); table.addItem(); table.addItem(); table.addItem(); layout.addComponent(table); } }
Running the application and typing in the text...