Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

java applet init () problem

  • 13-12-2008 6:48pm
    #1
    Registered Users, Registered Users 2 Posts: 1,269 ✭✭✭


    hi,

    I'm trying to make a pretty little java paint program. One of the problems I'm having is setting the canvas to white, and then setting the brush to a colour, say purple, in the applets init method. My code's fairly bloated so in simple terms the problem is:
    class Painter extends Applet
    {
    public void init()
    {
    myCanvas.setpaintColour(Color.white);
    myCanvas.fill();
    myCanvas.setpaintColour(Color.purple);
    }
    }
    

    The myCanvas class has it's own setpaintColour and fill methods, which are aptly named. Annoyingly, the above code results in the applet initializing with a purple fill, instead of the intended white fill.

    Is there any way around this? Is it a basic feature which I'm forgetting?

    Any help is greatly appreciated, I might post the full code at some stage, after tidying it up...


Comments

  • Closed Accounts Posts: 6,151 ✭✭✭Thomas_S_Hunterson


    is the setPaintColour() method calling the fill() method?


  • Registered Users, Registered Users 2 Posts: 1,269 ✭✭✭cocoa


    Sean_K wrote: »
    is the setPaintColour() method calling the fill() method?

    fair point, but no that wasn't it... I've figured it out now, I was using repaint and I didn't realise it's one of those things that has a delay.


Advertisement