Open main menu

CDOT Wiki β

Changes

no edit summary
3.4. The following elements are added to the <code>MyScreen()</code> constructor. Add a text field: <br/>
<pre>
add(AutoTextEditField atf = new AutoTextEditField("Student Name: ", ""));
</pre>
3.5. Set the border and background for the text field: <pre> Border roundedBorder = BorderFactory.createRoundedBorder(new XYEdges(5, 5, 5, 5), Border.STYLE_SOLID); Background solidBackground = BackgroundFactory.createSolidBackground(Color.LIGHTSTEELBLUE); atf.setBorder(roundedBorder); atf.setBackground(solidBackground); add(atf); </pre>3.6. Add a search button:
<pre>
ButtonField _bf=new ButtonField("Search");
add(_bf);
</pre>
3.67. Add the array of students to the list field:
<pre>
ObjectListField olf = new ObjectListField();
add(olf);
</pre>
3.78. Open <code>MyApp</code> class and add menu items inside the constructor.3.8 9 Add view, add, edit and delete student options to the menu and set commands to execute:
<pre>
MyScreen _mainScreen = new MyScreen();
pushScreen(_mainScreen);
</pre>
3.810. Create inner classes to execute all commands:
<pre>
class ViewCommandHandler extends CommandHandler
}
</pre>
3.911. Now create the all other screen and implement menu commands.
1
edit