panel.addShape(new Oval(x, y, _x - x, _y - y));
}
}
if(jRadioButtonRectangle.isSelected()){
if(x > _x && y > _y){
panel.addShape(new Rectangle(_x, _y, x - _x, y - _y));
}
else if(x > _x && y < _y){
panel.addShape(new Rectangle(_x, y, x - _x, _y - y));
}
else if(x < _x && y > _y){
panel.addShape(new Rectangle(x, _y, _x - x, y - _y));
}
else{
panel.addShape(new Rectangle(x, y, _x - x, _y - y));
}
}
x = y = _x = _y = 0;
jButtonUndoShape.setEnabled(true);
}