- Frames
diff --git a/doc/VistaAniadir.html b/doc/VistaAniadir.html
new file mode 100644
index 0000000..3bd34b4
--- /dev/null
+++ b/doc/VistaAniadir.html
@@ -0,0 +1,344 @@
+
+
+
+
+
+VistaAniadir
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+- Detail:
+- Field |
+- Constr |
+- Method
+
+
+
+
+
+
+
+
+
+
+- java.lang.Object
+-
+
+- java.awt.Component
+-
+
+- java.awt.Container
+-
+
+- javax.swing.JComponent
+-
+
+- javax.swing.JPanel
+-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+-
+
+
+-
+
+
+
Nested Class Summary
+
+-
+
+
+
Nested classes/interfaces inherited from class javax.swing.JComponent
+javax.swing.JComponent.AccessibleJComponent
+
+
+-
+
+
+
Nested classes/interfaces inherited from class java.awt.Component
+java.awt.Component.BaselineResizeBehavior
+
+
+
+
+
+-
+
+
+
Field Summary
+
+-
+
+
+
Fields inherited from class javax.swing.JComponent
+TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
+
+
+-
+
+
+
Fields inherited from class java.awt.Component
+BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
+
+
+-
+
+
+
Fields inherited from interface java.awt.image.ImageObserver
+ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
+
+
+
+
+
+-
+
+
+
Constructor Summary
+
+Constructors
+
+Constructor and Description |
+
+
+VistaAniadir()
+Carga la vista en la que aniadir datos
+ |
+
+
+
+
+
+
+-
+
+
+
Method Summary
+
+-
+
+
+
Methods inherited from class javax.swing.JPanel
+getAccessibleContext, getUI, getUIClassID, setUI, updateUI
+
+
+-
+
+
+
Methods inherited from class javax.swing.JComponent
+addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
+
+
+-
+
+
+
Methods inherited from class java.awt.Container
+add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate
+
+
+-
+
+
+
Methods inherited from class java.awt.Component
+action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
+
+
+-
+
+
+
Methods inherited from class java.lang.Object
+equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
+
+
+
+
+
+
+
+
+-
+
+
+-
+
+
+
Constructor Detail
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+- Detail:
+- Field |
+- Constr |
+- Method
+
+
+
+
+
+
+
+
diff --git a/doc/VistaModificar.html b/doc/VistaModificar.html
new file mode 100644
index 0000000..b8142d6
--- /dev/null
+++ b/doc/VistaModificar.html
@@ -0,0 +1,344 @@
+
+
+
+
+
+VistaModificar
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+- Detail:
+- Field |
+- Constr |
+- Method
+
+
+
+
+
+
+
+
+
+
+- java.lang.Object
+-
+
+- java.awt.Component
+-
+
+- java.awt.Container
+-
+
+- javax.swing.JComponent
+-
+
+- javax.swing.JPanel
+-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+-
+
+
+-
+
+
+
Nested Class Summary
+
+-
+
+
+
Nested classes/interfaces inherited from class javax.swing.JComponent
+javax.swing.JComponent.AccessibleJComponent
+
+
+-
+
+
+
Nested classes/interfaces inherited from class java.awt.Component
+java.awt.Component.BaselineResizeBehavior
+
+
+
+
+
+-
+
+
+
Field Summary
+
+-
+
+
+
Fields inherited from class javax.swing.JComponent
+TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
+
+
+-
+
+
+
Fields inherited from class java.awt.Component
+BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
+
+
+-
+
+
+
Fields inherited from interface java.awt.image.ImageObserver
+ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
+
+
+
+
+
+-
+
+
+
Constructor Summary
+
+Constructors
+
+Constructor and Description |
+
+
+VistaModificar()
+Carga la vista en la que modificar datos
+ |
+
+
+
+
+
+
+-
+
+
+
Method Summary
+
+-
+
+
+
Methods inherited from class javax.swing.JPanel
+getAccessibleContext, getUI, getUIClassID, setUI, updateUI
+
+
+-
+
+
+
Methods inherited from class javax.swing.JComponent
+addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
+
+
+-
+
+
+
Methods inherited from class java.awt.Container
+add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate
+
+
+-
+
+
+
Methods inherited from class java.awt.Component
+action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
+
+
+-
+
+
+
Methods inherited from class java.lang.Object
+equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
+
+
+
+
+
+
+
+
+-
+
+
+-
+
+
+
Constructor Detail
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+- Detail:
+- Field |
+- Constr |
+- Method
+
+
+
+
+
+
+
+
diff --git a/doc/allclasses-frame.html b/doc/allclasses-frame.html
index bac3ffc..af36fcb 100644
--- a/doc/allclasses-frame.html
+++ b/doc/allclasses-frame.html
@@ -2,9 +2,9 @@
-
+
All Classes
-
+
@@ -13,9 +13,12 @@
diff --git a/doc/allclasses-noframe.html b/doc/allclasses-noframe.html
index 76e3a0a..c2f3eb2 100644
--- a/doc/allclasses-noframe.html
+++ b/doc/allclasses-noframe.html
@@ -2,9 +2,9 @@
-
+
All Classes
-
+
@@ -13,9 +13,12 @@
diff --git a/doc/class-use/Configuracion.html b/doc/class-use/Configuracion.html
index 8b2635e..d4d73aa 100644
--- a/doc/class-use/Configuracion.html
+++ b/doc/class-use/Configuracion.html
@@ -2,9 +2,9 @@
-
+
Uses of Class Configuracion
-
+
diff --git a/doc/class-use/ControladorAniaidr.html b/doc/class-use/ControladorAniaidr.html
new file mode 100644
index 0000000..e0241ba
--- /dev/null
+++ b/doc/class-use/ControladorAniaidr.html
@@ -0,0 +1,122 @@
+
+
+
+
+
+Uses of Class ControladorAniaidr
+
+
+
+
+
+
+
+
+
+
+
+
+No usage of ControladorAniaidr
+
+
+
+
+
+
diff --git a/doc/class-use/ControladorModificar.html b/doc/class-use/ControladorModificar.html
new file mode 100644
index 0000000..62a2d09
--- /dev/null
+++ b/doc/class-use/ControladorModificar.html
@@ -0,0 +1,122 @@
+
+
+
+
+
+Uses of Class ControladorModificar
+
+
+
+
+
+
+
+
+
+
+
+
+No usage of ControladorModificar
+
+
+
+
+
+
diff --git a/doc/class-use/Main.html b/doc/class-use/Main.html
new file mode 100644
index 0000000..09bc79b
--- /dev/null
+++ b/doc/class-use/Main.html
@@ -0,0 +1,122 @@
+
+
+
+
+
+Uses of Class Main
+
+
+
+
+
+
+
+
+
+
+
+
+No usage of Main
+
+
+
+
+
+
diff --git a/doc/class-use/Modelo.html b/doc/class-use/Modelo.html
index 64850c4..4a593da 100644
--- a/doc/class-use/Modelo.html
+++ b/doc/class-use/Modelo.html
@@ -2,9 +2,9 @@
-
+
Uses of Class Modelo
-
+
@@ -86,8 +86,14 @@
-Controlador(Vista vista,
- Modelo modelo)
+ | ControladorAniaidr(VistaAniadir vista,
+ Modelo modelo)
+Carga el controlador
+ |
+
+
+ControladorModificar(VistaModificar vista,
+ Modelo modelo)
Carga el controlador
|
diff --git a/doc/class-use/VistaAniadir.html b/doc/class-use/VistaAniadir.html
new file mode 100644
index 0000000..59fb7a3
--- /dev/null
+++ b/doc/class-use/VistaAniadir.html
@@ -0,0 +1,148 @@
+
+
+
+
+
+Uses of Class VistaAniadir
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/doc/class-use/VistaModificar.html b/doc/class-use/VistaModificar.html
new file mode 100644
index 0000000..e38ef35
--- /dev/null
+++ b/doc/class-use/VistaModificar.html
@@ -0,0 +1,148 @@
+
+
+
+
+
+Uses of Class VistaModificar
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/doc/constant-values.html b/doc/constant-values.html
index 61d1e1a..88ae2c4 100644
--- a/doc/constant-values.html
+++ b/doc/constant-values.html
@@ -2,9 +2,9 @@
-
+
Constant Field Values
-
+
diff --git a/doc/deprecated-list.html b/doc/deprecated-list.html
index 80ffc2f..a501c72 100644
--- a/doc/deprecated-list.html
+++ b/doc/deprecated-list.html
@@ -2,9 +2,9 @@
-
+
Deprecated List
-
+
diff --git a/doc/help-doc.html b/doc/help-doc.html
index 14086c3..adbf13c 100644
--- a/doc/help-doc.html
+++ b/doc/help-doc.html
@@ -2,9 +2,9 @@
-
+
API Help
-
+
diff --git a/doc/index-files/index-1.html b/doc/index-files/index-1.html
index a67e847..da0634c 100644
--- a/doc/index-files/index-1.html
+++ b/doc/index-files/index-1.html
@@ -2,9 +2,9 @@
-
+
A-Index
-
+
@@ -68,15 +68,15 @@
-
-
-
-
-
-
-
-
diff --git a/doc/index-files/index-9.html b/doc/index-files/index-9.html
index 39d5d75..8a22c9a 100644
--- a/doc/index-files/index-9.html
+++ b/doc/index-files/index-9.html
@@ -2,9 +2,9 @@
-
-V-Index
-
+
+T-Index
+
@@ -12,7 +12,7 @@
@@ -84,7 +84,8 @@
- javax.swing.JPanel (implements javax.accessibility.Accessible)
@@ -94,7 +95,9 @@
- Configuracion
-- Controlador (implements java.awt.event.ActionListener)
+- ControladorAniaidr (implements java.awt.event.ActionListener)
+- ControladorModificar (implements javax.swing.event.TableModelListener)
+- Main
- Modelo
diff --git a/doc/package-frame.html b/doc/package-frame.html
index 799f214..fd38a31 100644
--- a/doc/package-frame.html
+++ b/doc/package-frame.html
@@ -2,9 +2,9 @@
-
+
<Unnamed>
-
+
@@ -14,9 +14,12 @@
Classes
diff --git a/doc/package-summary.html b/doc/package-summary.html
index 088e0f0..f1b959d 100644
--- a/doc/package-summary.html
+++ b/doc/package-summary.html
@@ -2,8 +2,8 @@
-
-
+
+
@@ -75,7 +75,15 @@
|
-Controlador |
+ControladorAniaidr |
+ |
+
+
+ControladorModificar |
+ |
+
+
+Main |
|
@@ -83,7 +91,11 @@
|
-Vista |
+VistaAniadir |
+ |
+
+
+VistaModificar |
|
diff --git a/doc/package-tree.html b/doc/package-tree.html
index ed005f9..eb9938a 100644
--- a/doc/package-tree.html
+++ b/doc/package-tree.html
@@ -2,9 +2,9 @@
-
+
Class Hierarchy
-
+
@@ -84,7 +84,8 @@
- javax.swing.JPanel (implements javax.accessibility.Accessible)
@@ -94,7 +95,9 @@
Configuracion
-
Controlador (implements java.awt.event.ActionListener)
+
ControladorAniaidr (implements java.awt.event.ActionListener)
+
ControladorModificar (implements javax.swing.event.TableModelListener)
+
Main
Modelo
diff --git a/doc/package-use.html b/doc/package-use.html
index 99a493a..0049314 100644
--- a/doc/package-use.html
+++ b/doc/package-use.html
@@ -2,9 +2,9 @@
-
+
Uses of Package
-
+
diff --git a/doc/serialized-form.html b/doc/serialized-form.html
index a66050f..5032a95 100644
--- a/doc/serialized-form.html
+++ b/doc/serialized-form.html
@@ -2,9 +2,9 @@
-
+
Serialized Form
-
+
@@ -76,15 +76,19 @@
Package <Unnamed>
diff --git a/src/Controlador.java b/src/ControladorAniaidr.java
similarity index 85%
rename from src/Controlador.java
rename to src/ControladorAniaidr.java
index 2b5502c..a129466 100644
--- a/src/Controlador.java
+++ b/src/ControladorAniaidr.java
@@ -7,8 +7,8 @@ import java.util.Vector;
import javax.swing.JFrame;
import javax.swing.JList;
-public class Controlador implements ActionListener{
- Vista vista;
+public class ControladorAniaidr implements ActionListener{
+ VistaAniadir vista;
Modelo modelo;
/**
@@ -17,7 +17,7 @@ public class Controlador implements ActionListener{
* @param vista Vista a controlar
* @param modelo Modelo en el que trabajamos
*/
- public Controlador(Vista vista, Modelo modelo) {
+ public ControladorAniaidr(VistaAniadir vista, Modelo modelo) {
this.vista = vista;
this.modelo = modelo;
this.anaidirListeners();
@@ -29,8 +29,6 @@ public class Controlador implements ActionListener{
private void anaidirListeners() {
this.vista.aniadir.addActionListener(this);
this.vista.aniadir.setActionCommand("aniadir");
- this.vista.editar.addActionListener(this);
- this.vista.editar.setActionCommand("editar");
this.vista.mostrarTodo.addActionListener(this);
this.vista.mostrarTodo.setActionCommand("mostrar");
this.vista.eliminar.addActionListener(this);
@@ -50,13 +48,6 @@ public class Controlador implements ActionListener{
this.vista.insertarFecha.getText());
break;
}
- case "editar":{
- this.modelo.modificarTransaccion(Integer.parseInt(this.vista.insertarNombreViejo.getText()),
- this.vista.insertarNombre.getText(),
- Float.parseFloat(this.vista.insertarDinero.getText()),
- this.vista.insertarFecha.getText());
- break;
- }
case "mostrar":{
try {
ResultSet resultado = this.modelo.obtenerTransacciones();
diff --git a/src/ControladorModificar.java b/src/ControladorModificar.java
new file mode 100644
index 0000000..5c8b496
--- /dev/null
+++ b/src/ControladorModificar.java
@@ -0,0 +1,59 @@
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import javax.swing.event.TableModelEvent;
+import javax.swing.event.TableModelListener;
+
+public class ControladorModificar implements TableModelListener {
+ VistaModificar vista;
+ Modelo modelo;
+
+ /**
+ * Carga el controlador
+ *
+ * @param vista Vista a controlar
+ * @param modelo Modelo en el que trabajamos
+ */
+ public ControladorModificar(VistaModificar vista, Modelo modelo) {
+ this.vista = vista;
+ this.modelo = modelo;
+ this.cargarFilas();
+ vista.dtm.addTableModelListener(this);
+ }
+
+ /**
+ * Actualiza la tabla
+ */
+ public void cargarFilas(){
+ String[] fila = new String[4];
+ vista.dtm.setRowCount(0);
+ ResultSet resultSet = this.modelo.obtenerTransacciones();
+ try {
+ while (resultSet .next()) {
+ fila[0] = resultSet.getString(1);
+ fila[1] = resultSet.getString(2);
+ fila[2] = resultSet.getString(3);
+ fila[3] = resultSet.getString(4);
+
+ vista.dtm.addRow(fila);
+ }
+ } catch (SQLException e) {
+ e.printStackTrace();
+ }
+ }
+
+ @Override
+ public void tableChanged(TableModelEvent e) {
+ if(e.getType() == TableModelEvent.UPDATE){
+ System.out.println("actualizada");
+ int filaModificada = e.getFirstRow();
+ modelo.modificarTransaccion(Integer.parseInt((String)vista.dtm.getValueAt(filaModificada,0)),
+ (String)vista.dtm.getValueAt(filaModificada,1),
+ Float.parseFloat((String)vista.dtm.getValueAt(filaModificada,2)),
+ (String)vista.dtm.getValueAt(filaModificada,3));
+ }
+
+ }
+
+
+
+}
diff --git a/src/Main.java b/src/Main.java
index 7c735c6..b7f32b4 100644
--- a/src/Main.java
+++ b/src/Main.java
@@ -1,16 +1,37 @@
+import java.util.Scanner;
import javax.swing.JFrame;
+import javax.swing.JTabbedPane;
public class Main {
public static void main(String[] args) {
- Vista vista = new Vista();
- Modelo modelo = new Modelo();
- Controlador controlador = new Controlador(vista, modelo);
- JFrame frame = new JFrame();
- frame.setSize(500, 500);
- frame.add(vista);
- frame.setVisible(true);
+ try {
+ VistaAniadir vista = new VistaAniadir();
+ VistaModificar vista2 = new VistaModificar();
+ Modelo modelo = new Modelo();
+ ControladorAniaidr controlador = new ControladorAniaidr(vista, modelo);
+ ControladorModificar controlador2 = new ControladorModificar(vista2, modelo);
+ JFrame frame = new JFrame();
+ frame.setSize(500, 500);
+ JTabbedPane pestanias = new JTabbedPane();
+ pestanias.addTab("aniadir", vista);
+ pestanias.addTab("modificar", vista2);
+ pestanias.addChangeListener((ChangeListener)->{
+ controlador2.cargarFilas();
+ });
+ frame.add(pestanias);
+ frame.setVisible(true);
+ }catch(Exception e) {
+ System.out.println("Error inesperado"
+ + "\nPuede que no este bien definida su contrasenia de MySQL"
+ + "\nIntroducela:");
+ Scanner es = new Scanner(System.in);
+ Configuracion.guardarConfiguracion(es.nextLine());
+ System.out.println("prueba a reabrir el programa");
+ es.close();
+ }
+
}
}
diff --git a/src/Modelo.java b/src/Modelo.java
index fb83cfb..1665e9f 100644
--- a/src/Modelo.java
+++ b/src/Modelo.java
@@ -25,7 +25,7 @@ public class Modelo {
try {
configuracion = Configuracion.cargarConfiguracion();
}catch (Exception e) {
- Configuracion.guardarConfiguracion("1234");
+ Configuracion.guardarConfiguracion("");
try {
configuracion = Configuracion.cargarConfiguracion();
} catch (IOException e1) {
diff --git a/src/Vista.java b/src/VistaAniadir.java
similarity index 79%
rename from src/Vista.java
rename to src/VistaAniadir.java
index 4ae5f8a..fd5c847 100644
--- a/src/Vista.java
+++ b/src/VistaAniadir.java
@@ -5,9 +5,11 @@ import java.awt.GridBagLayout;
import javax.swing.JButton;
import javax.swing.JPanel;
import javax.swing.JPasswordField;
+import javax.swing.JTabbedPane;
import javax.swing.JTextField;
-public class Vista extends JPanel{
+public class VistaAniadir extends JPanel{
+ JTabbedPane pestanias;
JTextField textoNombre;
JTextField textoDinero;
JTextField textoFecha;
@@ -26,9 +28,9 @@ public class Vista extends JPanel{
JButton cargarPasswd;
/**
- * Carga la vista principal
+ * Carga la vista en la que aniadir datos
*/
- public Vista() {
+ public VistaAniadir() {
this.setLayout(new GridBagLayout());
GridBagConstraints constrain = new GridBagConstraints();
this.textoNombre = new JTextField("nombre");
@@ -47,15 +49,18 @@ public class Vista extends JPanel{
constrain.gridy = 2;
this.add(this.textoFecha, constrain);
- this.insertarNombre = new JTextField("nombre");
+ this.insertarNombre = new JTextField();
+ this.insertarNombre.setPreferredSize(new Dimension(80, 17));
constrain.gridx = 1;
constrain.gridy = 0;
this.add(this.insertarNombre, constrain);
- this.insertarDinero = new JTextField("dinero");
+ this.insertarDinero = new JTextField();
+ this.insertarDinero.setPreferredSize(new Dimension(80, 17));
constrain.gridx = 1;
constrain.gridy = 1;
this.add(this.insertarDinero, constrain);
- this.insertarFecha = new JTextField("fecha");
+ this.insertarFecha = new JTextField();
+ this.insertarFecha.setPreferredSize(new Dimension(80, 17));
constrain.gridx = 1;
constrain.gridy = 2;
this.add(this.insertarFecha, constrain);
@@ -64,32 +69,29 @@ public class Vista extends JPanel{
constrain.gridx = 0;
constrain.gridy = 3;
this.add(this.aniadir, constrain);
- this.editar = new JButton("editar");
+ this.mostrarTodo = new JButton("mostrar todo");
constrain.gridx = 1;
constrain.gridy = 3;
- this.add(this.editar, constrain);
- this.mostrarTodo = new JButton("mostrar todo");
- constrain.gridx = 2;
- constrain.gridy = 3;
this.add(this.mostrarTodo, constrain);
- this.eliminar = new JButton("eliminar");
- constrain.gridx = 3;
- constrain.gridy = 3;
- this.add(eliminar, constrain);
- this.buscar = new JButton("buscar");
- constrain.gridx = 4;
- constrain.gridy = 3;
- this.add(buscar, constrain);
-
- this.textoNombreViejo = new JTextField("id a cabiar");
+
+ this.textoNombreViejo = new JTextField("id seleccionado");
this.textoNombreViejo.setEditable(false);
constrain.gridx = 0;
constrain.gridy = 4;
this.add(this.textoNombreViejo, constrain);
- this.insertarNombreViejo = new JTextField("id a cambiar");
+ this.insertarNombreViejo = new JTextField();
+ this.insertarNombreViejo.setPreferredSize(new Dimension(80, 17));
constrain.gridx = 1;
constrain.gridy = 4;
this.add(this.insertarNombreViejo, constrain);
+ this.eliminar = new JButton("eliminar");
+ constrain.gridx = 2;
+ constrain.gridy = 4;
+ this.add(eliminar, constrain);
+ this.buscar = new JButton("buscar");
+ constrain.gridx = 3;
+ constrain.gridy = 4;
+ this.add(buscar, constrain);
this.titulopPasswd = new JTextField("Cambiar DB passwd");
this.titulopPasswd.setEditable(false);
diff --git a/src/VistaModificar.java b/src/VistaModificar.java
new file mode 100644
index 0000000..793485e
--- /dev/null
+++ b/src/VistaModificar.java
@@ -0,0 +1,33 @@
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.JTable;
+import javax.swing.table.DefaultTableModel;
+
+public class VistaModificar extends JPanel{
+ JTable datos;
+ DefaultTableModel dtm;
+
+ /**
+ * Carga la vista en la que modificar datos
+ */
+ public VistaModificar() {
+ this.setLayout(new GridBagLayout());
+ GridBagConstraints constrain = new GridBagConstraints();
+ dtm =new DefaultTableModel();
+ this.datos = new JTable(dtm);
+ this.datos.setModel(dtm);
+ this.dtm.addColumn("id");
+ this.dtm.addColumn("nombre");
+ this.dtm.addColumn("dinero");
+ this.dtm.addColumn("fecha");
+ JScrollPane scrollPane = new JScrollPane(datos);
+ datos.setFillsViewportHeight(true);
+ constrain.gridx = 0;
+ constrain.gridy = 0;
+ this.add(scrollPane, constrain);
+
+ }
+}
+