Skip to content

Commit

Permalink
Chore: use our MessageDialog instead of JOptionPane.showMessageDialog…
Browse files Browse the repository at this point in the history
…() (#2100)
  • Loading branch information
dbmalkovsky authored Dec 4, 2024
1 parent a4f6d71 commit 3e01153
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions src/main/java/org/isf/medicalstockward/gui/WardPharmacy.java
Original file line number Diff line number Diff line change
Expand Up @@ -783,8 +783,7 @@ public void focusLost(FocusEvent e) {
weightFrom = Integer.parseInt(jWeightFromTextField.getText());
if (weightTo < 0 || weightTo > 200) {
jWeightToTextField.setText(""); //$NON-NLS-1$
JOptionPane
.showMessageDialog(WardPharmacy.this, MessageBundle.getMessage("angal.medicalstockward.insertavalidweight")); //$NON-NLS-1$
MessageDialog.error(WardPharmacy.this, "angal.medicalstockward.insertavalidweight");
}
} catch (NumberFormatException ex) {
jWeightToTextField.setText("0"); //$NON-NLS-1$
Expand Down Expand Up @@ -813,7 +812,7 @@ public void focusLost(FocusEvent e) {
weightTo = Integer.parseInt(jWeightToTextField.getText());
if (weightFrom < 0) {
jWeightFromTextField.setText("");
JOptionPane.showMessageDialog(WardPharmacy.this, MessageBundle.getMessage("angal.medicalstockward.insertavalidweight"));
MessageDialog.error(WardPharmacy.this, "angal.medicalstockward.insertavalidweight");
}
} catch (NumberFormatException ex) {
jWeightFromTextField.setText("0");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ private void initComponents() {
double movQuantity = lotQty - newQty;

if (movQuantity == 0. || newQty < 0) {
JOptionPane.showMessageDialog(this, MessageBundle.getMessage("angal.medicalstockward.rectify.pleaseinsertavalidvalue"));
MessageDialog.error(this, "angal.medicalstockward.rectify.pleaseinsertavalidvalue");
return;
}
if (newQty == 0.) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/isf/priceslist/gui/ListBrowser.java
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ private JButton getJButtonDelete() {
jButtonDelete.setMnemonic(MessageBundle.getMnemonic("angal.common.delete.btn.key"));
jButtonDelete.addActionListener(actionEvent -> {
if (jTablePriceLists.getSelectedRow() < 0) {
JOptionPane.showMessageDialog(null, MessageBundle.getMessage("angal.priceslist.pleaseselectalisttodelete"));
MessageDialog.error(null, "angal.priceslist.pleaseselectalisttodelete");
} else {
if (jTablePriceLists.getRowCount() == 1) {
MessageDialog.error(null, "angal.priceslist.sorryatleastonelist");
Expand Down

0 comments on commit 3e01153

Please sign in to comment.