I am really struggling with getting an applet program to repaint outside of minimizing and then bringing to the foreground again my applet window (which it does repaint, and quite neatly, revealing the underlying mechanics at work as intended).
But resizing after each input is getting really, really old in testing my program. The compiler gets angry whenever I try to call any of the methods to repaint from events in my primary object (A Selection Class object named selector) trying to make me turn even more of my program bits and bobs static (actions I had taken to satiate demands from other classes) or - more disconcerting - screaming that I need to input a Graphics object parameter, but when I do so, all kinds of everything becomes broken. It gets even angrier and crazier on the rabbit-trails elsewhere. Goal: I would like the program to repaint every so often on its own.
*afterthought* maybe I could prebuild each Graphics object in another class extending Graphics class then treat them as blocks of image? Is that even possible? Trying to hold out on doing a load of custom artwork for the time being.
I read that there is no way to directly call the paint() method, yet, that is what repaint() seems to do, from everything else I read and see. But repaint() and I are NOT friends. Yet.
But for me it doesn't seem to work any which way I approach this thing. I don't want to post too much code initially, but I really don't know where to start. Tell me if you need more info. I'm thinking lines 51 of Flank Class should (indirectly) invoke the method at line 61 (the following Blocks of code Classes Deck and Card are there just to show you what lines 62/63 call.). But it acts like it doesn't. It probably doesn't and I have no clue why others can use it in threads to get what they want and I can't. Repaint() doesn't take parameters. Maybe there's a command in there to resize my window to some arbitrary size and back again like I've been doing manually? I'm desperate to get this working.
I've tried rewriting the whole damn thing as a JPanel, as a JFrame (before I learned those two objects are just brothers with different layout managers) and then as a Canvas (also before I did any research on what it was). In the end, Applet is as good as any for what I need, so it seems from what I read, anyway.
I've mimicked and modified, mixing and matching successful techniques from what I've seen others do and all of my versions fail in the same brutal way. Maybe I just don't understand Graphics objects, though from everything I read they seem straightforward. It is possible I don't fully understand threading, but that seems straightforward to me as well (thread just branches the program much like using conditionals, but flitting back and forth between each branch's execution priority, right?). I have yet to implement the other thread pathway, which I'm guessing I'll need separated out to manage some animations, etc.
Thank you to those willing to take the time to look at this! The input I've received here is always really, really helpful.