TERM 1 projectsVisualHangman4 (October 2002)
After most people said that my first version (developed for Java 1.4.1) didn't work in their browsers, I tried re-compiling it for earlier Java versions (1.3.1 on). But that meant me juggling programming between two versions. So now here's a single version that hopefully works with either the (sad) MicroSoft VM in Internet Explorer or any of the (niftier) Sun JVM plugin versions (v.1.3.1 and later). And I've now added some user-guidance (prompted by Doug, but aimed at my 7-year-old niece Laura). Plus - inappropriate buttons are now disabled anyway, so I guess it's fairly idiot-proof. Most people now tell me it works on their system. Dinah has tried it on a Mac at Uni of Brighton and it doesn't work, but we haven't worked out why. If my Hangman applet doesn't work on your system, please let me know. (Fellow students are welcome to use the same link about anything at all.) Visit this Sun downloads page to get a slick Java Virtual Machine for your browser. QwertyPanel (November 2002)
When I was playing with Visual Hangman, I found it weird using an alphabetic key layout - I'm so used to Qwerty layout now. But very young kids may prefer alphabetic layout. So I thought I'd set about coding a panel that was switchable between the two. I also learned to use a gridbag layout for the first time. And I eventually figured out how to make it into a stand-alone class and added methods to dis/enable keys, set soft Fkeys, add/remove ActionListeners and so on. So now I have a ready-made resource to include in whatever project I like by just coding This one works OK for me with the MicroSoft VM. See next section for update. QwertyPanel - version 7 (Nov 2002)This is a the latest version of QwertyPanel, with improved performance (more challenging in terms of program logic). ScaffoldCanvas (November 2002)
Another thing that bugged me when working on Visual Hangman was how to position the graphic. I wanted to put it in its own panel that I could move around and resize, but didn't know how. Then I discovered the Canvas class and that seemed to do the trick. The coding is a bit neater than before and you can set a scale factor to size it. Again, I put it in its own class and added a few useful methods. This works OK for me with the MicroSoft VM. RGB Scrollbars (November 2002)
A simple applet with sliders that make any 24-bit RGB colour formula. The separate RGB components are given in decimal and the combined color value is also shown in hex (useful for web programmers). MusicHangman1 (December 2002)
I've been planning this one for several weeks as a long-term goal. The idea was to produce something that encourages factual knowledge in music education that I could actually use on my music education website. The hangman game is similar to my previous attempt, without some of the frills. But before you start playing you have to choose from a number of different areas of musical knowledge, which are all stored in a database. Then you choose the fields for the word to guess and the clue, and then set the number of guesses you will be allowed before you are hanged. The program then chooses one of its records at random and uses that for the hangman game. At the moment the data itself is fairly primitive - I've been concentrating on getting the programming right. But in theory the database is limitless in terms of areas of knowledge and the number records contained within them. Plus, I've worked out how to include little sound files that signal joy or death at the end of a game and quiet 'thinking music' the rest of the time. (These don't seem to play in a browser with just the Microsoft VM, but they work fine with the Sun JVM.) Programming-wise, there are 6 different specialised classes that work together:
AudioTest1 (December 2002)
This is a simple test to see whether certain audio and midi file-types play from a remote connection. It may take eons for all the audio files to download before the applet can get going, so maybe you don't want to bother with this one. What I found out from it is that (in the context I am trying to use them) midi files (.mid) work fine locally, but not at all remotely . Audio files (.wav) work always - trouble is they're so huge! So I guess I'll have to compromise on on those hangman sounds until I find a better solution. [problem with midi files now solved - it was to do with an upper/lower case typo!] AudioTest2 (December 2002)
A simple test to check play() loop() and stop() methods on a MIDI file. DTMFplayer (December 2002)
The idea for this applet was one of the reasons I decided to learn Java! It addresses the MIDI hardware directly, so it won't work on a system with no MIDI/soundcard. It also doesn't seem to work using the Microsoft VM, so download the Sun JVM if you need to. I'm amazed that there seems to be so little latency (response delay), even on my 2-year-old system. This applet mimics the DTMF (Dual Tone Multi Frequency) behaviour of a telephone keypad. The idea behind DTMF is that there are different notes for each row and column of the button layout - the button you press gives two notes; one for its row and one for its column. In this applet you 'play' pairs of notes by holding the mouse down on a keypad button for as long as you want the notes to last. Releasing the mouse button turns the notes off. Unlike real phones, this applet allows you to interact with the settings to change the notes, timbres, volumes and pan settings. It addresses the computer's sound hardware and, if it finds a valid MIDI port, it presumes this is the ubiquitous General MIDI kind, with predictable implementation and 128 timbres available. Why did I do it? I had a new music education CD-ROM published about 6 months ago with various activities for secondary pupils. One of these is a project about using music to send secret messages. There's an area of my website that can be accessed from links in the CD-ROM. That's where I propose to add this applet (within the ciphers area) so that pupils can use it in their 'secret message' compositions. Anyone who has ever sent a text message from a mobile phone can easily see how it might be used. Before I started this 1-year Java programming course, I set myself the target of being able to generate individual MIDI messages (not just play Standard MIDI Files) by the end of it. So I'm really chuffed that I've been able to achieve this by the end of the first term! Programming-wise, there are 4 different classes that work together here:
Next projectWhat will it be??? |