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

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

1

u/oddwhirled Semi-New Brewer May 20 '15

Have you leaned about inheritance or anything? For and while loops are like the basics of any programming and I doubt that it's all you learned. :O

1

u/cosmorocks May 20 '15

ah yes, forget to mention inheritance.

1

u/oddwhirled Semi-New Brewer May 22 '15

What else though? Your teacher can't just expect you to make a hard project with minimal knowledge... What did you cover?

1

u/cosmorocks May 22 '15

We covered the minimum possible to take the AP Exam... The average on the practice exam he gave us was a 54% in some of this classes.. Goes to show how poor the cs course is at my school

1

u/oddwhirled Semi-New Brewer May 22 '15

What concepts have you learned though? I am teaching myself using Head First Java and it seems at the moment that it has taught me more than your teacher has taught you... (I am not all the way through the book even.)

1

u/[deleted] May 20 '15

What about using Android as your Java development platform? Throwing together an Android interface is really easy and their is a ton of material out there to get you started.

Pro-tip: Don't bother with rotation. Just lock it into landscape or portrait. Android is weird when it comes to rotation.