thanks, but here ( Raspberry Pi ) i must use
// frame = (JFrame) (processing.awt.PSurfaceAWT.SmoothCanvas)app.getSurface().getNative()).getFrame();
frame = (JFrame) ((processing.awt.PSurfaceAWT.SmoothCanvas)app.getSurface().getNative()).getFrame();
and in setup to see something, like
void setup() {
size(500,500);
buildMenuBar();
}