CIS525 - Lecture#19 - November 8, 2000
LABELS: page 710
-----------------
Label label = new Label("____");
add(label);
- can use layout manager, where drawString cannot
See page 712, Labels.java
SCROLL BARS AND SLIDERS: page 716
---------------------------------
- use BorderLayout or GridLayout
- least reliable for cross platform implementations, be sure to test in different environments
See WastedSpace.java page 720
- you can have many scrollbars, see Scrollbars.java page 721
EVENTS, (1.0) page 726
----------------------
1) SCROLL_LINE_UP
SCROLL_LINE_DOWN
SCROLL_LINE_PAGE_UP
SCROLL_LINE_PAGE_DOWN
SCROLL_LINE_ABSOLUTE
POP-UP MENUS, (1.1) page 742
----------------------------
Procedure:
1) allocate menu
2) add some items
3) watch for trigger to display it
See ColorPopupMenu.java page 743
END OF CHAPTER 13
- Perl tutorials added to 525 course page
- created for better pattern matching, syntax somewhat similar to ANSI C
interpretted language
- be sure to make directories are executable; chmod a+rx ~/bin
#!/usr/local/bin/perl -w //this is the first line, the paths MAY be different
if ($#ARGV >= 0) { $who = join(' ', @ARGV); }
else { $who = 'World'; }
print "Helo, $who!\n";
- the above is a complete program...Perl's version of "Hello World!"
3 types of variables
1) Scalars: numeric or character
$x
2) Arrays of scalars, (aka lists, sequentially arranged scalars)
(13,14,15,16,17,18,19)
or
(13..19)
@whole_list
%days = (jan,31
feb,28
mar,31)
3) Associative Arrays - (aka hashes, help you remember things)
$days{jan} = 31 where 'jan' is the key and '31' is the value
$_ denotes variables that aren't specified
sub square { return $_[0] ** 2; }
print "5 squared is ", &square(5);
- the above is subroutine definition and call, each cal proceded by &
See tutorial page for literals and operators
comparison and assignment operators, (==, =) similar to C/C++
See tutorial page for loops and I/O info
for (;;) => infinite loop
See tutorial for calculator example
See tutorial for file I/O
See 'perlbits' from 525 page, (John Donahee), for useful syntax hints