Jake Mauve wrote:Hello all ! I have a small problem with the repaint() method.
I have a graphical component consisting of about 6 filled rectangles and 3 filled ovals, each with a random color. Which is why I'd like to have it 'repaint itself' every X units of time.
I tried by entering
after drawing all my figures, within the same component method. It compiles and works, but the only problem is that it isn't taking my time parameter into account, and repaints at light speed :p
(An instance of the component is then called into a JFrame since I hadn't mentioned it)
Second question, what is best between JFrame and Applet? if they're both good for different cases, could you specify which? thanks! xD
Jake Mauve wrote:ok, I've got
could you please tell me where I 'put it in'?
and, please don't quote a message when its already printed right up, what else would you be answering to? :p and please dont answer a question with another one =) cause the point is, in both cases the answer depends on context rather than taste xD I like using applets cause I find it makes it a bit easier not having to call my component object the same way and that in practical terms it lets we have more than one applet window, as in, it opens a new one each time. But, I dont know enough about either applets or frames to know their advantages/disadvantages. I've read a bit on it, even had a lecture on it this past week but hearing from other programmers is good too xD
when defining my JFrame to 200 in height, it comes out 'too short'
repaint() method in the actionPerformed() method wasn't being recognized
Please give the final, concise result, without confusing me with ...
WHAT is your favorite color? Blue, no yellow, ahhhhhhh! Tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koophttps://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton