NumberFormatTextField agregado en el campo value de ingresos y formateado los campos integer en los tablemodels

This commit is contained in:
Daniel Cortes
2019-01-06 00:44:49 -03:00
parent f1c199487a
commit 73f5b44cf5
7 changed files with 31 additions and 70 deletions

View File

@@ -29,6 +29,7 @@ import com.intellij.uiDesigner.core.GridLayoutManager;
import com.intellij.uiDesigner.core.Spacer;
import danielcortes.xyz.models.tipo_ingreso.TipoIngreso;
import danielcortes.xyz.views.components.IngresosTableModel;
import danielcortes.xyz.views.components.NumberFormatedTextField;
import javax.swing.*;
import javax.swing.table.TableRowSorter;
@@ -39,8 +40,8 @@ public class IngresosView {
private JTable ingresosTable;
private JButton guardarButton;
private JButton eliminarButton;
private JTextField totalIngresoField;
private JTextField valorField;
private NumberFormatedTextField totalIngresoField;
private NumberFormatedTextField valorField;
private JComboBox<TipoIngreso> tipoCombo;
private JLabel errorTipoIngreso;
private JLabel errorValor;
@@ -85,11 +86,11 @@ public class IngresosView {
return eliminarButton;
}
public JTextField getTotalIngresoField() {
public NumberFormatedTextField getTotalIngresoField() {
return totalIngresoField;
}
public JTextField getValorField() {
public NumberFormatedTextField getValorField() {
return valorField;
}
@@ -183,7 +184,7 @@ public class IngresosView {
final JLabel label2 = new JLabel();
label2.setText("Valor");
panel2.add(label2, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
valorField = new JTextField();
valorField = new NumberFormatedTextField();
panel2.add(valorField, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
final JLabel label3 = new JLabel();
label3.setText("N° Inicial");
@@ -244,7 +245,7 @@ public class IngresosView {
final JLabel label7 = new JLabel();
label7.setText("Total Ingresos");
panel4.add(label7, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_EAST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
totalIngresoField = new JTextField();
totalIngresoField = new NumberFormatedTextField();
totalIngresoField.setEditable(false);
panel4.add(totalIngresoField, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
final JPanel panel5 = new JPanel();