Polevoy S.V Lab_work5 #5
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user