From 9abd25d0276c376de180c255f34511fcd877ecd7 Mon Sep 17 00:00:00 2001 From: vigliom Date: Mon, 10 Oct 2022 02:12:38 +0200 Subject: [PATCH] mas o menos va, necesita pulir --- README.md | 3 ++ bin/jorpelu/com/MyCopy.class | Bin 2833 -> 3244 bytes bin/jorpelu/com/Ventana.class | Bin 391 -> 0 bytes bin/jorpelu/com/main.class | Bin 0 -> 646 bytes src/jorpelu/com/MyCopy.java | 85 +++++++++++++++++++++------------- src/jorpelu/com/Ventana.java | 8 ---- src/jorpelu/com/main.java | 16 +++++++ textp.dat | 3 ++ 8 files changed, 76 insertions(+), 39 deletions(-) delete mode 100644 bin/jorpelu/com/Ventana.class create mode 100644 bin/jorpelu/com/main.class create mode 100644 src/jorpelu/com/main.java diff --git a/README.md b/README.md index c8f4d70..6d805d7 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,5 @@ # MiVentana +~~~ + +~~~ \ No newline at end of file diff --git a/bin/jorpelu/com/MyCopy.class b/bin/jorpelu/com/MyCopy.class index 85b871428168074df6442224e8ebc6e3a5e35b0b..cdb744406e5ccaec69ba00a4d572bf3fce67e186 100644 GIT binary patch literal 3244 zcma)8Yj7J^89mpMyt2HOCB{XB}Cq zu2z18LU@E%d6m)@2n-<*2$V+&k5#DKP~IgShR!hj>I{FGVFrd7{=mRs&Xr_Ga`Ph| zS$lQA_xaBK?q2=h3s(T#hgTJ}2t?*AyJ+OgiL5oB7+W5)ipvVTa$jH2mlCB#voM=D zG-B)XhCu5+vtT-J73hhjq&$(=DNQ>zl?LCq(>o;)7+%U6MaQ%XB?WB)o2quEl^7jg zmk4-=teg>m2dWAmIs`ni-YEs08}mr%(?&jkAXNDkQLzbK0&OM3Ibf9wxsreq8|7c` zQ~&}uskj-N=}gb%1mg9a^+hK!WX%_?f>Ce=duwSoZz|X#u(=6=3EP^rjZ*1=ZU>;r z_!=S#wh5?f6^)pA*3gaZvW8m)qSpaQCf1ENtGFFIh^Mh+mKWn9)M9>=1WDpAVoHJ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9_eYhjuleSm~l+QH3!TCGOB_$ zUpFe1s#ql;I#jITvR6eXmpfEk#3i9%oj^-%=6(4>(WRkjOlVk(^)ls41Qt|Nu3|&< z6kJ+ky47$EpJ@^srD>PI;(5~=4bQ_SN^64;7TucY-B_>SvKkc`#IMqWD`b={0`d7M zwJKhit#fTFx>hc6h2t1g{lrs4FBoJB zc1`<`hCSG;;0A%EUJl-*_2pgDaf$`koF}M`8@oj`g>vN7{@L2X=Lfk$L-2- z&@DOJ3*wpgQkb-EV_a5OA)Z%Gg{oVMRxWEg8dkzffsBv&16PMvgN<`l>?enp%l$ze zQ@D+TViXEyo@sQPZp3N|@Wo>pHtx`IC+-qZUArRWsnS+kb2YSzdl>a{+4=i)+%Fp( z@&H%y00sM0JR|^F@FO}N#bE+7YDxn63#mdQoA9`fCnPW`Su!L6*U*EfbUck`==*?U zxjg-XG#{E{5XU@dIHQDT;b~4b3P-HWm_XzdXXWX@^RQ8V-)HR0*agdQc>eJ~%@o;y ztSwL{kIJ~uq;_6eN7k?LznQ21vwhaSIb>2$vB2#b-U=5?npmsxq|Wo>=EI?0u|9Blmhm0TGT z0i8rWtvW13OgaiYPWP0H9W!W2N8@Fj)9>w;a<_d=39Uzpl?|2hON!bznhPUuG zscYdE9OJH@wXDE9+-dxMT-`bN5$|Fe4fGzudw8E{l^OE`>gcTMc6`WPBYq|}A8{8E z0ispeZLV5G=neQ1k&|du(8B+-ya06tpH$ww%~}OX1>FjIgb)fbN9<|^duEyS88lf5 rHD}qBGbmNu{ezG=$v=LCwm_RjJ0fR}FF4AK|2M*N#y@2Nb@=Q*h2xwC diff --git a/bin/jorpelu/com/Ventana.class b/bin/jorpelu/com/Ventana.class deleted file mode 100644 index e68c381ee86304913178acba376c339bccbeeb91..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 391 zcmZut%TB{E5FDp@KnS#?6mjJS9LNXoI8Z4E6mg---AOHQB`yX;=F$K3E% zFoagxUTKDtV&}Txl~6Yf@k*Q8HEF0gc;Lox2H*6S=xo=r5F49Ip_XI|Z)GR#J;UhY zvLwS?FGY+I#t9CPFpLY?iKo7;gjw)PQSY?SHCH7!(&dBb+gG_}m=*u*@%x9P~E*iVqI~LW(>@1MdyIkC=2uhh`!?q%7O!KydYmqmQj^LKu=vB8~}N Psf$xgiRtGEJiGrg;d8RP|}&tiq;_ZJ7;%FXEY( zBDGRKpdVE+Ya;bRU(W8FJ!fXlv48&h_5;8h?6{~21k=1MR6386d=|~5&RjS)E6-$< z%4`z#M^lv;ft3TDY4cWKsoNV0IEVRId00Zj$1+v~)?%HhkMr3`mB(_FDuFQ06PXTW zsV!b49dn{j?c2Y)`{cCx0`2bS__zMRlscR2_l7Rk+4pDL(Zyk2T-4DNXc%>FioLNk zb+iP$flT#STI?af1MBgjz;5?0@!d>s=%IrrE*=XsD^9G5cTz>X{@oUQpE`vQUmty{6b={Wdm#d0Kz#ge>1J}(pXUfVS`>{j-y4{U<# z=f?wTym9S}E>Xl&@LYa%jrvvf>@nJBCUK9^U)+7H5;briYs}c@DIC%Pt?vjvg<-gH zjdpyAdi?q;9$i&!K8rh4wxl7;ErCxIFm8~_3bb!Y@C?t10#?1K{JtdOpVoKLaY(jB HSi|-WjAw?o literal 0 HcmV?d00001 diff --git a/src/jorpelu/com/MyCopy.java b/src/jorpelu/com/MyCopy.java index cd95e76..21ed3d7 100644 --- a/src/jorpelu/com/MyCopy.java +++ b/src/jorpelu/com/MyCopy.java @@ -1,64 +1,87 @@ package jorpelu.com; +import java.awt.GridLayout; +import java.awt.PopupMenu; import java.io.*; -import java.io.File; import java.util.ArrayList; -import java.util.Scanner; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.JProgressBar; +import javax.swing.JTextField; -public class MyCopy { - Ventana ventana; + +public class MyCopy extends JFrame{ - public static void main(String[] args) throws FileNotFoundException, IOException { - File fich = new File(".\\Salida.dat"); - File fich_a_copiar = new File("textp.dat"); + public MyCopy(String RutaIn, String RutaOut) throws IOException { + + /* + * 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); + add(barra); + /* + * Variables para copiar + */ + File fich = new File(RutaOut); + File fich_a_copiar = new File(RutaIn); if(fich_a_copiar.exists() == false) { fich_a_copiar.createNewFile(); } - String[] calculando = {"-", "\\", "|", "/"}; - FileInputStream in = new FileInputStream(fich_a_copiar); DataInputStream din = new DataInputStream(in); FileOutputStream out = new FileOutputStream(fich); DataOutputStream dout = new DataOutputStream(out); + String[] calculando = {"-", "\\", "|", "/"}; int cal=0; int i=0; 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)) { - System.out.println(calculando[cal]); + Porcentaje.setText(calculando[cal]); cal++; if (cal >= 4) cal = 0; - - try { - Thread.sleep(100); - } catch (InterruptedException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } + Thread.sleep(100); } for(int j = 0; j