We are about to switch to a new forum software. Until then we have removed the registration on this forum.
how can I set the pos pls?
import java.awt.*;
import java.awt.event.*;
Button b ;
testListener a1 = new testListener();
void setup() {
size(660, 662);
b = new Button("Hello");
// b.setLocation(100, 440);
// b.setBounds(210, 100, 120, 30);
this.add(b);
b.addActionListener(a1);
b.repaint();
// b.setX(100);
b.setLocation(100, 440);
// b.refresh();
// control.coordsDisplay.setText("Hello");
}
void draw() {
//
background(0);
b.show();
}
class testListener implements ActionListener {
//Implementierung der Aktion fuer den Button
public void actionPerformed(ActionEvent b) {
println ("A");
}
}
Answers
This is unrelated to Using Processing, please, take care to choose the proper category. Moved.
In general, AWT GUI components cannot be used directly in Processing, because of different threading usage. That's why there is half a dozen of GUI libraries: they haven't be made to be fancy (well, not only!).
It might work here (more or less), but you might have trouble at one point or another...