I am writing a custom control and want to understand why this is painting
twice. Complete code below.
Thanks,
Cynthia
public class PaintTest extends Application.Adapter {
private Window window = null;
private Waveform waveform = null;
@Override
public void startup(Display display, Map<String, String> properties) {
window = new Window();
waveform = new Waveform();
window.setContent(waveform);
window.setMaximized(true);
window.open(display);
}
@Override
public boolean shutdown(boolean optional) {
if (window != null) {
window.close();
}
return false;
}
public static void main(String[] args) {
DesktopApplicationContext.main(PaintTest.class, args);
}
}
package painttest;
import java.awt.Graphics2D;
import org.apache.pivot.wtk.Panel;
public class Waveform extends Panel
{
@Override
public void paint(Graphics2D graphics)
{
System.out.println("Painting");
}
}