New 2dShapes with Jbutton in JApplet
Why this code is ok (=user can add new shapes by pressing the button) but when I try to do same in JApplet, with JButton to get new 2dshapes it doesn't work? I can't find any examples or tutorial including any help. (I have found only tutorials on how to reshape an existing 2dshape by pressing buttons)
if (e.getActionCommand() == "ok") {
if (list3.getSelectedItem() == "Polygon"){
...
Graphics z = getGraphics();
Polygon p = new Polygon();
p.addPoint(x,y);p.addPoint(y,x);p.addPoint(50,50);
z.drawPolygon(p);
}

