Linking graphics to sound and mouse activation

Hello everyone,
The following code shows nine colored rectangles:
* Graphics Test
import java.awt.*;
import java.awt.event.*;
public class GraphicsTest extends Frame
     public static void main(String[] args)
          //The frame constructor
          Frame myFrame = new Frame();
          myFrame.setSize(800,620);
          myFrame.setTitle("Test board");
          myFrame.setVisible(true);
          myFrame.setBackground(Color.black);
          Graphics myGraphics = myFrame.getGraphics();
          // add a listener to close the frame
          myFrame.addWindowListener(new WindowAdapter()
               public void windowClosing(WindowEvent e)
                    System.exit(0);
          //add a listener for mouse pressed
          myFrame.addMouseListener(new MouseAdapter()
               public void mousePressed(MouseEvent e)
                    System.out.println("Mouse pressed at x=" + e.getX() + ", y=" + e.getY());     
          //draw a white separation line in the middle of the page
          myGraphics.setColor(Color.white);
          myGraphics.drawLine(0,310,800,310);
          //the rectangles
          myGraphics.setColor(Color.white);
          myGraphics.fillRect(65,55,60,30);
          myGraphics.setColor(new Color(255,255,32));
          myGraphics.fillRect(145,55,60,30);
          myGraphics.setColor(new Color(255,42,0));
          myGraphics.fillRect(235,55,60,30);
          myGraphics.setColor(new Color(255,255,0));
          myGraphics.fillRect(345,55,60,30);
          myGraphics.setColor(new Color(107,199,90));
          myGraphics.fillRect(425,55,60,30);
          myGraphics.setColor(new Color(255,119,0));
          myGraphics.fillRect(30,335,60,30);
          myGraphics.setColor(new Color(195,0,195));
          myGraphics.fillRect(110,335,60,30);
          myGraphics.setColor(new Color(108,216,61));
          myGraphics.fillRect(190,335,60,30);
          myGraphics.setColor(new Color(60,161,255));
          myGraphics.fillRect(270,335,60,30);
}Each rectangle symbolizes a sign (or letter) of the alphabet and its corresponding sound. For instance, the first rectangle, in white, of the upper row corresponds to the letter "a". The first rectangle, in orange, of the lower row corresponds to the letter "m". Clicking on a rectangle should make it possible to hear its corresponding sound. Moving the mouse from one rectangle to another should make it possible to build words. My first problem is how to link each rectangle with its corresponding sound, as pre-recorded in a sound file (in .wav or .au format) and how to activate this sound with a mouse click. My second, slightly more complex problem is how to control the motions of the cursor from one rectangle to another and the speed of the moves with a timer.
Any help or hint on how to solve each or both of these problems will be very much appreciated.

Satellite A505-S6005 
..the sound "burping" at me periodically. ... It's kind of like a digital croak or a stutter all rolled into one.  It now likes to do this exactly at midnight every night, when the CPU usage will spike, but I can't find anything running at that time..
 Maybe when the PC Health Monitor runs?   
   Document ID: 98082921
-Jerry

Similar Messages

  • Track keyboard and mouse activity?

    Is there any way to track my keyboard and mouse activity? Like mouse clicks etc, Im not interersted in any kind of keylogger.
    Edit: I found this: http://whatpulse.org
    Last edited by Hund (2011-01-03 02:28:09)

    Check your batteries in the wireless hardware.
    For the wired hardware see KB Article & do the necessary:  http://support.apple.com/kb/HT1379

  • Satellite P30-110 video, sound and mouse is jerky

    Hi everyone,
    I am running Win XP Pro. I had been having problems with my laptop for sometime now that whenever the hard drive was nearing full the entire system would start acting up in that when the system started up the Windows login sound would sounds like a CD skipping, then my mouse would jump around the screen and basically not move in a flowing manner, if I then try to watch video its like watching a DVD that skips and jumps every few seconds.
    So to try and rectify this I did a much needed clean install of Windows. This seemed to fix the problem until after I installed the ATI display driver, I think, it may have been the previous drivers for the Toshiba Console/Control. So if the problem is the display adapter, what other options do I have? Or is it something else altogether?
    Any help will be much appreciated!

    >So if the problem is the display adapter, what other options do I have?
    If this issue is related to the graphic chip then you have no many options; in such case the chip malfunction and should be replaced. But the point is that the graphic chip is not possible but only the whole motherboard replacement!
    The mobo is not cheap and it would be a costly affair to replace such part. In my opinion its not worth to replace the mobo
    But the point is that we dont know whats wrong exactly. Maybe its not a graphic card problem.
    Did you try to reinstall the OS using the Recovery disk?
    You should try this because the recovery disk already contains the necessary drivers and tools.
    The issue could be related to a HDD issue. if the HDD start to malfunctions (it would rotate slower or some sectors would be damage) then the access to the data would be affected and the notebook could start to interrupt.
    As you see, this are only some suggestions and I think nobody would be able to say, whats wrong until the notebooks hardware has been checked!

  • Sound and Mouse Problem on Toshiba Satellite A505 S6005 - Related?

    Hello-
    I bought my A505 back at the end of April and have had these two annoying problems that I have been trying to solve for about three plus months now.  The first started right out of the box as it were and it involves the sound "burping" at me periodically.  It's a hard sound to describe.  It's kind of like a digital croak or a stutter all rolled into one.  It now likes to do this exactly at midnight every night, when the CPU usage will spike, but I can't find anything running at that time (I don't have any virus scans, defrags, etc. set for that time).  High CPU usage normally doesn't cause this anyway - I'll be running how many programs and the sound will be fine.
    My other problem is a recent one and that is that the mouse pointer will periodically just hang up for a few seconds every so often.  It's not a battery problem (I use a wireless Logitech) seeing as I keep it well fed and I tried using a wired mouse and got the same hang up.
    Are these two problems related?  I've tried to find information on this but haven't found anything useful to me.  I've tried turning down the fancy settings on my Windows, turning of my webcam and microphone, everything.
    I would greatly appreciate any help, thanks!
    My system info:
    Model Name                                  Satellite A505
    Part Number                                 PSAT6U-005002
    Serial Number                               2A017921Q
    OS Version                                   Microsoft Windows 7 Home Premium    6.1.7600
    BIOS Version                                1.20
    CPU                                             Intel(R) Core(TM) i3 CPU       M 330  @ 2.13GHz
    Physical Memory                          4096MB RAM
    Hard Disk Capacity                      487,361,343,488 [Byte]   453.891 [GB]
    Hard Disk Free Space Capacity     389,158,993,920 [Byte]   362.433 [GB]
    Video                                          Intel(R) Graphics Media Accelerator HD   version=8.15.10.1986
    Screen Resolution                        1366 x 768 Pixels
    Color Quality                               True Color (32 Bit)
    Sound                                         Realtek High Definition Audio   version=6.0.1.5972
                                                      Intel(R) Display Audio   version=6.12.0.3037

    Satellite A505-S6005 
    ..the sound "burping" at me periodically. ... It's kind of like a digital croak or a stutter all rolled into one.  It now likes to do this exactly at midnight every night, when the CPU usage will spike, but I can't find anything running at that time..
     Maybe when the PC Health Monitor runs?   
       Document ID: 98082921
    -Jerry

  • Sound and mouse scrolling not working in windows 8

    I installed windows 8 on my Imac (late 2011). I have managed to solve most of the compatability issues but the three I have left are No Sound (I really need this), scroll wheels dont work on any mouse (nor does the touch functions of the magic mouse), and the facetime camera doesn't work. If you could help me solve any of these issues it would be excellent. Also yes I am aware that apple will eventually release drivers for windows 8 but I need it now, so don't tell me to wait. Thanks in advance for any help you can give!

    cyclonestoney wrote:
    I installed windows 8 on my Imac (late 2011). I have managed to solve most of the compatability issues but the three I have left are No Sound (I really need this), scroll wheels dont work on any mouse (nor does the touch functions of the magic mouse), and the facetime camera doesn't work. If you could help me solve any of these issues it would be excellent. Also yes I am aware that apple will eventually release drivers for windows 8 but I need it now, so don't tell me to wait. Thanks in advance for any help you can give!
    Wait. Or, remove Windows 8 and install Windows 7. Or, install Windows 8 using Parallels or Fusion rather than using Bootcamp Assistant.

  • Screen, Sound, and Mouse Stop and go Freezing

    Mainly in two game Apps, World Of Goo and Defcon the screen/sound freezes in a stop and go 'stuttering' like way, I have been trying to resolve this issue for a while now with Defcon but recently got World of Goo and noticed the same problem... Any insight or help would be greatly appreciated, Thanks,
    Ryan

    Well I reinstalled the OS and reupdated to the current OS 10.5.7 at the recommendation of a tech at 1800-SOS-Apple, I'm beginning to wonder if this is some kind of hardware failure, perhaps the Video card is going bad? I can usually play these games for a few mins without incident, but then comes the Ticking stop and go....Activity Monitor doesn't show any software 'above' these Apps when this problem is happening

  • Satellite P200D-11R sound and graphics crash after waking up from sleep mode

    Hi,
    I am wondering if anyone here has had similar experiences to mine (below) or can offer any solutions.
    I have upgraded my P200D-11R OS to Vista 64 Ultimate to take advantage of the extra performance. I also add that the BIOS has already been updated to version 1.4.
    Well, everything works fine with the standard 2Gig of RAM which the laptop was supplied with originally, however, when I upgrade the RAM to 4Gig (2 x 2GB Samsung 667mHz modules), sound and graphics problems appear every time the machine is brought back from sleep mode.
    The sound card makes a very laud fuzzy noise every time it wants to play a sound and the graphics produce lots of horizontal lines on the screen. I then just have to restart the machine which means loosing all my unsaved work.
    Everything works fine as long as the machine does not enter sleep mode. I have currently disabled the sleep mode to prevent the machine from entering it but I am finding life very hard without it.
    I am very surprised and also disappointed at the fact that Toshiba did not test these machines with Vista 64 Ultimate and 4Gig of RAM!
    Extra info:
    The memory is the same Samsung type as the 1Gig modules supplied by Toshiba originally with the machine, and the part number Toshiba recommends.
    I have tried installing other (more recent) device drivers by Realtek and ATI without any improvements.
    The memory modules pass all tests and are not defective. They have also been tested on my friends Dell notebook with no problems even in sleep mode.
    I have installed my friends Dell 2Gig memory modules in my P200D and they too produce exactly the same results with post-sleep crashes.
    My thoughts are that this must be another BIOS issue unless anyone can shed some light on the issue from another angle.
    Please help! Many thanks in advance.

    Hi Sascha
    Since you are running a Vista 32bit version, the upper limit of the memory recocnised by the machine is 3.2gb which is the maximum a 32bit operating system can address and use. The diffrence here is that I also upgraded my OS to Vista Ultimate 64bit to get yet better performance out of the 64bit dual AMD processor.
    3.2gb of RAM on 32bit OS does not necessarily increase the performance. However, it keeps the performance stable when you open many more programs at the same time since the machine has more RAM to play with before staring to use the much slower hard drive as operating memory (Page File), to keep all thoes open programs running.
    A 64bit OS such as Vista Ultimate 64, recognises the whole 4gb of RAM and much more (for instance, 8gb with 2 x 4gb RAM modules). The 64bit OS itself would generally consume more RAM to start with, however, with 4gb I found the general performance to be much better. Going back to the problem however, my P200D-11R with Ultimate 64 and 4gb RAM refuses to wake up from sleep mode gracefully and the graphics and sound crash every time, forcing me to restart.
    My feelings at present is that eventhough your machine may be slightly different, I bet if you upgrade your OS to 64bit, the machine will start recognising all of the 4gb of RAM and post-sleep crashes will start to appear!

  • I am using ALSA and Icecat. When I play any html5 audio/video it works, but the next time i click on another audio/video link I lose sound.

    I am using Parabola (a fork of archlinux), Icecat 31.4 and ALSA
    Icecat and firefox seem to hold onto the soundcard when I click on a new html5 audio/video link in the same tab. The next video/audio element loses sound. If I wait 10 seconds and click back to the start of the audio/video, the audio returns. I often get cpu spikes for icecat when it happens.
    I have tried this with both motherboard and usb sound and I get the same problem. I have disabled extensions (addons) in Icecat, deleted profiles, reinstalled the browser and even installed firefox from the AUR and it still occurs.
    I have disable gstreamer in about:config and restarted and it still occurs.
    My .asoundrc is this:
    pcm.!default {
    type plug
    slave.pcm "hw:0,0"
    All my other audio applications work. I have noticed that if I use pulseaudio it fixes it, but it should work without anyway, like it used to. I think something happened after an update, but I'm not sure.
    Any help would be appreciated. I know it's not a big problem, but it's really frustrating and I've had it for ages. I even switched browsers to get away from it.

    *nerding out*
    I am not an expert in this and if we get stuck I have found a mailing list for the alsa project that can be contacted: http://www.alsa-project.org/main/index.php/Mailing-lists
    Gstreamer is disabled in Firefox as well as the os?
    Since you are seeing issues with ogg files and moving video/audio combination I started to dig into file formats {sox http://sox.sourceforge.net/soxformat.html}
    For ogg would the file format affect the "raw"?
    defaults.pcm.file_format "raw"
    Updated libraries
    alsa-lib-1.0.6-8.FC3
    alsa-utils-1.0.6-3
    No no, here:
    http://oss.sgi.com/LDP/LDP/linuxcookbook/html/cookbook_27.html#SEC377
    Is the OGG cpu intensive for your alsa architecture? [http://alsa.opensrc.org/Ogg]
    Troubleshooting sound on Linux to narrow down the issue: [http://www.troubleshooters.com/linux/sound/sound_troubleshooting.htm#the_steve_litt_diagnostic_tools]
    References: [http://www.alsa-project.org/main/index.php/Minivosc]
    [http://www.troubleshooters.com/linux/sound/sound_troubleshooting.htm#the_steve_litt_diagnostic_tools]
    I am sorry, this is where I can no longer help. Please seek the guidance of the Linux forums or that alsa mailing list.

  • TS3048 My early 2009 Mac Pro does not connect via bluetooth to my sound bar or bluetooth mini speakers. Both my wireless keyboard and mouse have no problems connecting. What do I need to do to connect to external bluetooth devices?

    My early 2009 Mac Pro does not connect via bluetooth to my sound bar or bluetooth mini speakers. Both my wireless keyboard and mouse have no problems connecting. What do I need to do to connect to external bluetooth devices?

    I would always have a wired keyboard and mouse on hand (need not be expensive ... any cheap wired devices will work).  "Emergency recovery" procedures can activate features in random order, so the opportunity to select a recovery partition may pass before the wireless devices are recognized.
    That will let you select the "turn on Bluetooth" icon.

  • I own a iPhone and I have in ÇáÇí Cloud account, but has been disabled worked ريستور and what worked device device is linked to the account books first and I am I do not know the account and password and wrote activation iphone and I am ready to prove tha

    I own a iPhone and I have in ÇáÇí Cloud account, but has been disabled worked ريستور and what worked device device is linked to the account books first and I am I do not know the account and password and wrote activation iphone and I am ready to prove that this device is not stolen any way you want

    Apple does not participate in these forums.  We're only users like you.

  • Linking wireless network through airport extreme to sound and video

    I wish to use mac mini and/or macbook pro to link hd lcd tv and stereo amplifier (home theatre) system. Not sure how to proceed. Have basic components and want to do it right the first time.

    It sounds like you are making things much more difficult than they need to be.
    Perform a Hard Reset on the AirPort Express by holding in the reset button on the back of the device for 7-8 seconds and then release. Allow 30-40 seconds for the Express to restart to a slow, blinking amber light.
    Make sure that the Ethernet cable from the AirPort Extreme is connected to the WAN "O" port on the AirPort Express
    Click on the fan shaped AirPort icon at the top of the Mac's screen and look for a heading of New AirPort Base Station. Just below that click on the AirPort Express and AirPort Setup wil open automatically.
    It wil take AirPort Setup about a minute to analyze your connection and display a message that the Express will be configured to "extend" the wireless network. Enter a device name for the AirPort Express and click Next.
    AirPort Setup will take another minute or two to configure things for you. When you see the Setup Complete message, click Done.
    You should be in business.

  • Every keystroke and mouse movement, I get an audio notice that I need to shut off. In Safari, the cursor cycles thru every link and metadata field and I get a verbal/audio notice of what it is.  How do I shut this option off???

    Every keystroke and mouse movement, I get an audio notice that I need to shut off. In Safari, the cursor cycles thru every link and metadata field and I get a verbal/audio notice of what it is.  How do I shut this option off???

    Press the key combination command-F5 to deactivate VoiceOver. If that doesn't work, proceed as follows.
    For OS X 10.7: From the menu bar, select
     ▹ System Preferences ▹ Universal Access ▹ Seeing ▹ VoiceOver: Off
    For OS X 10.8 or later: Select
     ▹ System Preferences ▹ Accessibility ▹ VoiceOver ▹ Enable VoiceOver: Off

  • [Python pygame] Graphic equalizer - keeping sound and video in sync

    Hi!
    I'm writing a graphic equalizer in python and I want to use pygame for the video and audio output.
    The video display of the moving bars works great, now that I have a correct way to read samples and decode them.
    The problem now is: they're way out of sync with the audio playing in the background!
    At the moment my code, that draws the bars basically looks like this:
    # loop as long as we can get slice of the audio file for the fft
    for n_frame in range(0, len(framebuffer), fftframesz):
    clock.tick_busy_loop(t_loop)
    # t_loop was defined as fftframesz over total_frame_count
    # which means in words: t_loop is the amount of FFTs per second - or the cycles of THIS loop
    # grab the frames and perform the fft here
    ...numpy.fft.fft...
    # set the new bar heights and draw them
    for bar in bars:
    bar.update()
    # if playback has not started yet, make it so
    if not pygame.mixer.get_busy():
    musicfile.play()
    The way I'm thinking, this should be enough to keep sound and video in sync. Because we know the time that one cycle should take at most,
    we can set the clock to tick_busy_loop this time. This way we make sure that the video is not faster than the sound.
    But to me it seems that is is the other way round, i.e. that the video is slower than the sound. I already did some timing, but to no avail.
    Is there perhaps a more easy, more elegant way to make sure that image and audio are in sync?
    Any help is greatly appreciated!
    Last edited by n0stradamus (2012-10-01 18:36:53)

    Thanks for your ideas. I assume you mean I should go with a $1200.00 final cut pro software. NOT.
    Sure the video will be on myspace and youtube but wether they are noticed or not is not as important as self satisfaction. I can easily split scenes into equal time zones as I said. Then drag them into clips and back all using the same camcorder. Multiple cameras and angles would be nice but this can be done on a low budget and still look good. I guess my original questions were not answered. Is there a way to determine the length of a transition and shorten the clip by that amount. Or the length of a still shot and do the same. Or perhaps they have been answered and the answer is NO WAY, and I am just not hearing it.
    I suppose reimporting a video would be great if I could use two timelines like in audio and then blank out what I don't want in the first. But I just don't think this is possible, or is it. I've been reading iMovie HD6 The Manual that should have been in the box. It's a help but doesn't take you from the beginning of a project to the final project. Exporting to imovie or idvd is not an issue. BTW I got the clips in sync as I said by leaving blank spots and placing effects over them. I could insert the proper length video in those spots but that can look silly without transitions. But then again so can transitions. This stuff is very fun and interesting and a great learning experience. If I stop now as you suggest then I am not pushing myself to the limit. But thanks for your reply.

  • How do I stop keyboard and mouse sound effects?

    I have tried everything for turning off sound effects on the Mac, but it is still making noises when I type or click the trackpad. How can I get these annoying noises to turn off?

    Are you saying that, with the sound muted, you're still getting those sounds? Are you certain they are coming from the computer's speakers? Try plugging in a pair of headphones... do you hear the sounds through the headphones? Are the sounds playing for every single keypress and mouse click?
    If you have any external mice or keyboards, disconnect them. Any nearby Bluetooth keyboards or mice should be turned off or have their batteries removed. Does this make a difference?
    Try restarting the computer in safe mode. Test while in that mode. Does the problem continue?
    These problems are not due to any kind of malware. There is no known malware for the Mac that behaves this way.

  • Why does my compuer lose its cursor and/or loses sound and have to use mouse to get back?

    I will be typing along and suddenly nothing shows on screen and have to use mouse to get back.
    Also will be doing solitare or other game and lose sound and have to mouse to get things moving again.Is this a virus?
    I updated my windows and nothing showed as a problem there.

    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    *Don't make any changes on the Safe mode start window.
    *https://support.mozilla.com/kb/Safe+Mode
    *https://support.mozilla.com/kb/Troubleshooting+extensions+and+themes

Maybe you are looking for

  • How do i limit the number of emails displayed in ios 8

    I want to limit the amount of emails that are downloaded to my mail app. I can only find instruction for doing this in ios7. I am using ios8. I don't have a "Mail Days to Sync" option. Any ideas?

  • Purchase order for external service

    Dear experts, I tried creating a purchase order for a service, with account assignment unknown U, with item category D, but after entering the item details in the item overview, it keep saying " ACCOUNT ASSIGNMENT UNKNOWN NOT ALLOWED WITHOUT GOOD REC

  • Fillable Form field in PDF

    Hello All, I'm new to all things Oracle, and I'm not even sure if this is posible. I am using Application Express 3.1 and I'm trying to create a report that prints to PDF with fillable form fields. I am using RTF templates to create the layouts. I ca

  • IPad 2 smart cover sleep/lock problems?

    Been using my iPad for a good month now.  I'm loving it.  I have noticed that using the smart cover, you have to have the pass code on in order for the cover to put the device into sleep/wake.  When I have the passcode setting off, the smart cover al

  • Syntax error in Update Routine

    Dear All, While trying to update infoobject /BIC/ZGROSSPRI in an ODS in BI through an update routine, a syntax error is thrown when I am defining a variable of type  tys_TG_1-/BIC/ZGROSSPRI. For instance, DATA: VALUE TYPE tys_TG_1-/BIC/ZGROSSPRI. The