From JavaWIDE
|
01 importimport means to make the classes and/or packages available in this program javax.swing.*;
02 importimport means to make the classes and/or packages available in this program java.awt.*;
03 importimport means to make the classes and/or packages available in this program java.awt.event.*;
04 importimport means to make the classes and/or packages available in this program java.io.*;
05 importimport means to make the classes and/or packages available in this program java.net.*;
06
07 /**
08 * All about my applet here.
09 * @authorthis is the Javadoc tag for documenting who created the source code Jam Jenkins
10 */
11
12 publicpublic is used to indicate unrestricted access (any other class can have access) classclass is a group of fields and methods used for making objects SampleApplet extendsextends means to customize or extend the functionality of a class JApplet
13 {open braces start code blocks and must be matched with a close brace
14 publicpublic is used to indicate unrestricted access (any other class can have access) voidvoid means the method does not return a value init()
15 {open braces start code blocks and must be matched with a close brace
16 JLabel click =this assignment operator makes the left side equal to the right side newnew is used to create objects by calling the constructor JLabel();
17 Image image =this assignment operator makes the left side equal to the right side getImage( SampleApplet.classclass is a group of fields and methods used for making objects.getResource( "JavaWIDE.png" ) );
18 click.setIcon( newnew is used to create objects by calling the constructor ImageIcon( image ) );
19 Container content =this assignment operator makes the left side equal to the right side getContentPane();
20 content.setBackground( Color.BLUE );
21 content.setLayout( newnew is used to create objects by calling the constructor BorderLayout() );
22 content.add( click, BorderLayout.CENTER );
23 }close braces end code blocks and must match an earlier open brace
24
25 publicpublic is used to indicate unrestricted access (any other class can have access) voidvoid means the method does not return a value start()
26 {open braces start code blocks and must be matched with a close brace}close braces end code blocks and must match an earlier open brace
27
28 publicpublic is used to indicate unrestricted access (any other class can have access) voidvoid means the method does not return a value stop()
29 {open braces start code blocks and must be matched with a close brace}close braces end code blocks and must match an earlier open brace
30 }close braces end code blocks and must match an earlier open brace
|
Download/View SampleApplet.java