Polevoy S.V Lab_work5 #5

Closed
ChipsEater wants to merge 4 commits from LabWork05 into LabWork04
Showing only changes of commit df909891d8 - Show all commits

View File

@ -65,12 +65,11 @@ public class FormArtilleryConfig extends JFrame {
weightSpinner.setModel(new SpinnerNumberModel(100, 100, 1000, 1));
// Создание обработчиков
var form = this;
var dragAdapter = new MouseAdapter() {
@Override
public void mousePressed(MouseEvent e) {
super.mouseReleased(e);
form.setCursor(new Cursor(Cursor.HAND_CURSOR));
setCursor(new Cursor(Cursor.HAND_CURSOR));
draggedComponent = (JComponent) e.getSource();
}
@ -99,11 +98,9 @@ public class FormArtilleryConfig extends JFrame {
buttonAdd.addActionListener(e -> {
eventHandler.emit(artillery);
form.dispose();
});
buttonCancel.addActionListener(e -> {
form.dispose();
dispose();
});
buttonCancel.addActionListener(e -> dispose());
}
public void addListener(Consumer<DrawingArtillery> listener) {