From d53f297fa38d0b6a0c120d79e2aba6d8321d95b7 Mon Sep 17 00:00:00 2001 From: vigliom Date: Mon, 10 Oct 2022 00:18:42 +0200 Subject: [PATCH] creo una copia y vuelvo a empezar Ventana.Java --- bin/jorpelu/com/MyCopy.class | Bin 3014 -> 2844 bytes bin/jorpelu/com/Ventana.class | Bin 1429 -> 391 bytes bin/jorpelu/com/Ventana2.class | Bin 0 -> 1432 bytes src/jorpelu/com/MyCopy.java | 17 ++++++++----- src/jorpelu/com/Ventana.java | 36 +------------------------- src/jorpelu/com/Ventana2.java | 45 +++++++++++++++++++++++++++++++++ 6 files changed, 56 insertions(+), 42 deletions(-) create mode 100644 bin/jorpelu/com/Ventana2.class create mode 100644 src/jorpelu/com/Ventana2.java diff --git a/bin/jorpelu/com/MyCopy.class b/bin/jorpelu/com/MyCopy.class index 7063391cc6b9b5114bf90c7ad8025172df4ba319..1a3ebbdadeb7681fbe348134f9a851e37ce63710 100644 GIT binary patch literal 2844 zcma)8TW}Lq82(Ok+3j}Qq$vSXg{p|OU^XuYD; z`~9wXtrz;{j6S4{9j~L~jF0;4yE8iD=$npOzq3hc0zA-Z_WXO!fBF9F*&qJ<>2@D0>Lrks1eN=+0p30@R*r$1pL=pS31`C9xnCZv(6Le;)TeCIaLj)5 zSV?I!E>>`nK+~eF_`nU5DKqa_xvY*=5>_Bj$DD*?q>k*hjg+aNr7A2XmsDIz;O#2b za5<=AEtmULtm6_@&?c~A(SkG_&*lqMNi5?UTCqVocBMdL*|D>NNh{X~M3$^nvbbit7Nb~j ztW0#LZ5va)OoE0OYHP6_I}}`B9k{6p#~jzO6T6tGT!Ez(E)^90zqJ%}8KEu>-RMzp z!=i!eV;wijqEOs4WwILD5!Z1uZefX0Jna@iTtgoQ6!bI5ZYIy||4!jWjh^Rbr_>y4qN9G3?WEy9;5$x`!pRe=&=$ z-BQWyDp;AcX=_-GgA&3WQeTzfa<^zmBB&Q*8N64Z)QofpRXY*9H_EK zHncMCu|JfXuufq@w{ zWg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o0CN;vGgYz2U zR5k8&LlJ6H4bfQ}`dn)GI-$&eT6s-inFx$Mt=|qad`gf=Lr!er!yuYvB$ts6|S~?c`mH zdm;C9VToqw@exmtdo9ggu6Z_YV^vqHWa4Wo?TL1IUwaE{46tzzt0wO2Zam&}8;MeJ zWZ@yhL^Y0H3fbY(#yVDY^edWf)xl#tp+4a4HiMt3!QZIz`}$RiBZ*F4YCWqazRNJn z+PWo0yUu@&6J=uyPc{1m4N`ZojU6IEx{vJC567TJciS{Mhk;BRHs95HeljMh%GB?9 zMa@rBG|~DmtF%;~=B`I-H%@4#Hia&?lTGM~)(H!g!x+u7fgJJ}r>`8$Y`3y~g46|h zP2dz9@;^VUuD!?O(3vh|pJQlG;Q+o^7 zv5Fhie@m#MfEtQupp??SGoqH!w(y*OFNnB{C-|Q9%u$pI6+!>cEK#H%uuC#9>=9B9 GKmH5Q|2Gi; diff --git a/bin/jorpelu/com/Ventana2.class b/bin/jorpelu/com/Ventana2.class new file mode 100644 index 0000000000000000000000000000000000000000..30e47193ff3d834a2d6143d83fc039e39b6480a6 GIT binary patch literal 1432 zcmZ`(?Q+vb6g_g}ND)dyLc@x;#wEE!inI zcoegU-L_yF@J`rE_PX4AC8Fci3aPeNmn{}Hm=gMXbZIhm+%s_I6IC2cU`AJ1aB*H& zI8~LMu8gP`-qZINT`b}f*?T;G#GkVyjH{vS@uyv`SS%#LHw(35L;GHF;bX~wMZWvu zji#bd8`+j!e2#0x6xkZ0Co;5V;pbw*#tNkmf~xEa)|Sd|bN``gy$~;DF9>wrqKg0} z12)ATh*^JvmsEQ`7I4!ZTJpuVO@`_WZ_FfGPW=8hHqoT036)Ix`q2Rn=!YoB#vcd z<7)#`RT(`Os>76nO|0weS2WzJi${1&i@@4#1Hp(6_9`yF8(^h4Q zrtK#gO|{;3MWY^mUg`;vLoiMjxO3o&|dJbSMEZOQCZ(LvK2O-015porYE)J#`9BDYb1m z=wm)eaW0rlaUqyBew)qxl;Uz=rnnk-*HaYUr@u_8fO*2Z0Got1jSD!3izKZ@T*aji zN-kp+H?oo>$5F|@smDCs9S*S8?BiyAfLl%Pi$3n|4sfsOebq;0Z-C9F_n?n&Hq2E5 zb9yet!_sPst;5od?0KGmZ5;-s6x)ZT0d|_U*+(tKckf}Y5mkUs5SQQ)uth9mg>-up z*RYQ3w16w9qJSETXrPqAzB7b2f^Fj|{hkqU50CLZ@tLD66&iy6r&*y)KVY9|FmOPX Ha`^FIl&LqW literal 0 HcmV?d00001 diff --git a/src/jorpelu/com/MyCopy.java b/src/jorpelu/com/MyCopy.java index 485e5a2..34d489b 100644 --- a/src/jorpelu/com/MyCopy.java +++ b/src/jorpelu/com/MyCopy.java @@ -2,24 +2,27 @@ package jorpelu.com; import java.io.*; import java.util.ArrayList; -import java.util.Scanner; import javax.swing.JFrame; import javax.swing.JPanel; public class MyCopy { - static Scanner sc = new Scanner(System.in); - public MyCopy(String Ruta, JFrame jf){ - String ficheroString = sc.next(); - File fich = new File(".\\Salida.dat"); - File fich_a_copiar = new File(ficheroString); + public MyCopy(String RutaIn, JFrame jf, String RutaOut){ + + if(RutaOut==null) { + RutaOut = "."; + } + File fich = new File(RutaOut); + File fich_a_copiar = new File(RutaIn); + + if(fich_a_copiar.exists() == false) { try { fich_a_copiar.createNewFile(); } catch (IOException e) { - // TODO Auto-generated catch block + e.printStackTrace(); } } diff --git a/src/jorpelu/com/Ventana.java b/src/jorpelu/com/Ventana.java index e933925..1a988eb 100644 --- a/src/jorpelu/com/Ventana.java +++ b/src/jorpelu/com/Ventana.java @@ -1,45 +1,11 @@ package jorpelu.com; -import java.awt.FlowLayout; -import java.awt.GridLayout; - -import javax.swing.JButton; -import javax.swing.JFrame; -import javax.swing.JLabel; -import javax.swing.JPanel; -import javax.swing.JTextField; +import javax.swing.*; public class Ventana extends JFrame{ private JLabel titulo, porcentaje, Barra; private JTextField ruta; - public static void main(String[] args) { - new Ventana(); - - - } - - public Ventana() { - - Componentes(); - setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); - setSize(400,600); - setVisible(true); - setTitle("**Copiador de Archivos**"); - } - 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.add(confirmar); - add(panel); - panel.setLayout(new GridLayout(5,1)); - - } } diff --git a/src/jorpelu/com/Ventana2.java b/src/jorpelu/com/Ventana2.java new file mode 100644 index 0000000..73df5ff --- /dev/null +++ b/src/jorpelu/com/Ventana2.java @@ -0,0 +1,45 @@ +package jorpelu.com; + +import java.awt.FlowLayout; +import java.awt.GridLayout; + +import javax.swing.JButton; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.JTextField; + +public class Ventana2 extends JFrame{ + private JLabel titulo, porcentaje, Barra; + private JTextField ruta; + + public static void main(String[] args) { + new Ventana2(); + + + } + + public Ventana2() { + + Componentes(); + setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + setSize(400,600); + setVisible(true); + setTitle("**Copiador de Archivos**"); + } + + 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.add(confirmar); + add(panel); + panel.setLayout(new GridLayout(5,1)); + + } + +}