r/javahelp • • May 19 '15

Help a AP CS student out...please

Hey guys,

So in my AP Computer Science class I was assigned a final project.. My friend and I decided to try to make a piano/cello that plays a sound when a user presses a key on the keyboard. However, my teacher taught us almost nothing on how to make a GUI or even what it is really, and we barely know how to do anything more than for loops, while loops, etc. Are there any tips for beginners like us? I cannot find good tutorials regarding GUIs and using sounds in java, or if any of you guys can help i'd appreciate it. Thanks.

2 Upvotes

9 comments sorted by

View all comments

2

u/whizvox Graduate and Tutor May 19 '15

If you don't know anything more than for loops, I recommend doing a simpler project more suited to your level of knowledge. Here's a list of projects you could do: http://www.dreamincode.net/forums/topic/78802-martyr2s-mega-project-ideas-list/

1

u/cosmorocks May 19 '15

He required us to pick things that were outrageously hard for our level... Those projects would be not allowed

6

u/whizvox Graduate and Tutor May 19 '15

You're in an AP CS class, and you've been taught what I've taught myself in about 3 weeks. Something's wrong there.

Here are some Swing examples: http://zetcode.com/tutorials/javaswingtutorial/firstprograms/

Here's how to play a simple audio file: http://alvinalexander.com/java/java-audio-example-java-au-play-sound

Here's how to add an ActionListener to your button (the code executes when you press the button): http://www.javaprogrammingforums.com/java-swing-tutorials/278-how-add-actionlistener-jbutton-swing.html