Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Business Applications of Structured (and Object Oriented) Programming MSIS 33:623:388 Homework 0 Instructor: Farid Alizadeh Due Date: None last updated on September 18, 2000 A Warm Up Assignment This assignment will not be collected or graded. We have given it here so that you can go through the cycle of opening, writing, saving, compiling and running a Java program. Use a good editor and type the following program. You may use Wordpad or Notepad accessories of Windows (click on start, choose accessories and then either Notepad or Wordpad, with preference to Wordpad.) However I recommend using emacs editor for editing Java programs. To learn how to download emacs checkout the resource page. The Java code is presented on the next page. 1 MSIS 388, Fall 2000 Homework 0 Due date: none import javax.swing.*; import java.awt.event.*; import java.awt.*; class test{ public static void main(String[] arg){ JFrame frame=new JFrame("Congratulations!"); Container pane=frame.getContentPane(); JLabel label1 = new JLabel("Congratulations! You did it!"); label1.setBackground(Color.red); label1.setForeground(Color.cyan); label1.setFont(new java.awt.Font("SanSerif",1,24)); label1.setOpaque(true); JLabel label2 = new JLabel("Add a boy/girl! You are marvelous!"); label2.setBackground(Color.cyan); label2.setForeground(Color.red); label2.setFont(new java.awt.Font("SanSerif", 1, 24)); label2.setOpaque(true); JLabel label3 = new JLabel(" "); label3.setBackground(Color.orange); label3.setFont(new java.awt.Font("SanSerif", 1, 24)); //label3.setVisible(false); label3.setOpaque(true); pane.setLayout(new BorderLayout()); pane.add(label1, BorderLayout.NORTH); pane.add(label2, BorderLayout.SOUTH); pane.add(label3, BorderLayout.CENTER); //frame.add(pane); frame.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { System.exit(0); } }); frame.pack(); frame.setVisible(true); } } 2