A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Swing / AWT / SWT
Joined: Jul 08, 2010
Jul 08, 2010 23:07:42
first i initialise the onscreen frame when the program starts and then copy the empty frame buffer
frame = new Frame("Manpower"); frame.setSize(width, height); frame.setVisible(true); buffer = frame; //initialise the buffer frame buffer.setVisible(false);
then i write all my graphics to the buffer frame in my draw() method at the end of which the buffer frame is copied to the onscreen frame.
/**update sprite positions in the buffer frame as usual*/ frame = buffer;//gets onscreen frame from offscreen buffer frame.setVisible(true);
but then if i set frame to = buffer, wont it become invisible too, so i need to reapply visibility which causes the frame to flash between visible and invisible.
I feel like i'm doing it completely wrong, any suggestions for this newb?
Joined: Nov 24, 2005
Jul 08, 2010 23:11:24
Hi, welcome to the ranch !
check your private messages
for an important administrative matter.
All roads lead to JavaRanch
Joined: Oct 27, 2005
Jul 09, 2010 01:13:51
buffer and frame both refer to the same
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions
How To Answer Questions
I agree. Here's the link:
subject: frame buffering
How to create a new window from a java app
gwt and frame
Another JTable Navigation Question
threads for GUI and command-line
SAX Parsing Problem
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2013