From 626f2124ea7861da6e134002d2fe168a0da8756b Mon Sep 17 00:00:00 2001 From: zhe Date: Mon, 15 Nov 2021 15:47:45 +0100 Subject: [PATCH] butto width --- out/production/Tetris/Tetris/Board$1.class | Bin 775 -> 775 bytes out/production/Tetris/Tetris/Board.class | Bin 1615 -> 1534 bytes out/production/Tetris/Tetris/GameGui.class | Bin 1712 -> 2098 bytes src/Tetris/Board.java | 2 -- src/Tetris/GameGui.java | 22 +++++++++++---------- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/out/production/Tetris/Tetris/Board$1.class b/out/production/Tetris/Tetris/Board$1.class index 9671a62a4b61a136ce67f8b7a07b2208077b88b5..ca89719e1d440b2d5459509c7d4dc737d1da2d55 100644 GIT binary patch delta 27 icmZo?YiHY##l$MXz{wyvIiD$*RhB`JL2mMKCI!de}D`9dvrlO-^5vb=iJ9R_ukBJd)3zbdG-AVFviP(PR4yEe6lGF_kBt} zlPQu+xp>-V#%DGlU@joVyh}cCY{4nZfx<=iJPde5#p#wDTXs*?XT`%-kB(~f#kYHn zMy=t|R$g29(yU(mY4B^^(!Imf@^%Qr&FagcxNWqbKJ) z9$|Dl@o~COxtlrzG9+l{I%z80;Fa`mSDdGinU$3;y}Ep moZ&>wRgGqTP5)m?lzR+ot&u35%x6YbH2UEgVW4av)b|exokAM` delta 606 zcmYk4%}*0i6vcltZ5=wiM6kw&#>5Ylu@$V~2S}w#TS~_-v=*_75+aQ;QA}E0xWF!q zD_3TguJk`J?p&C-abaToS6sUwoHx2)7Vn&U?mPFMnauX!Z`1#|{q-AgmWMtExZpAC z5u|Y`d0h0EOS6ZvtuJ|8_L%qasraO+TCrx?f_2t?m5cUh_=H@szN?m9v&VIh8xAJi z-0XC#PuF|BPS0VmvNZp`9~Os%%~~^DY_!%^!dk15P@ugI!@Kmxf^FMI>hq6`lg(4m zyjJH$_erliy z!(G~jd)9ZKRl@_?(QEgwGZ4K>OjbuY%m@xSZFe~$esotoDovx~o)W~UKNUI4Ng%MCT-N%zm@#bxBfcAIs;OA!HlNo z7}xFzrsSBDC)EA6>NV*drg_E;Tf#TY@{ST8gdZu#yUNNEs6VAV2@cA8M$F~0_&@em k%ywPv{Iu_XC{g_`=M?LF^gT6}omSJ;n5@v3>I?Pk0QpZ)DgXcg diff --git a/out/production/Tetris/Tetris/GameGui.class b/out/production/Tetris/Tetris/GameGui.class index 18a6a5f2173f3c9d514eb165e79642a4d9d161c3..cab6a8b29e73b2e13da3b2219f80ef5e680a147f 100644 GIT binary patch literal 2098 zcmZuy%Xbr19R4PcPC85>2`#k1fubU50))3p5wU^RVp3nv zQABq72e9jqY%poFtAoQvVSjyDXf zRjLr)RFU3Nr?=H2bQEJK8R)}wC;Cy=A!C?Paz)3i+AXzQP|HQNRCUZ5*rrPAhaH1s zaA%$K8lnqU*_+j%jcVx1Id;txwl^iJbr}Y^APqCFn3Ed1^B2S=aXDLCuAWUy*>b!- zSCsAKtE39_y3T6$) zq*HfGa@bPMnv0F>QjnQAfP(~}4L-jS9q*WMQPbg>sN<4}1zdj8)9;Bmj}x0i{VLcM z6IXGKg|tNsS|c=*o^ToO0Nz~;l@$wK_Lwy%?V9D-%JQCx_wfOJCq%u*dZUvi$K~!v z^xa2XtDF~CoH`?Yi0dXkLe0btd~D(-K6$c6pA4)qppJ=s*iYzHd48}V$1O`Y2uGNY ziyEWe#4WOIk!*{2nfO%I_8D%Q_#Agke1SVeb2%eT>;b3Nk(0J3U2@0I;*aWN@q#RQ z4EiW>&Z#=|i59D(bW!oF-9jGpDa{h8gF1&r$#dK*8WJT}3Qvv+&y#^k!@<-j|DKF9 z(8jW&-)?rtgl2XIKip~M{%LeX;*I7i+Suan=Ta6&{IC=B0c%OnRJ_HS22dW{RZFDv%6nr>vUAw-dJVEt=+wKf+gR20Nf(C#4W} zQO+)tcT-0?`ZjXj-!=7h=Z)w1mc54#KEOZeCbSkpg(kxJOhWrLZp6Fe#(hM-N3?;C z7W6_g7Hy()Y)8DzXK#FS14aw03Q4nxuJN5MtS%(*75|%9(?HxeC1^Sn@sCM$jAmL` zTL?#*=x(4Vb06y(SfAO^K<{*Br@!_^f{jUgr_(L;6_Oj8*!TdO(%)fICdsT@)G47o zOoVPXuvG~i4Lqgxa05@PoiU!_-EHjV*$3FJRQzmDrg-^VAA{$)7SYSqAciKNE^NUX zVj3ql2^{4Q;3;(DJbF;UdU*7`Mr^NR18!j>?qUx zC#Uc?cH;$RI1(U?Ll~rF;x8P=i^M;TpJ{uE6FQ2o`FR;(=DUj_o+8Y8138|e=)^G` r59Y<0g?IuwTj*zZ1JjS&QNPdNi!H`6tF&g|h+&LS((nq`5Jvw4H)8*i delta 904 zcmYk5%TE(g6vltkX_N_0vfapBT`z@`2J8W*mO=N6+*((jz_o_o&y=9}A<;G50MpMI@<0QQqNsini< zgrAcp9y$Y5(`9hVq=XKW({!usj6si|vnD2;etHd3CZ+VLQh$H}232-W!H~hQpAj`{ z)L=}-^9sflOenZuP?a{>Mu$4$S&jv7k{pmdWSlmXba8LZ;{LoW-JQ%5vM{4mpb@avIj3OV@z5k2lDgs4UjRyJFN3OQoX)v{rmF1761pXt8xX>9AhF`ySsqCFuf2e>|jp3`T>~ z!RRV}m%ut^I=rc{j5Sb9Hy5x5Ttw zr2Pzep15pLq{JnnqVBR)MXyVZ2-zlwZ+}lzEy*t$-XYCzi~5s-sb#_vHi>wPklers zW%8Oq+JqgaoD>xdQ^^EXOo|~hVo+Y}c_j8crh%to%X8^?C0A;%Op0yTKr8!%MWo&) ze+o@7#{mwCjmMegkYqXm4wE{v;h-#eBtscfEt+>u{1d6}IAXP5tX5}O8yh)FyD*Jo Hf-?6ve2$** diff --git a/src/Tetris/Board.java b/src/Tetris/Board.java index c7362e2..2315392 100644 --- a/src/Tetris/Board.java +++ b/src/Tetris/Board.java @@ -13,8 +13,6 @@ public class Board extends JPanel public static final int BOARD_HEIGHT=20; public static final int BLOCK_SIZE=30; - public static final int BOARDRIGHT_WIDTH=15; - public static final int BOARDRIGHT_HEIGHT=5; private Timer loop; private Color[][] board = new Color[BOARD_WIDTH][BOARD_HEIGHT]; private Color[] [] shape ={ diff --git a/src/Tetris/GameGui.java b/src/Tetris/GameGui.java index b44d13d..565cee3 100644 --- a/src/Tetris/GameGui.java +++ b/src/Tetris/GameGui.java @@ -2,26 +2,30 @@ package Tetris; import javax.swing.*; import java.awt.*; - public class GameGui { public static final int width= 500, height =650; private Board board; - private Board board2; private JFrame frame; public GameGui(){ - frame = new JFrame("Tetris"); JPanel panel = new JPanel(); - panel.setBorder(BorderFactory.createMatteBorder(450, 50, 50, 50,Color.black)); - JButton button1 = new JButton("Start"); - JButton button2 = new JButton("Pause"); + panel.setBorder(BorderFactory.createMatteBorder(450, 10, 20, 10,Color.black)); + JLabel label = new JLabel("Name: ",JLabel.LEFT); + label.setBounds(100,100,50,30); + JButton button1 = new JButton("Start"); + + button1.setPreferredSize( new Dimension(150,150)); + JButton button2 = new JButton("Pause"); + JButton button3 = new JButton("Score"); panel.setLayout(new GridLayout(0,1)); - panel.setBackground(Color.DARK_GRAY); + panel.setBackground(Color.gray); + panel.add(label); panel.add(button1); panel.add(button2); + panel.add(button3); /* window.add(panel, BorderLayout.EAST); frame.add(window,BorderLayout.WEST); @@ -33,7 +37,7 @@ public class GameGui { board = new Board(); window.add(board); */ - + frame = new JFrame("Tetris"); frame.add(panel,BorderLayout.EAST); frame.setSize(width,height); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); @@ -41,8 +45,6 @@ public class GameGui { frame.setVisible(true); board = new Board(); frame.add(board,BorderLayout.CENTER); - board2 = new Board(); - frame.add(board2,BorderLayout.EAST); } public static void main(String [] args) {