The ScalaDoc for the applet class is pretty thin on details on how you actually override the ui piece and add components. It says “Clients should implement the ui field. See the SimpleApplet demo for an example.”
- Where is this SimpleApplet demo?
- Barring that, does anyone have some simple source code of using the Scala Applet class, rather than the JApplet class directly?
Thanks
The more recent ScalaDoc may be slightly more helpful (in particular, the new version of ScalaDoc allows you to show/hide concrete members so you can focus on what you must implement).
It should be noted that you don’t have to define an object named ui that extends UI. What the ScalaDoc says is both more accurate and more flexible — “implement the ui field”. Because of the Uniform Access Principle, you’re free to implement the ui field as a
valor anobject(similarly, you can use avalorvarto implement adef). The only constraints (as reflected in the ScalaDoc asval ui : UI) are thatFor example: