Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 [Tutorial] Swing by example
Index -> Programming, Java -> Java Tutorials
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
McKenzie




PostPosted: Fri Mar 18, 2005 9:57 am   Post subject: [Tutorial] Swing by example

I am by no means claiming to a Swing master. I just know that when I'm learning something new I like to have a bunch of simple examples. Ones that you can get your head around so that you can focus on the one small thing you are trying to add to your knowledge. If any of these examples contradict what Rizz has said odds are he's right Embarassed


McK Swing.zip
 Description:

Download
 Filename:  McK Swing.zip
 Filesize:  321.52 KB
 Downloaded:  495 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
wtd




PostPosted: Fri Mar 18, 2005 2:12 pm   Post subject: (No subject)

A note: many of the classes will not run because they lack entry points (main).

Additionally, Swing12 claims to correct something in Swing11, yet when run both appear identical. This could be very confusing.

Some programs, when run, and upon clicking the close button, do not exit. Again, this could be very confusing for someone unfamiliar with how to interrupt the program, or who isn't using the command-line to run them.

Oh, one other thing. Avoid method calls that look like:

code:
myMethod ();


Though this works, the preferred coding style for Java is:

code:
myMethod();


It's good to encourage this because at least a few languages students may encounter later allow arguments with and without parentheses. In these languages if there's a space, it perceives the parentheses as simply surrounding the first argument to the function.
McKenzie




PostPosted: Fri Mar 18, 2005 2:38 pm   Post subject: (No subject)

Swing1 is the only one that lacks a main. In the IDE that 90% of the students use (Ready) it will set up a dummy main. I was just trying to boil it down to the absolute bare-bones.
Swing11 allows you to select all of the days independantly of each other, Swing12 fixes that.
The not closing issue: I like to point out the problem before we add the fix.
As far as the spacing goes, the Ready IDE has an auto-indent feature. Because I'm fairly new to Java I've been relying on it to decide where the spaces should go (well sometimes.)
wtd




PostPosted: Fri Mar 18, 2005 2:40 pm   Post subject: (No subject)

McKenzie wrote:
Because I'm fairly new to Java I've been relying on it to decide where the spaces should go (well sometimes.)


It's wrong. Smile
Display posts from previous:   
   Index -> Programming, Java -> Java Tutorials
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 4 Posts ]
Jump to:   


Style:  
Search: