//: c02:HelloDate.java // From 'Thinking in Java, 2nd ed.' by Bruce Eckel // www.BruceEckel.com. See copyright notice in CopyRight.txt. // // import javax.swing.*; import java.awt.event.*; import java.awt.*; import java.util.*; import com.bruceeckel.swing.*; import com.bruceeckel.util.*; /** The first Thinking in Java example program. * Displays a string and today's date. * @author Bruce Eckel * @author www.BruceEckel.com * @version 2.0 */ public class HelloDate extends JApplet { /** Sole entry point to class & application * @param args array of string arguments * @return No return value * @exception exceptions No exceptions thrown */ JTextArea ApltOut = new JTextArea(5, 40); String today = "Hello CS476/CS576 students, it's:\n" + (new Date()) + "\n"; public void init() { Container cp = getContentPane(); cp.add(new JLabel("HelloDate Applet!")); cp.setLayout(new FlowLayout()); cp.add(new JScrollPane(ApltOut)); ApltOut.append(today); } public static void main(String[] args) { Console.run(new HelloDate(), 500, 200); } } ///: