|
|
|
@@ -18,6 +18,7 @@ import javafx.scene.Parent; |
|
|
|
import javafx.scene.control.ButtonType;
|
|
|
|
import javafx.scene.control.ComboBox;
|
|
|
|
import javafx.scene.control.Dialog;
|
|
|
|
import javafx.scene.control.RadioButton;
|
|
|
|
import javafx.scene.control.TextField;
|
|
|
|
import javafx.scene.control.ToggleGroup;
|
|
|
|
import javafx.scene.layout.AnchorPane;
|
|
|
|
@@ -34,13 +35,16 @@ public class DialogTambahNotaController extends Dialog<String> implements Initia |
|
|
|
@FXML
|
|
|
|
private ToggleGroup tgTipe;
|
|
|
|
@FXML
|
|
|
|
private ComboBox cbxPilihNota;
|
|
|
|
private RadioButton rbBaru;
|
|
|
|
@FXML
|
|
|
|
private ComboBox<String> cbxPilihNota;
|
|
|
|
@FXML
|
|
|
|
private RadioButton rbAmbilDariCheckout;
|
|
|
|
@FXML
|
|
|
|
private TextField txtFieldAmbilDariCheckout;
|
|
|
|
|
|
|
|
public static final ButtonType btnLanjutkan = new ButtonType("Lanjutkan");
|
|
|
|
public static final ButtonType btnBatal = new ButtonType("Batal");
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void initialize(URL url, ResourceBundle rb) {
|
|
|
|
@@ -69,12 +73,15 @@ public class DialogTambahNotaController extends Dialog<String> implements Initia |
|
|
|
setResultConverter(buttonType -> {
|
|
|
|
if (buttonType == btnLanjutkan) {
|
|
|
|
//radio button mana yang dipilih
|
|
|
|
if (((RadioButton) tgTipe.getSelectedToggle()) == rbBaru) {
|
|
|
|
return cbxPilihNota.getValue();
|
|
|
|
} else if (((RadioButton) tgTipe.getSelectedToggle()) == rbAmbilDariCheckout) {
|
|
|
|
return txtFieldAmbilDariCheckout.getText();
|
|
|
|
}
|
|
|
|
//baru, balikin tipe yang dipilih
|
|
|
|
//dari checkout, balikin isi nomor nota (hanya jika nota ditemukan)
|
|
|
|
return "Tambah";
|
|
|
|
}
|
|
|
|
return "Batal";
|
|
|
|
|
|
|
|
});
|
|
|
|
setTitle("Tambah Nota");
|
|
|
|
} catch (IOException ex) {
|
|
|
|
|