Friday, September 26, 2008

Class 4 - Resources

Please click on the 516 files button on the left to access the files for class.
Dr. Jim Kasum will be filling in for me tonight. I know you will enjoy the time with him.

Sunday, September 21, 2008

Thanks to the Stritch Network Folks....

I asked the Stritch Network techs to set up the web server so that it would allow the direct download of .java files. It is done and works. Starting today you will be able to download or directly open .java files from the web. This will make it much easier to use the files from the website.

Thursday, September 18, 2008

Study Team Logs - CEDu516


Use this button to fill out the study team form. Print before submit to keep a copy.

Monday, September 15, 2008

September 15th CEdu516

In a small group, i.e. 2 or three at the most, please complete exercise 4.12 on page 83 and 84.

The file you need, Counter.java is on the file site. Use the button on the left and go to class2 folder. Be sure to take the .txt off the file or just paste the text into jgrasp.

This is should not take more than a few minutes, ok, 15 minutes.

Then I will talk about what you have done. DO NOT PRINT OUT THE RESULT, just show it to me. (And save them!)

Thursday, September 11, 2008

Changing a Foreground color:

After a little research, I found how to change the foreground color in a JLabel and therefore in the content pane of the kinds of applications we are writing. (Thanks Stephen)

You need to set the Opaqity or opaqueness of the label to change the forground. Note lines 13, 29 and 30 below:



1 // RedText

2 import java.awt.*;

3 import javax.swing.*;

4

5 public class RedText extends JFrame

6 {

7 private JLabel aLabel; // JLabel that displays text

8

9 // no-argument constructor

10 public RedText()

11 {

12 // get content pane and set layout to null

13 Container contentPane = getContentPane();

14 contentPane.setBackground( Color.LIGHT_GRAY );

15 contentPane.setLayout( null );

16

17 // set properties of application's window

18 setTitle( "REDText Demo" ); // set title bar string

19 setSize( 608, 143 ); // set width and height of JFrame

20 setVisible( true ); // display JFrame on screen

21

22 // set up aLabel

23 aLabel = new JLabel();

24 aLabel.setText( "I am red text on light gray!!" );

25 aLabel.setLocation( 30, 0 );

26 aLabel.setSize( 550, 88 );

27 aLabel.setFont( new Font( "Serif", Font.PLAIN, 36 ) );

28 aLabel.setHorizontalAlignment( JLabel.CENTER );

29 aLabel.setOpaque(false);

30 aLabel.setForeground(Color.RED);

31 contentPane.add( aLabel );

32 }

33

34 // main method

35 public static void main( String[] args )

36 {

37 RedText application = new RedText();

38 application.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );

39

40 } // end method main

41

42 } // end class RedText




Wednesday, September 10, 2008

Accessing Files For Class


When accessing files from the CEd ftp site, using the button below, please note the directions below the button:



I've added a .txt to all the java files on this site. Right click on the file you want, choose "save target as" from the menu and then drop the .txt off to use the file on your computer.

Wednesday, September 3, 2008

CEd 516 - Programming in Java

We will be meeting in Ed101 - From 5 to 9 on Mondays until October 13.
This is in the ED building.


Textbook:Simply Java Programming, (Deitel, Deitel, Listfield, Yaeger, Zhang) Prentice Hall Publisher – Upper Saddle River, New Jersey ISBN: 0 – 13 – 142648-6

Links to booksellers: (None of these are endorsed or tested)


Save Money on Textbooks - from the folks at Dealnews




Course Syllabus (As a Google Doc)







Read this document on Scribd: CEd516 SYL Fall 2008



Here are the .java files for testing your system. (Cut and paste them into jgrasp or your editor)


// a very simple program

// use this to make sure your equipment is

// set up right for command line use

// Written by John Sklar for CEd516

//



public class test_console

{

public static void main (String args[])

{

System.out.println("Is this in the command window?");

}

}





 // a very simple program

// use this to make sure your equipment is

// set up right

// Written by John Sklar for CEd516

//

import javax.swing.*;



public class test_setup

{

public static void main (String args[])

{

JOptionPane.showMessageDialog( null,

"Testing 1 2 3...",

"This is just a test",

JOptionPane.INFORMATION_MESSAGE);

}

}