{
if (list_despatch.getModel().getSize() > 0)
{
if (list_despatch.getSelectedIndex() >= 0)
{
JDBDespatch d = list_despatch.getSelectedValue();
currentdespatchno = d.getDespatchNo();
if (currentdespatchno.equals(previousdespatchno) == false)
{
previousdespatchno = currentdespatchno;
textFieldDespatchLocationFrom.setText(d.getLocationIDFrom());
textFieldDespatchLocationTo.setText(d.getLocationIDTo());
textFieldDespatchStatus.setText(d.getStatus());
if (d.getStatus().equals("Confirmed"))
{
deleteButton.setEnabled(false);
jButtonLookupLocationTo.setEnabled(false);
jButtonLookupLocationFrom.setEnabled(false);
buttonSetUserID.setEnabled(false);
jButtonLookupLoadNo.setEnabled(false);
jButtonLookupTrailer.setEnabled(false);
jButtonLookupHaulier.setEnabled(false);
buttonUnAssign.setEnabled(false);
buttonAssign.setEnabled(false);
newButton.setEnabled(false);
}
else
{
deleteButton.setEnabled(true);
jButtonLookupLocationFrom.setEnabled(true);
buttonSetUserID.setEnabled(true);
jButtonLookupLocationTo.setEnabled(true);
jButtonLookupLoadNo.setEnabled(true);
jButtonLookupTrailer.setEnabled(true);
jButtonLookupHaulier.setEnabled(true);
buttonUnAssign.setEnabled(true);
buttonAssign.setEnabled(true);
newButton.setEnabled(true);
}
try
{
jTextFieldDespatchDate.setText(d.getDespatchDate().toString().substring(0, 19));
}
catch (Exception ee)
{
jTextFieldDespatchDate.setText("N/A");
}
textFieldHaulier.setText(d.getHaulier());
textFieldTrailer.setText(d.getTrailer());
textFieldLoadNo.setText(d.getLoadNo());
textFieldUserID.setText(d.getUserID());
textFieldNoOfPallets.setText(Integer.toString(d.getTotalPallets()));
setConfirmButtonStatus();
setFindButtonStatus(d.getLocationIDFrom());
populateAssignedList(d.getDespatchNo(), "");
clearUnAssignedList();
}
}
else
{
blankDespatchFields();
}
}
else
{
jButtonLookupLocationFrom.setEnabled(false);
buttonSetUserID.setEnabled(false);
jButtonLookupLocationTo.setEnabled(false);
jButtonLookupTrailer.setEnabled(false);
jButtonLookupHaulier.setEnabled(false);
buttonUnAssign.setEnabled(false);
buttonAssign.setEnabled(false);
populateAssignedList("", "");
}
}
});
list_despatch.setCellRenderer(Common.renderer_list);
list_despatch.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
scrollPane.setViewportView(list_despatch);
final JScrollPane scrollPane_1 = new JScrollPane();
scrollPane_1.setBounds(510, 30, 150, 345);
desktopPane.add(scrollPane_1);
list_unassigned = new JList4j<String>();
list_unassigned.setLocation(0, -3);
list_unassigned.setCellRenderer(Common.renderer_list_unassigned);
list_unassigned.setBackground(Common.color_list_unassigned);
scrollPane_1.setViewportView(list_unassigned);
final JScrollPane scrollPane_2 = new JScrollPane();
scrollPane_2.setBounds(310, 30, 150, 345);
desktopPane.add(scrollPane_2);
list_assigned = new JList4j<String>();
list_assigned.setCellRenderer(Common.renderer_list_assigned);
list_assigned.setBackground(Common.color_list_assigned);
scrollPane_2.setViewportView(list_assigned);
comboBoxPalletStatus = new JComboBox<String>();
comboBoxPalletStatus.setFont(Common.font_std);
comboBoxPalletStatus.setBounds(672, 135, 143, 21);
ComboBoxModel<String> jComboBoxDefaultPalletStatusModel = new DefaultComboBoxModel<String>(Common.palletStatusIncBlank);
comboBoxPalletStatus.setModel(jComboBoxDefaultPalletStatusModel);
comboBoxPalletStatus.setSelectedIndex(0);
desktopPane.add(comboBoxPalletStatus);
textFieldSSCC = new JTextField4j();
textFieldSSCC.setBounds(672, 50, 143, 21);
desktopPane.add(textFieldSSCC);
final JLabel4j_std palletStatusLabel = new JLabel4j_std();
palletStatusLabel.setText(lang.get("lbl_Pallet_Status"));
palletStatusLabel.setBounds(672, 115, 128, 20);
desktopPane.add(palletStatusLabel);
final JLabel4j_std ssccLabel = new JLabel4j_std();
ssccLabel.setText(lang.get("lbl_Pallet_SSCC"));
ssccLabel.setBounds(672, 35, 128, 16);
desktopPane.add(ssccLabel);
textFieldMaterial = new JTextField4j();
textFieldMaterial.setBounds(672, 90, 124, 21);
desktopPane.add(textFieldMaterial);
final JLabel4j_std materialLabel = new JLabel4j_std();
materialLabel.setText(lang.get("lbl_Material"));
materialLabel.setBounds(672, 75, 128, 16);
desktopPane.add(materialLabel);
textFieldBatch = new JTextField4j();
textFieldBatch.setBounds(672, 175, 124, 21);
desktopPane.add(textFieldBatch);
final JLabel4j_std batchLabel = new JLabel4j_std();
batchLabel.setText(lang.get("lbl_Batch"));
batchLabel.setBounds(672, 160, 128, 16);
desktopPane.add(batchLabel);
buttonAssign.setEnabled(false);
buttonAssign.setBounds(470, 150, 25, 25);
buttonAssign.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
if (textFieldDespatchLocationTo.getText().equals(""))
{
jStatusText.setText("Please define Destination Location");
}
else
{
jStatusText.setText("");
if (list_unassigned.getSelectedIndex() > -1)
{
String item = "";
JDBDespatch d = (JDBDespatch) list_despatch.getSelectedValue();
for (int j = list_unassigned.getMaxSelectionIndex(); j >= list_unassigned.getMinSelectionIndex(); j--)
{
if (list_unassigned.isSelectedIndex(j))
{
item = (String) list_unassigned.getModel().getElementAt(j);
if (d.assignSSCC(item))
{
addtoList(assignedList, item);
removefromList(unassignedList, item);
jStatusText.setText("");
}
else
{
jStatusText.setText(d.getErrorMessage());
}
}
}
list_assigned.setModel(addListtoModel(assignedList));
list_unassigned.setModel(addListtoModel(unassignedList));
textFieldNoOfPallets.setText(String.valueOf(assignedList.size()));
d.setTotalPallets(assignedList.size());
updateDespatch(d);
}
}
}
});
desktopPane.add(buttonAssign);
buttonUnAssign.setEnabled(false);
buttonUnAssign.setBounds(470, 185, 25, 25);
buttonUnAssign.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
if (list_assigned.getSelectedIndex() > -1)
{
String item = "";
JDBDespatch d = (JDBDespatch) list_despatch.getSelectedValue();
for (int j = list_assigned.getMaxSelectionIndex(); j >= list_assigned.getMinSelectionIndex(); j--)
{
if (list_assigned.isSelectedIndex(j))
{
item = (String) list_assigned.getModel().getElementAt(j);
if (d.unassignSSCC(item))
{
removefromList(assignedList, item);
addtoList(unassignedList, item);
}
}
}
list_assigned.setModel(addListtoModel(assignedList));
list_unassigned.setModel(addListtoModel(unassignedList));
textFieldNoOfPallets.setText(String.valueOf(assignedList.size()));
d.setTotalPallets(assignedList.size());
updateDespatch(d);
}
}
});
desktopPane.add(buttonUnAssign);
newButton.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
int question = JOptionPane.showConfirmDialog(Common.mainForm, lang.get("dlg_Despatch_Create"), lang.get("dlg_Confirm"), JOptionPane.YES_NO_OPTION, 0, Common.icon_confirm);
if (question == 0)
{
JDBDespatch d = new JDBDespatch(Common.selectedHostID, Common.sessionID);
String number = "";
number = d.generateNewDespatchNo();
if (number.equals("") == false)
{
if (d.create())
{
d.updateUserID(number, Common.userList.getUser(Common.sessionID).getUserId());
populateDespatchList(number);
setConfirmButtonStatus();
}
else
{
JUtility.errorBeep();
JOptionPane.showMessageDialog(Common.mainForm, d.getErrorMessage(), lang.get("dlg_Error"), JOptionPane.ERROR_MESSAGE,Common.icon_confirm);
}
}
else
{
JUtility.errorBeep();
JOptionPane.showMessageDialog(Common.mainForm, d.getErrorMessage(), lang.get("dlg_Error"), JOptionPane.ERROR_MESSAGE);
}
}
}
});
newButton.setText(lang.get("btn_New"));
newButton.setBounds(2, 388, 116, 30);
desktopPane.add(newButton);
deleteButton.setText(lang.get("btn_Delete"));
deleteButton.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
if (list_despatch.getModel().getSize() > 0)
{
if (list_despatch.getSelectedIndex() >= 0)
{
JDBDespatch d = (JDBDespatch) list_despatch.getSelectedValue();
int question = JOptionPane.showConfirmDialog(Common.mainForm, lang.get("dlg_Despatch_Delete") + " " + d.getDespatchNo() + " ?", lang.get("dlg_Confirm"), JOptionPane.YES_NO_OPTION, 0, Common.icon_confirm);
if (question == 0)
{
d.delete();
populateDespatchList("");
setConfirmButtonStatus();
}
}
}
}
});
deleteButton.setBounds(238, 388, 116, 30);
desktopPane.add(deleteButton);
findButton.setText(lang.get("btn_Find"));
findButton.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
buildUnassignedSQL();
populateUnassignedList(listStatement, "");
}
});
findButton.setBounds(672, 298, 143, 30);
desktopPane.add(findButton);
final JButton4j printButton = new JButton4j(Common.icon_report);
printButton.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
if (list_despatch.getModel().getSize() > 0)
{
if (list_despatch.getSelectedIndex() >= 0)
{
JDBDespatch d = (JDBDespatch) list_despatch.getSelectedValue();
HashMap<String, Object> parameters = new HashMap<String, Object>();
parameters.put("p_despatch_no", d.getDespatchNo());
JLaunchReport.runReport("RPT_DESPATCH", parameters, "", null, "");
}
}
}
});
printButton.setText(lang.get("btn_Print"));
printButton.setBounds(474, 388, 116, 30);
desktopPane.add(printButton);
jLabel10 = new JLabel4j_std();
jLabel10.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
jLabel10.setHorizontalAlignment(SwingConstants.TRAILING);
jLabel10.setText(lang.get("lbl_Limit"));
jLabel10.setBounds(672, 244, 128, 21);
desktopPane.add(jLabel10);
jCheckBoxLimit = new JCheckBox4j();
jCheckBoxLimit.setSelected(true);
jCheckBoxLimit.setBackground(new Color(255, 255, 255));
jCheckBoxLimit.setBounds(672, 264, 21, 21);
desktopPane.add(jCheckBoxLimit);
spinnerUnassignedLimit = new JSpinner();
JSpinner.NumberEditor ne1 = new JSpinner.NumberEditor(spinnerUnassignedLimit);
ne1.getTextField().setFont(Common.font_std);
spinnerUnassignedLimit.setEditor(ne1);
spinnerUnassignedLimit.setBounds(701, 264, 114, 20);
spinnerUnassignedLimit.setValue(1000);
desktopPane.add(spinnerUnassignedLimit);
final JButton4j closeButton = new JButton4j(Common.icon_close);
closeButton.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
dispose();
}
});
closeButton.setText(lang.get("btn_Close"));
closeButton.setMnemonic(lang.getMnemonicChar());
closeButton.setBounds(710, 388, 116, 30);
desktopPane.add(closeButton);
jButtonHelp.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
}
});
jButtonHelp.setText(lang.get("btn_Help"));
jButtonHelp.setBounds(592, 388, 116, 30);
desktopPane.add(jButtonHelp);
//
final JHelp help = new JHelp();
help.enableHelpOnButton(jButtonHelp, JUtility.getHelpSetIDforModule("FRM_ADMIN_DESPATCH"));
confirmButton.setText(lang.get("btn_Confirm"));
confirmButton.setEnabled(false);
confirmButton.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
if (list_despatch.getModel().getSize() > 0)
{
if (list_despatch.getSelectedIndex() >= 0)
{
JDBDespatch d = (JDBDespatch) list_despatch.getSelectedValue();
int n = JOptionPane.showConfirmDialog(Common.mainForm, lang.get("dlg_Despatch_Confirm") + " " + d.getDespatchNo() + " ?", lang.get("dlg_Confirm"), JOptionPane.YES_NO_OPTION, 0, Common.icon_confirm);
if (n == 0)
{
d.getDespatchProperties();
if (d.confirm())
{
populateDespatchList("");
setConfirmButtonStatus();
}
else
{
JUtility.errorBeep();
JOptionPane.showMessageDialog(Common.mainForm, d.getErrorMessage(), lang.get("dlg_Error"), JOptionPane.ERROR_MESSAGE,Common.icon_confirm);
populateDespatchList("");
}
}
}
}
}
});
confirmButton.setBounds(356, 388, 116, 30);
desktopPane.add(confirmButton);
final JLabel4j_title despatchesLabel = new JLabel4j_title();
despatchesLabel.setText(lang.get("lbl_Despatches"));
despatchesLabel.setBounds(10, 10, 75, 16);
desktopPane.add(despatchesLabel);
final JLabel4j_title unassignedLabel = new JLabel4j_title();
unassignedLabel.setText(lang.get("lbl_Unassigned"));
unassignedLabel.setBounds(510, 10, 150, 16);
desktopPane.add(unassignedLabel);
final JLabel4j_title assignedLabel = new JLabel4j_title();
assignedLabel.setText(lang.get("lbl_Assigned"));
assignedLabel.setBounds(310, 10, 150, 16);
desktopPane.add(assignedLabel);
final JLabel4j_title palletFilterCriteriaLabel = new JLabel4j_title();
palletFilterCriteriaLabel.setText(lang.get("lbl_Unassigned_Filter"));
palletFilterCriteriaLabel.setBounds(672, 15, 125, 16);
desktopPane.add(palletFilterCriteriaLabel);
final JButton4j refreshButton = new JButton4j(Common.icon_refresh);
refreshButton.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
refresh();
}
});
refreshButton.setText(lang.get("btn_Refresh"));
refreshButton.setBounds(120, 388, 116, 30);
desktopPane.add(refreshButton);
SpinnerNumberModel jSpinnerIntModel = new SpinnerNumberModel();
jSpinnerIntModel.setMinimum(1);
jSpinnerIntModel.setMaximum(50000);
jSpinnerIntModel.setStepSize(1);
JSpinner.NumberEditor ne2 = new JSpinner.NumberEditor(spinnerDespatchLimit);
ne2.getTextField().setFont(Common.font_std);
spinnerDespatchLimit.setEditor(ne2);
spinnerDespatchLimit.setModel(jSpinnerIntModel);
spinnerDespatchLimit.setBounds(100, 303, 60, 20);
spinnerDespatchLimit.setValue(50);
desktopPane.add(spinnerDespatchLimit);
jLabel10_1 = new JLabel4j_std();
jLabel10_1.setHorizontalAlignment(SwingConstants.TRAILING);
jLabel10_1.setText(lang.get("lbl_Limit"));
jLabel10_1.setBounds(15, 302, 70, 21);
desktopPane.add(jLabel10_1);
textFieldDespatchLocationFrom = new JTextField4j();
textFieldDespatchLocationFrom.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
if (JUtility.isNullORBlank(textFieldDespatchLocationFrom.getText()) == true)
{
findButton.setEnabled(false);
}
else
{
findButton.setEnabled(true);
}
}
});
textFieldDespatchLocationFrom.setEditable(false);
textFieldDespatchLocationFrom.setBounds(172, 51, 105, 20);
desktopPane.add(textFieldDespatchLocationFrom);
final JLabel4j_std locationLabel_1 = new JLabel4j_std();
locationLabel_1.setText(lang.get("lbl_From_Location"));
locationLabel_1.setBounds(172, 32, 100, 16);
desktopPane.add(locationLabel_1);
final JLabel4j_std palletStatusLabel_1 = new JLabel4j_std();
palletStatusLabel_1.setText(lang.get("lbl_Despatch_Status"));
palletStatusLabel_1.setBounds(170, 240, 105, 20);
desktopPane.add(palletStatusLabel_1);
textFieldDespatchStatus = new JTextField4j();
textFieldDespatchStatus.setEditable(false);
textFieldDespatchStatus.setBounds(170, 261, 128, 20);
desktopPane.add(textFieldDespatchStatus);
textFieldDespatchLocationTo = new JTextField4j();
textFieldDespatchLocationTo.setEditable(false);
textFieldDespatchLocationTo.setBounds(172, 91, 105, 20);
desktopPane.add(textFieldDespatchLocationTo);
final JLabel4j_std locationLabel_1_1 = new JLabel4j_std();
locationLabel_1_1.setText(lang.get("lbl_To_Location"));
locationLabel_1_1.setBounds(172, 75, 100, 16);
desktopPane.add(locationLabel_1_1);
final JLabel4j_std palletStatusLabel_1_1 = new JLabel4j_std();
palletStatusLabel_1_1.setText(lang.get("lbl_Despatch_Date"));
palletStatusLabel_1_1.setBounds(172, 285, 90, 20);
desktopPane.add(palletStatusLabel_1_1);
final JLabel4j_std palletStatusLabel_1_1_1 = new JLabel4j_std();
palletStatusLabel_1_1_1.setText(lang.get("lbl_No_Of_Pallets"));
palletStatusLabel_1_1_1.setBounds(172, 332, 120, 20);
desktopPane.add(palletStatusLabel_1_1_1);
textFieldNoOfPallets = new JTextField4j();
textFieldNoOfPallets.setEditable(false);
textFieldNoOfPallets.setBounds(172, 352, 60, 20);
desktopPane.add(textFieldNoOfPallets);
jTextFieldDespatchDate = new JTextField4j();
jTextFieldDespatchDate.setEditable(false);
jTextFieldDespatchDate.setBounds(172, 303, 125, 20);
desktopPane.add(jTextFieldDespatchDate);
jButtonLookupLocationFrom = new JButton4j(Common.icon_lookup);
jButtonLookupLocationFrom.setEnabled(false);
jButtonLookupLocationFrom.setBounds(277, 50, 21, 21);
jButtonLookupLocationFrom.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent evt)
{
JLaunchLookup.dlgAutoExec = true;
JLaunchLookup.dlgCriteriaDefault = "Y";
if (JLaunchLookup.locations())
{
textFieldDespatchLocationFrom.setText(JLaunchLookup.dlgResult);
JDBDespatch d = (JDBDespatch) list_despatch.getSelectedValue();
d.setLocationIDFrom(JLaunchLookup.dlgResult);
updateDespatch(d);
}
}
});
desktopPane.add(jButtonLookupLocationFrom);
jButtonLookupLocationTo = new JButton4j(Common.icon_lookup);
jButtonLookupLocationTo.setEnabled(false);
jButtonLookupLocationTo.setBounds(277, 90, 21, 21);
jButtonLookupLocationTo.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent evt)
{
JLaunchLookup.dlgAutoExec = true;
JLaunchLookup.dlgCriteriaDefault = "Y";
if (JLaunchLookup.locations())
{
textFieldDespatchLocationTo.setText(JLaunchLookup.dlgResult);
JDBDespatch d = (JDBDespatch) list_despatch.getSelectedValue();
d.setLocationIDTo(JLaunchLookup.dlgResult);
updateDespatch(d);
}
}
});
desktopPane.add(jButtonLookupLocationTo);
jButtonLookupMaterial = new JButton4j(Common.icon_lookup);
jButtonLookupMaterial.setBounds(795, 90, 21, 21);
jButtonLookupMaterial.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent evt)
{
JLaunchLookup.dlgAutoExec = false;
JLaunchLookup.dlgCriteriaDefault = "";
if (JLaunchLookup.materials())
{
textFieldMaterial.setText(JLaunchLookup.dlgResult);
}
}
});
desktopPane.add(jButtonLookupMaterial);
jButtonLookupBatch = new JButton4j(Common.icon_lookup);
jButtonLookupBatch.setBounds(795, 175, 21, 21);
jButtonLookupBatch.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent evt)
{
JLaunchLookup.dlgCriteriaDefault = textFieldMaterial.getText();
JLaunchLookup.dlgAutoExec = true;
if (JLaunchLookup.materialBatches())
{
textFieldBatch.setText(JLaunchLookup.dlgResult);
}
}
});
desktopPane.add(jButtonLookupBatch);
confirmedRadioButton.setBackground(Color.WHITE);
confirmedRadioButton.setText(lang.get("lbl_Confirmed"));
confirmedRadioButton.setBounds(10, 327, 129, 24);
confirmedRadioButton.setFont(Common.font_std);
confirmedRadioButton.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
com.commander4j.util.JWait.milliSec(100);
populateDespatchList("");
refresh();
}
});
desktopPane.add(confirmedRadioButton);
unconfirmedRadioButton.setBackground(Color.WHITE);
unconfirmedRadioButton.setText(lang.get("lbl_Unconfirmed"));
unconfirmedRadioButton.setBounds(10, 352, 129, 24);
unconfirmedRadioButton.setSelected(true);
unconfirmedRadioButton.setFont(Common.font_std);
unconfirmedRadioButton.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
com.commander4j.util.JWait.milliSec(100);
populateDespatchList("");
refresh();
newButton.setEnabled(true);
}
});
desktopPane.add(unconfirmedRadioButton);
buttonGroup_1.add(unconfirmedRadioButton);
buttonGroup_1.add(confirmedRadioButton);
final JLabel4j_std palletStatusLabel_1_2 = new JLabel4j_std();
palletStatusLabel_1_2.setText(lang.get("lbl_Trailer"));
palletStatusLabel_1_2.setBounds(172, 115, 105, 20);
desktopPane.add(palletStatusLabel_1_2);
textFieldTrailer = new JTextField4j();
textFieldTrailer.setEditable(false);
textFieldTrailer.setBounds(172, 136, 105, 20);
desktopPane.add(textFieldTrailer);
final JLabel4j_std palletStatusLabel_1_2_1 = new JLabel4j_std();
palletStatusLabel_1_2_1.setText(lang.get("lbl_Haulier"));
palletStatusLabel_1_2_1.setBounds(172, 158, 105, 20);
desktopPane.add(palletStatusLabel_1_2_1);
textFieldHaulier = new JTextField4j();
textFieldHaulier.setEditable(false);
textFieldHaulier.setBounds(172, 176, 105, 20);
desktopPane.add(textFieldHaulier);
jButtonLookupTrailer = new JButton4j();
jButtonLookupTrailer.setEnabled(false);
jButtonLookupTrailer.setText("...");
jButtonLookupTrailer.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
String trailer;
trailer = JOptionPane.showInputDialog(Common.mainForm, "Enter Trailer Reference");
if (trailer != null)
{
JDBDespatch d = (JDBDespatch) list_despatch.getSelectedValue();
d.setTrailer(trailer.toUpperCase());
textFieldTrailer.setText(trailer.toUpperCase());
updateDespatch(d);
}
}
});
jButtonLookupTrailer.setBounds(277, 135, 21, 21);
desktopPane.add(jButtonLookupTrailer);
jButtonLookupHaulier = new JButton4j();
jButtonLookupHaulier.setEnabled(false);
jButtonLookupHaulier.setText("...");
jButtonLookupHaulier.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
String haulier;
haulier = JOptionPane.showInputDialog(Common.mainForm, "Enter Haulier Reference");
if (haulier != null)
{
JDBDespatch d = (JDBDespatch) list_despatch.getSelectedValue();
d.setHaulier(haulier.toUpperCase());
textFieldHaulier.setText(haulier.toUpperCase());
updateDespatch(d);
}
}
});
jButtonLookupHaulier.setBounds(277, 175, 21, 21);
desktopPane.add(jButtonLookupHaulier);
jStatusText = new JLabel4j_std("");
jStatusText.setBounds(0, 428, 830, 21);
jStatusText.setForeground(new java.awt.Color(255, 0, 0));
jStatusText.setBorder(BorderFactory.createBevelBorder(BevelBorder.LOWERED));
desktopPane.add(jStatusText);
JLabel4j_std lblLoadNo = new JLabel4j_std();
lblLoadNo.setText(lang.get("lbl_Load_No"));
lblLoadNo.setBounds(172, 196, 105, 20);
desktopPane.add(lblLoadNo);
textFieldLoadNo = new JTextField4j();
textFieldLoadNo.setText("");
textFieldLoadNo.setEditable(false);
textFieldLoadNo.setBounds(172, 216, 105, 20);
desktopPane.add(textFieldLoadNo);
jButtonLookupLoadNo = new JButton4j();
jButtonLookupLoadNo.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent arg0)
{
String load;
load = JOptionPane.showInputDialog(Common.mainForm, "Enter Load Number");
if (load != null)
{
JDBDespatch d = (JDBDespatch) list_despatch.getSelectedValue();
d.setLoadNo(load.toUpperCase());
textFieldLoadNo.setText(load.toUpperCase());
updateDespatch(d);
}
}
});
jButtonLookupLoadNo.setText("...");
jButtonLookupLoadNo.setEnabled(false);
jButtonLookupLoadNo.setBounds(277, 215, 21, 21);
desktopPane.add(jButtonLookupLoadNo);
JLabel4j_std label = new JLabel4j_std();
label.setText(lang.get("lbl_User_ID"));
label.setBounds(672, 338, 128, 16);
desktopPane.add(label);
textFieldUserID = new JTextField4j();
textFieldUserID.setText("");
textFieldUserID.setEditable(false);
textFieldUserID.setBounds(672, 356, 122, 20);
desktopPane.add(textFieldUserID);
buttonSetUserID = new JButton4j((Icon) null);
buttonSetUserID.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
JLaunchLookup.dlgAutoExec = true;
JLaunchLookup.dlgCriteriaDefault = "";
if (JLaunchLookup.users())
{
textFieldUserID.setText(JLaunchLookup.dlgResult);
JDBDespatch d = (JDBDespatch) list_despatch.getSelectedValue();
d.updateUserID(d.getDespatchNo(), JLaunchLookup.dlgResult);
}
}
});
buttonSetUserID.setEnabled(false);