Nicole Gruber

Greenhorn
+ Follow
since Jan 15, 2009
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Nicole Gruber

Thanks Steve!!! My program works now!
and also thanks for the tips ;) I'm really grateful!
Hello,
I have this assignment where I am supposed to create a panel with four buttons. If you click one of them, music should begin and loop continuosly, if you click it once more, the music should stop playing. Unfortunatley, I can't manage to do that (stop the music from playing)..
I have two classes: One is called PlayClip(extends Thread) and the other one SimpleClipPlayer(extends JFrame implements ActionListener).
The first class contains also the method run() :

In the second class are the four buttons and also the method ActionPerformed():


I can't use the stop() method because it's deprecated and interrupt() doesn't seem to work. I also tried to use a flag and I've put the method clip.loop(Clip.LOOP_CONTINUOUSLY); in a while-loop, put that doesn't seem to work either..

Can someone help me?
What works: the first time when the user clicks somewhere on the panel, that point is added in the Model-class, which notifices the Observer(View-class) [I omitted to write in the code
]
and finally the point is being drew through the paint() Method .
the Problem is that once you click twice on the Panel, the second point doesn't appear anymore...
15 years ago
I have this asignment to create a Java SWING application, which uses the Java2D functionality. The user should be able to draw points on the panel and by pushing the Create Polygon button to unite the points into a polygon. I'm not able to create the Points and I am also confused by the MVC Pattern, wich we are obliged to use! Can someone help me???








15 years ago
thanks for your time!
I think I mainly understood ;)
15 years ago
Can someone please explain to me how the Hoare-Calculus works??? Take this exercise for example:

n, i , x are int and the notation n! = factorial
15 years ago
yes, you were right. The method double getElement(int index); was missing.
Thanks Rob

Now I think I understood all my faults, thank to all of you who helped!!!

16 years ago

But I can't write v.dimension[n] because I have no dimension variable in the interface Vector... ( and I am not alowed to change the interface Vector.java)

P.S. I also changed the field dimension to int[].
16 years ago
well, i am not suposed to use java.util.Vector.
I have to add up two vectors in the method public Vector plus(Vector v). i know i shouldn't have written return v, but another Vector, for example Vector sum. I just don't know how to do it.. In order to add up two vectors you need to add up each number from the ArrayList. In my example the answer would be a vector: {1+1, 2+2, 3+3}. Now, I don't know how to write that, espacially what to return.
The same problem is at public Vector times(double skalar), where I need to multiply the Vector with a number...
I am a beginner so that all is very difficult for me to understand...
16 years ago
I already have an interface Vector.java and i must create a ReellerVector.java that implements Vektor.java.


ReellerVector.java looks like this:



the class Test contains the main Method:



Of course, it's not right how I wrote ReellerVector.java and therefore I get this Output:
v1: 3
v1: 2.0
v1: Vector: [D@42e816.
v1: Vector: [D@42e816.
v1: Vector: [D@42e816.

Can someone help me ???
16 years ago