CIS279-BASFORD-06/18/01

Java Programming
CIS279
Tori Basford
tori@bly.net

Assignment(s):
Homework 2, Part a (JScrollPanes)

Exercise(s):

  1. See handout ()

More about the String class:
The String class contains a variety of object methods that each String object can use.


The compareTo() method returns an integer. This integer is positive if the string passed to the method is larger, and returns a negative number if the string passed is smaller. The actual numeral amount relates to how much higher or lower the value of the string is. If the int returned is 0, then the strings are equal.

More on File Handling:
The FileReader.fr() returns an integer value that is the character code.



example:
FileReader fr = new FileReader("File.txt");
if (fr.read()==-1) { System.out.println("End of File"); }

More Swing Components:
JTextArea is like a JLabel, but it allows multiple lines. You can set the size of it by passing it ints for columns and rows when it is initialized (ie, JTextArea jta = new JTextArea(20,80)).

A JScrollPane is like a Panel, but you put one object in it. The JScrollPane will then allow you to scroll around if the object is bigger than the pane. The object is specified at initialization (ie JScrollPane jsp = new JScrollPane(jta);).



[ return ]