Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Vaadin 7 UI Design By Example: Beginner's Guide

You're reading from   Vaadin 7 UI Design By Example: Beginner's Guide Do it all with Java! All you need is Vaadin and this book which shows you how to develop web applications in a totally hands-on approach. By the end of it you'll have acquired the knack and taken a fun journey on the way.

Arrow left icon
Product type Paperback
Published in Jul 2013
Publisher Packt
ISBN-13 9781782162261
Length 246 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Toc

Table of Contents (17) Chapters Close

Vaadin 7 UI Design By Example Beginner's Guide
Credits
About the Author
Acknowledgement
About the Reviewers
www.PacktPub.com
Preface
1. Writing Your First Vaadin-powered Application FREE CHAPTER 2. Using Input Components and Forms – Time to Listen to Users 3. Arranging Components into Layouts 4. Using Vaadin Navigation Capabilities 5. Using Tables – Time to Talk to Users 6. Adding More Components 7. Customizing UI Components – Time to Theme it 8. Developing Your Own Components Pop Quiz Answers Index

Time for action – my first table


Following are the steps to create your first table:

  1. Create a new Vaadin project named my-first-table using your IDE.

  2. Edit your UI class to match the following code snippet:

    public class MyFirstTableUI extends UI {
    
      protected void init(VaadinRequest request) {
        final VerticalLayout layout = new VerticalLayout();
        layout.setMargin(true);
        setContent(layout);
      }
    }
  3. Now, add the actual code for the table shown as follows:

    public class MyFirstTableUI extends UI {
    
      protected void init(VaadinRequest request) {
    
        // ...
    
        Table table = new Table();
    
        table.addContainerProperty("Column 1", String.class,
    "(default 1)");
        table.addContainerProperty("Column 2", String.class,
    "(default 2)");
    
        table.addItem(new Object[] { "Hi", "There" }, "item ID 1");
        table.addItem(new Object[] { "Well", "Hello!" }, "item ID       2");
        table.addItem();
    
        layout.addComponent(table);
      }
    }
  4. Run it!

What just happened?

First of all, here is a screenshot of...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime