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

Double buffering in java

  • 27-05-2002 6:24pm
    #1
    Posts: 0


    Can anyone tell me if double buffering is already implemented in java 2 or do we still have to do it ourselves?

    I thought i read somewhere that it was automatically used in the java graphics api?

    Any clarification would be great, thanks/


Comments

  • Registered Users, Registered Users 2 Posts: 2,013 ✭✭✭lynchie


    public void setDoubleBuffered(boolean aFlag)

    Set whether the receiving component should use a buffer to paint. If set to true, all the drawing from this component will be done in an offscreen painting buffer. The offscreen painting buffer will the be copied onto the screen. Swing's painting system always use a maximum of one double buffer. If a Component is buffered and one of its ancestor is also buffered, the ancestor buffer will be used.

    This method is in JComponent, so all the of the swing components have the method available. Setting this to true will cause all painting to be done via a buffer. AFAIK this is set to true by default. You can check it by creating a JButton and calling isDoubleBuffered() on it straight away. It should be set to true by default. If you are not using swing you may have to implement double-buffering yourself


  • Posts: 0 [Deleted User]


    cheers thanks for that!
    :D


  • Registered Users, Registered Users 2 Posts: 2,281 ✭✭✭DeadBankClerk


    Originally posted by lynchie
    This method is in JComponent, so all the of the swing components have the method available. Setting this to true will cause all painting to be done via a buffer. AFAIK this is set to true by default. You can check it by creating a JButton and calling isDoubleBuffered() on it straight away. It should be set to true by default. If you are not using swing you may have to implement double-buffering yourself

    I used to have a class called DB Applet or something that allowed you to double buffer vannilla pre-swing java (applets). You simply inherited from this class instead of Applet

    www.netsoc.tcd.ie/~dbc/java


Advertisement