bIsFastEntry = false;
//...Create the GUI and put it in the window...
bFastEntry = bIsFastEntry;
JPanel jPanel4 = new javax.swing.JPanel();
label1 = new HelpedLabel(Translator.getTranslation("RegDate"), "RegDate", "transaction", view);
labelTodaysDate = new HelpedLabel("", "RegDate", "transaction", view);
label2 = new HelpedLabel(Translator.getTranslation("InvDate"), "InvDate", "transaction", view);
invoiceDateField =
new DateField("InvDate", "transaction", view) {
//{{{ +gotEnter() : void
public void gotEnter() {
try {
//invoice date
invoiceDateField.getDate();
} catch (Exception e) {
JOptionPane.showMessageDialog(TransactionTableForm.this,
Translator.getTranslation("Date must be in the following format") +
" : " +
DateField.getTodaysDateString(),
Translator.getTranslation("Update not entered"),
JOptionPane.PLAIN_MESSAGE);
return;
}
try {
if (invoiceDateField.getDate().compareTo((Date) cc.comboBoxPeriod.getSelectedItemsKey()) < 0 ||
invoiceDateField.getDate().compareTo((Date) cc.comboBoxPeriod.getSelectedItemsSecondaryKey()) > 0) {
JOptionPane.showMessageDialog(TransactionTableForm.this,
Translator.getTranslation("Date is not within the specified time period.") +
" " +
(String) cc.comboBoxPeriod.getSelectedItem(),
Translator.getTranslation("Update not entered"),
JOptionPane.PLAIN_MESSAGE);
return;
}
} catch (Exception e) {
}
commentsTextField.requestFocus();
}//}}}
};
label3 = new HelpedLabel(Translator.getTranslation("Commentary"), "Commentary", "transaction", view);
commentsTextField =
new HelpedTextField("Commentary", "transaction", view) {
//{{{ +gotEnter() : void
public void gotEnter() {
SetSelectionFirstNoEdit();
tableView.requestFocus();
tableView.editCellAt(0, COL_ACCOUNTNUM);
}//}}}
};
label4 = new HelpedLabel(Translator.getTranslation("Fileing information"), "FileInfo", "transaction", view);
fileInfoTextField =
new HelpedTextField("FileInfo", "transaction", view) {
//{{{ +gotEnter() : void
public void gotEnter() {
invoiceDateField.getEditor().requestFocus();
invoiceDateField.getEditor().setEditable(true);
SwingUtilities.invokeLater(
new Runnable() {
//{{{ +run() : void
public void run() {
invoiceDateField.getEditor().setCaretPosition(invoiceDateField.getEditor().getText().length());
}//}}}
});
}//}}}
};
label6 = new HelpedLabel(Translator.getTranslation("Act_id"), "ActId", "transaction", view);
lableTransaction = new HelpedLabel("", "ActId", "transaction", view);
JPanel jPanel6 = new javax.swing.JPanel();
JPanel jPanel7 = new javax.swing.JPanel();
transactionAccess = new TransactionAccess(view);
setLayout(new BorderLayout());
jPanel4.setLayout(new GridLayout(4, 4));
cc = new CompanyComponents(jPanel4, Translator.getTranslation("Company"),
false, "transaction", view);
cc.AddPeriod(jPanel4, Translator.getTranslation("Period"), false);
if (bIsFastEntry) {
cc.comboBox.setEnabled(false);
}
cc.comboBox.addItemListener(this);
// jPanel4.add(new JLabel(""));
// jPanel4.add(new JLabel(""));
jPanel4.add(label1);
JPanel panelDate = new JPanel();
panelDate.setLayout(new GridLayout(1, 1));
labelTodaysDate.setEnabled(false);
panelDate.setBorder(LineBorder.createGrayLineBorder());
JPanel panelDate2 = new JPanel();
panelDate2.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2));
panelDate2.add(labelTodaysDate);
panelDate2.setLayout(new GridLayout(1, 1));
panelDate.add(panelDate2);
jPanel4.add(panelDate);
jPanel4.add(label4);
jPanel4.add(fileInfoTextField);
jPanel4.add(label2);
jPanel4.add(invoiceDateField);
jPanel4.add(new JLabel());
jPanel4.add(new JLabel());
jPanel4.add(label3);
jPanel4.add(commentsTextField);
jPanel4.add(label6);
JPanel panelTransaction = new JPanel();
panelTransaction.setLayout(new GridLayout(1, 1));
lableTransaction.setEnabled(false);
panelTransaction.setBorder(LineBorder.createGrayLineBorder());
JPanel panelTransaction2 = new JPanel();
panelTransaction2.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2));
panelTransaction2.add(lableTransaction);
panelTransaction2.setLayout(new GridLayout(1, 1));
panelTransaction.add(panelTransaction2);
jPanel4.add(panelTransaction);
JPanel jPanel10 = new JPanel();
dataMovementPane = new DataMovementPane(
(JdbcTable) transactionAccess, this, view);
jPanel10.setLayout(new BoxLayout(jPanel10,BoxLayout.X_AXIS));
jPanel10.add(dataMovementPane);
jPanel10.add(Box.createHorizontalGlue());
JPanel JLabelTotal = new JPanel();
JLabelTotal.setLayout(new BorderLayout());
HelpedLabel hl = new HelpedLabel(Translator.getTranslation("Total"), "DebitTotal", "transaction", view);
Dimension ddm2 = dataMovementPane.getPreferredSize();
Dimension ddm3 = hl.getPreferredSize();
ddm2.height = ddm3.height;
JLabelTotal.setPreferredSize(ddm3);
JLabelTotal.setMaximumSize(ddm3);
JLabelTotal.add(hl, BorderLayout.NORTH);
jPanel10.add(JLabelTotal);