if (pressedbutton == MouseEvent.BUTTON1) {
Point3D point = getGlmain3d().getSelectedPointOnSurface(e.getX(), e.getY());
// create a new marker and let the user edit it
Marker marker = new Marker(point, "");
final MarkerEditForm mef = new MarkerEditForm();
mef.setMarker(marker);
mef.setLocationRelativeTo(null); // center to screen
mef.setVisible(true);
mef.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
markers.add(mef.getMarker());
}
});
e.consume();