Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / June 2007

Tip: Looking for answers? Try searching our database.

how to use swing/awt controls in a window that uses double-buffering?

Thread view: 
linuxadmin@yandex.ru - 18 Jun 2007 12:47 GMT
hello!

i'm using a JFrame with enabled double-buffering. the window itself
owns several JInternalFrames. my problem is that when double-buffering
is enabled, the internal frames are invisible, with an exception that
they flicker for few milliseconds when i move the mouse over their
position.

is it possible to use internal frames or controls at all along with
double-buffering?
if not, what else could be done?

thanks in advice!
Knute Johnson - 19 Jun 2007 02:49 GMT
> hello!
>
[quoted text clipped - 9 lines]
>
> thanks in advice!

Can you post a simple example that demonstrates your problem?

Signature

Knute Johnson
email s/nospam/knute/

linuxadmin@yandex.ru - 20 Jun 2007 13:32 GMT
On Jun 19, 3:49 am, Knute Johnson <nos...@rabbitbrush.frazmtn.com>
wrote:

> Can you post a simple example that demonstrates your problem?

well, it is a _lot_ of code. i try to reduce the amount:

////////////////////////////////////////////////////////////////
// main window (extends JFrame) c-tor contains:

    // ...
    // add JInternalFrames to 'this'
    // ...

    setIgnoreRepaint(true); // skipping this doesn't help
    setExtendedState(JFrame.MAXIMIZED_BOTH);
    setVisible(true);
    validate();

    createBufferStrategy(2);
    bufferStrategy = getBufferStrategy();

////////////////////////////////////////////////////////////////
// main loop of the rendering thread contains:

    g = (Graphics2D) bufferStrategy.getDrawGraphics();

    g.clearRect(0, 0, getContentPane().getWidth(),
        getContentPane().getHeight());

    // ...
    // draw lots of BufferedImages using d.drawImage(...)
    // ...

    bufferStrategy.show();
    g.dispose();
    ++framesRendered;


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.