paintComponent() Method straitjacket
I have been happily building up a familiarity with JAVA and making progress with a program copied over from one which I already have running in Delphi Pascal. But I have now run into what looks like a mighty brick wall. Apparently JAVA requires all graphics coding to be carried out inside a single paintComponent() method! OK for the simple programs I have studied. But my "Cloze" program involves selecting and running from a MENU bar a range of different 'graphics' activities (in reality I only need to use g.drawText) involving the input of words or phrases with their precise screen coordinates to fill gaps in various passages loaded in from a FILE menu. (Word 'jigsaws' so to speak). It looks as I may have to cram several pages of code into one paintComponent() method, but in any case I find I am unable to call this method from anywhere in the program (how can it be called from a Menu?) I thought I had everything working fine by using getGraphics() instead, but my beautiful Cloze passages appear only fleetingly on the screen. Do I need to program a separate class for each activity and then try to call these classes from a menu system?
I found JAVA so easy and logical but now I am disillusioned. As I said programming this in Delphi Pascal presented no problems of this magnitude.