Directory

← Back

Question Tree

Tree-ordered questions answered with radio buttons

Author

Rating

Popularity

<100

This component allows making structured questions.

Sample code

        QuestionTreeNode reindeer = new QuestionTreeNode(this, "Poro", "I live in ...");
        QuestionTreeNode metsapeura = new QuestionTreeNode("The Forest", "Metsäpeura", null);
        reindeer.addAnswer(metsapeura);
        QuestionTreeNode tunturipeura = new QuestionTreeNode("The Mountains", null, "I am...");
        reindeer.addAnswer(tunturipeura);
        QuestionTreeNode tunturipeura_wild = new QuestionTreeNode("Wild", "Tunturipeura", null);
        tunturipeura.addAnswer(tunturipeura_wild);
        QuestionTreeNode poro = new QuestionTreeNode("Semi-domesticated", "Poro", "My gender is...");
        tunturipeura.addAnswer(poro);
        QuestionTreeNode kesukka = new QuestionTreeNode("Domesticated", "Kesukka", null);
        tunturipeura.addAnswer(kesukka);
        
        QuestionTreeNode hirvas = new QuestionTreeNode("Male", null, "I am...");
        poro.addAnswer(hirvas);
        
        QuestionTreeNode hirvas0 = new QuestionTreeNode("less than one year old", "Vasa", null);
        hirvas.addAnswer(hirvas0);
        QuestionTreeNode hirvas1 = new QuestionTreeNode("1 year old", "Urakka", null);
        hirvas.addAnswer(hirvas1);
        QuestionTreeNode hirvas2 = new QuestionTreeNode("2 years old", "Vuorso", null);
        hirvas.addAnswer(hirvas2);
        QuestionTreeNode hirvas3 = new QuestionTreeNode("3 to 5 years", "Hirvas", null);
        hirvas.addAnswer(hirvas3);
        QuestionTreeNode hirvas6 = new QuestionTreeNode("6 years", "Maanakkas", null);
        hirvas.addAnswer(hirvas6);
        QuestionTreeNode hirvasx = new QuestionTreeNode("older than 6 years", "Nimiloppu", null);
        hirvas.addAnswer(hirvasx);
        
        QuestionTreeNode vaadin = new QuestionTreeNode("Female", null, "I am...");
        poro.addAnswer(vaadin);
        
        QuestionTreeNode vaadin0 = new QuestionTreeNode("less than one year old", "Vasa", null);
        vaadin.addAnswer(vaadin0);
        QuestionTreeNode vaadin1 = new QuestionTreeNode("1 year old", "Vuonelo", null);
        vaadin.addAnswer(vaadin1);
        QuestionTreeNode vaadin2 = new QuestionTreeNode("2 years old", "Vaadin", null);
        vaadin.addAnswer(vaadin2);
        QuestionTreeNode vaadin3 = new QuestionTreeNode("3 to 5 years", "Vaadin", null);
        vaadin.addAnswer(vaadin3);
        QuestionTreeNode vaadinx = new QuestionTreeNode("older than 6 years", "Nimiloppu", null);
        vaadin.addAnswer(vaadinx);

Compatibility

(Loading compatibility data...)

Was this helpful? Need more help?
Leave a comment or a question below. You can also join the chat on Discord or ask questions on StackOverflow.

Version

Released
2010-01-22
Maturity
EXPERIMENTAL
License
Apache License 2.0

Compatibility

Framework
Vaadin 6.2+
Browser
Firefox

Question Tree - Vaadin Add-on Directory

Tree-ordered questions answered with radio buttons Question Tree - Vaadin Add-on Directory
This component allows making structured questions.
Online