From da12eef9e7d178d959cb7b4444c2054631be80cc Mon Sep 17 00:00:00 2001 From: vigliom Date: Mon, 10 Oct 2022 13:33:21 +0200 Subject: [PATCH] avanzo --- README.md | 6 +-- Salida.dat | 3 +- bin/jorpelu/com/MyCopy.class | Bin 3504 -> 3458 bytes bin/jorpelu/com/Ventana$1.class | Bin 0 -> 1436 bytes bin/jorpelu/com/Ventana$2.class | Bin 0 -> 705 bytes bin/jorpelu/com/Ventana.class | Bin 1296 -> 1897 bytes bin/jorpelu/com/main.class | Bin 729 -> 510 bytes src/jorpelu/com/MyCopy.java | 10 ++--- src/jorpelu/com/Ventana.java | 72 +++++++++++++++++++++++++++----- src/jorpelu/com/main.java | 13 ++---- textp.dat | 3 +- 11 files changed, 74 insertions(+), 33 deletions(-) create mode 100644 bin/jorpelu/com/Ventana$1.class create mode 100644 bin/jorpelu/com/Ventana$2.class diff --git a/README.md b/README.md index 70b7219..cb48406 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,8 @@ MyCopy ahora es una funcion que recibe 2 parametros, Ruta del archivo a copiar y Ruta de donde guardar el nuevo archivo, - En el Main por solo ejecuta llamada a copiar con 2 Strings de Ruta - -![](https://2dam.fp.edu.es/jorpelu/MiVentana/src/branch/master/ProyectosSPRING%20-%20MiVentana_README.md%20-%20Spring%20Tool%20Suite%204%202022-10-10%2002-48-38.gif) + En el Main llama a la ventana principal, que es la que se encarga de recoger los parametros. + Una vez dentro llama a myCopy con los datos correctos. Pero no consigo llamar bien a myCopy y no se ve el dinamico + ![Alt Text](/images/content/34341808/45800cf790f648a928bb8a8e0e3e8680.gif) \ No newline at end of file diff --git a/Salida.dat b/Salida.dat index aa9b0c1..883407a 100644 --- a/Salida.dat +++ b/Salida.dat @@ -1,3 +1,4 @@ Esto es una prueba de la incorporacion de My copy a el programa, Ya hace lo basico, pero voy a intentar organizar mejor las funciones y crear una pantalla -principal \ No newline at end of file +principal +Probando ya el menu principal \ No newline at end of file diff --git a/bin/jorpelu/com/MyCopy.class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e4%{qw^Ubhz2UpKfF+B?rzwgF50#J; zuLnjGz132~!BvLYQ=FajZsk+C5Bv0MNg&faP8tcmTcD* z4>z#N;Piw!kgu&O#ogUf!=hXB@HxI9(s{eh5RB*IFHPly<54R1 z^sbieI{#h8#>G0mwqRFnlW#q2fF#b*0Hbq;#rIl`VteGeXF?MZw)QO#TlkI~LpgWE zQyzz=7OI|j&=r~+sUosSF#*A_ViUGK)NqIFM+pttlZh45#mA*a7CTfY2x?Y|w$db! ze|w})F9>YzJrBE9mn`KTN@Gow=~@GPWb(uo1SMn0y7UHet+#Y1-uhS+y6YaOm|nz= zv~|7l`&zXElAJ_6y~H$9$Y6qgrQnSB?0C^4ruhezut^i`#u{D53Az`3B0$v=}T z=V?8c6wFh}No484OjFFJ(PhkFmUeRUNuhtKZH8jM4KddoV4*(5g=XR60GIcMxY8_q zI>2Z9LtJkbiUR~2>6Iz=$K-S$1&l}F_p$-0oXTTt%f%SYuQ)|=V%05|*iCYb1B zGoYNQ)GvK}AJDzqLE(o!?!Fs%3wat~hK8M`!RBxg^H|0L*2uayv4~BI)NqLux{L;v z@B}^tF?Wos=;B%eaD4<~3@{6c`}i>d`YY4 CZy*l< diff --git a/bin/jorpelu/com/main.class b/bin/jorpelu/com/main.class index 901f15b58346403b7486fff11ce2bdaa4bc4b6ad..3e19e230ea0030080c87ad1e152edf1a02da7491 100644 GIT binary patch delta 168 zcmcb~`j46G)W2Q(7#J9A8Du7Mt=D8^;Bu`EEX=?;xt!5%@_C5RTl=AnLOb q$YEmO0+L){2@VDhAd4Hw7lSAS(&9iK2ha!!21y{v$RGvQBMkr;QycmK delta 407 zcmY+9%TB^j5QhK5#g-!|l&cDgS1u-YZHT%sE=(XUAQ+a%(vV_p8*((T!dDFXPSBa}z{X{aE^5bwG@&$MrK!@bd)rXz(T zIHCwCNHA!BtF^(Y>kU+-7(&wQOYfj9q>2m!uM691iy3pou^L7YYYc^AwJYv~ZVRWQ z*JaOgI+b7L`Ndh^Fg= 4) cal = 0; try { - Thread.sleep(100); + Thread.sleep(50); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); diff --git a/src/jorpelu/com/Ventana.java b/src/jorpelu/com/Ventana.java index 4bd095b..b851809 100644 --- a/src/jorpelu/com/Ventana.java +++ b/src/jorpelu/com/Ventana.java @@ -1,33 +1,83 @@ package jorpelu.com; +import java.awt.AWTEvent; +import java.awt.Event; import java.awt.GridLayout; +import java.awt.TextField; +import java.awt.event.AWTEventListener; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.io.IOException; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel; +import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JTextField; public class Ventana extends JFrame { - private JLabel titulo, porcentaje, Barra; - private JTextField ruta; + private JLabel pideRuta, pideDestino; + private JTextField rutain, rutaout; + private JButton confirmar, salir; + JPanel panel; public Ventana() { Componentes(); + confirmar.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + if(rutain.getText().equals("") || rutaout.getText().equals("")) { + JOptionPane.showMessageDialog(null, "Los 2 Campos tienen que estar rellenos"); + }else { + + String r1 = rutain.getText(); + String r2 = rutaout.getText(); + try { + //Thread?? + MyCopy mc = new MyCopy(r1, r2); + }catch (IOException e1) { + e1.printStackTrace(); + } + + } + + } + }); + salir.addActionListener(new ActionListener() { + + @Override + public void actionPerformed(ActionEvent e) { + System.exit(EXIT_ON_CLOSE); + + } + }); } - + + public void Componentes() { - JPanel panel = new JPanel(); - JLabel texto = new JLabel("Introduzca la ruta del archivo a copiar: "); - JTextField ruta = new JTextField(""); - JButton confirmar = new JButton("Confirmar"); - texto.setSize(400, 20); - panel.add(texto); - panel.add(ruta); + panel = new JPanel(); + pideRuta = new JLabel("Introduzca la ruta del archivo a copiar: "); + pideRuta.setBounds(100, 0, 300, 50); + rutain = new JTextField(); + rutain.setBounds(50, 50, 300, 50); + pideDestino = new JLabel("Introduzca la ruta de destino: "); + pideDestino.setBounds(100, 100, 300, 50); + rutaout = new JTextField(); + rutaout.setBounds(50, 150, 300, 50); + confirmar = new JButton("Confirmar"); + confirmar.setBounds(150, 300, 100, 30); + salir = new JButton("SALIR"); + salir.setBounds(150,500, 100,30); + panel.add(pideRuta); + panel.add(rutain); + panel.add(pideDestino); + panel.add(rutaout); panel.add(confirmar); + panel.add(salir); add(panel); - panel.setLayout(new GridLayout(5, 1)); + panel.setLayout(null); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setSize(400, 600); setVisible(true); diff --git a/src/jorpelu/com/main.java b/src/jorpelu/com/main.java index 21ce039..a4b0e4c 100644 --- a/src/jorpelu/com/main.java +++ b/src/jorpelu/com/main.java @@ -4,16 +4,9 @@ import java.io.IOException; public class main { - public static void main(String[] args) { - try { - Ventana menu = new Ventana(); - MyCopy copia = new MyCopy("textp.dat", "Salida.dat"); - - - } catch (IOException e) { - e.printStackTrace(); - - } + public static void main(String[] args) throws IOException { + Ventana menu = new Ventana(); + //MyCopy copia = new MyCopy("textp.dat", "Salida.dat"); } } diff --git a/textp.dat b/textp.dat index aa9b0c1..883407a 100644 --- a/textp.dat +++ b/textp.dat @@ -1,3 +1,4 @@ Esto es una prueba de la incorporacion de My copy a el programa, Ya hace lo basico, pero voy a intentar organizar mejor las funciones y crear una pantalla -principal \ No newline at end of file +principal +Probando ya el menu principal \ No newline at end of file