Sun Microsystems 1.2 Telephone Accessories User Manual


 
32 Java ME TCK Framework Developer’s Guide July 2007
d. Use the setFirstQuestion method in the constructor to specify the first
question in the sub-interview.
The following setFirstQuestion code in the SampleInterview example
specifies the first question.
e. Specify the question type.
The Question class is a base class that provides the different types of
questions required to build the sub-interview. In the example, the question
gets string information. Therefore, the example must use the
StringQuestion type.
The following code in the SampleInterview example specifies the
StringQuestion type.
In the example, hello is a unique id that identifies the specific question
name. This name is used in the properties and map files.
public class SampleInterview extends Interview {
public SampleInterview(MidpTckBaseInterview parent)
throws Fault {
super(parent, "sample");
setResourceBundle("i18n");
setHelpSet("help/sampleInterview");
setFirstQuestion(first);
}
}
StringQuestion first = new StringQuestion(this, "hello")