I�m a �novel java teacher� from Colombia (ENGLISH ISN'T MY FIRST LANGUAGE) trying to design my own approach for teaching how to create GUI applications using Swing. My idea is to determine a sequence of easy to follow steps for my students. I�m reading the tutorial �Creating a GUI with JFC/Swing� from Sun Microsystems but its methodology is not yet clear to me. So these are the steps that I want to share to all you in the hope you can help me. 1.Import the pertinent packages. 2.In the class declaration implement the appropriate interfaces or extends a class that implements a listener interface. 3.Declare all the class� members. 4.Create and setup the objects you�ve already declared. 5.Add the components down-to-top (first group components in low level containers -e.g. JPanel - then add them to the top level - JFrame, JDialog, JApplet-). 6.Register the instances of the event handler class ones as listener on one o more components. (Steps 4-5-6 in the constructor method). 7.Write the code, in the vent handler class, that implements the methods in the listener interface. 8.Following Sun recommendation: �Be thread-safe�
What do you think about it? Am I correct (wrong)? How can I improve the guidance? What happens if the exercises become progressively more difficult? Thanks in advance for your cooperation.
I would start with coding the basic applet with only a button that doesn't do anything & have the class test it to see early on that they are accomplishing something. After that, you can iteratively add functionality such as events, listeners, and "business logic".
Every time the students write a few lines of code they should be able to see the results to really understand what the code does.
Thanks Marc for your gently reply. I forgot to mention that the students I going to teach to, have some basic Java knowledge and the course is about GUI. You�re right, it�s better to go slower, but I need a sequence of steps that my students can follow in order to create interactive GUI with Swing. The Passionate link is great, (Is Kathy Sierra the girl on the picture in the �about page�? if so, she's young and very beautiful), I found very useful information for improving the way we teach and the way we learn, THANKS ONCE AGAIN.
He baked a muffin that stole my car! And this tiny ad: