From bcdde35cea54f7c6a4ae89481f6c4cca11dc82b5 Mon Sep 17 00:00:00 2001 From: vigliom Date: Mon, 10 Oct 2022 02:45:43 +0200 Subject: [PATCH] Pongo MYCopy en funciones y con una ventana de carga practica --- README.md | 8 ++-- Salida.dat | 3 ++ bin/jorpelu/com/MyCopy.class | Bin 3244 -> 3504 bytes bin/jorpelu/com/Ventana2.class | Bin 1432 -> 1299 bytes bin/jorpelu/com/main.class | Bin 646 -> 646 bytes src/jorpelu/com/MyCopy.java | 72 +++++++++++++++++---------------- src/jorpelu/com/Ventana.java | 1 - src/jorpelu/com/Ventana2.java | 7 ---- src/jorpelu/com/main.java | 5 ++- 9 files changed, 48 insertions(+), 48 deletions(-) diff --git a/README.md b/README.md index 6d805d7..d50f150 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # MiVentana + Modifico la funcion MyCopia para que recibiendo unos parametros, + muestre como se van copiando los datos + + ~~~ -~~~ - -~~~ \ No newline at end of file + ~~~ \ No newline at end of file diff --git a/Salida.dat b/Salida.dat index e69de29..aa9b0c1 100644 --- a/Salida.dat +++ b/Salida.dat @@ -0,0 +1,3 @@ +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 diff --git a/bin/jorpelu/com/MyCopy.class b/bin/jorpelu/com/MyCopy.class index cdb744406e5ccaec69ba00a4d572bf3fce67e186..aba62f099c70a1196063becc82ff143b96fcb836 100644 GIT binary patch literal 3504 zcmaJ@X;@rW8GaALaEHr*z`%q|+Qzgd%`ia5rVX)>v<1=_QkDpWWYW~+GIN1Thnext zod7X)d$3hwHENAEQIoi(YF(mbNJ~v)-Q!y8`p@6`)5kwPD!%8=00ZF(4|C7*edk-= zZ#n1Y|6aKcU=RMPp+vwxp0d+sA{&XNCL%r4ovHM+hEla}oHV8)nMo@-8ac4fHYQ8~ z{b0(DnMubO=c2BA1xvRvY$nUko?`Ln2{JVY)h>Ro2AZ}m2m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u/com/main.class b/bin/jorpelu/com/main.class index 3c497a6e5b93fbba37a9142b7afd33666292f7b7..52aa28c4560cb309c4aacae07cea4198d6638937 100644 GIT binary patch delta 21 ccmZo;ZDZZw#l*?OAi%)OAi}^uIhe^904&1;g8%>k delta 21 ccmZo;ZDZZw#l*?QAi%)GAi}^mIhe^904$pWe*gdg diff --git a/src/jorpelu/com/MyCopy.java b/src/jorpelu/com/MyCopy.java index 21ed3d7..a0649c1 100644 --- a/src/jorpelu/com/MyCopy.java +++ b/src/jorpelu/com/MyCopy.java @@ -13,21 +13,34 @@ import javax.swing.JTextField; public class MyCopy extends JFrame{ - - public MyCopy(String RutaIn, String RutaOut) throws IOException { + private JLabel Porcentaje; + private JProgressBar barra; + String RutaIn, RutaOut; + public MyCopy(String in, String out) throws IOException { + RutaIn = in; + RutaOut = out; + Componentes(); + Copiar(); + } + + public void Componentes() { - /* - * Componentes de Ventana de caarga - */ - JLabel Porcentaje = new JLabel(); - Porcentaje.setBounds(100,0,20,200); - add(Porcentaje); - JProgressBar barra = new JProgressBar(); - barra.setBounds(100, 20, 150, 10); + barra = new JProgressBar(); + barra.setBounds(125, 65, 150, 10); add(barra); - /* - * Variables para copiar - */ + Porcentaje = new JLabel(); + Porcentaje.setBounds(190,-45,100,150); + add(Porcentaje); + setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + setSize(400,150); + setLocationRelativeTo(null); + setLayout(null); + setResizable(false); + setVisible(true); + setTitle("Copiando"); + } + + public void Copiar() throws IOException { File fich = new File(RutaOut); File fich_a_copiar = new File(RutaIn); if(fich_a_copiar.exists() == false) { @@ -43,22 +56,17 @@ public class MyCopy extends JFrame{ int c; ArrayList bufferin = new ArrayList(); - setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); - setSize(400,100); - setLocationRelativeTo(null); - setLayout(null); - setResizable(false); - setVisible(true); - setTitle("Copiando"); - - - try { while((c = din.read() ) != -1 && bufferin.add(c)) { Porcentaje.setText(calculando[cal]); cal++; if (cal >= 4) cal = 0; - Thread.sleep(100); + try { + Thread.sleep(100); + } catch (InterruptedException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } } for(int j = 0; j