From 759ba2dc5de2290a3d44a0badb875113bd76ab82 Mon Sep 17 00:00:00 2001 From: HORVILLE Ewen Date: Mon, 7 Feb 2022 17:26:04 +0100 Subject: [PATCH] TP 1/2/3 --- APL2.1/TP01/Arguments/Arguments.class | Bin 0 -> 949 bytes APL2.1/TP01/Arguments/Arguments.java | 5 ++++ APL2.1/TP01/Demarrage/Demarrage.class | Bin 0 -> 639 bytes APL2.1/TP01/Demarrage/Demarrage.java | 29 ++++++++++++++++++++ APL2.1/TP01/Grille/Grille.class | Bin 0 -> 674 bytes APL2.1/TP01/Grille/Grille.java | 15 ++++++++++ APL2.1/TP01/Somme/Somme.class | Bin 0 -> 1028 bytes APL2.1/TP01/Somme/Somme.java | 10 +++++++ APL2.1/TP01/Tri/Tri.class | Bin 0 -> 651 bytes APL2.1/TP01/Tri/Tri.java | 13 +++++++++ APL2.1/TP02/Boutons/Boutons.java | 29 ++++++++++++++++++++ APL2.1/TP02/Choix/Choix.class | Bin 0 -> 894 bytes APL2.1/TP02/Choix/Choix.java | 25 +++++++++++++++++ APL2.1/TP02/Contingences/Contingences.class | Bin 0 -> 1241 bytes APL2.1/TP02/Contingences/Contingences.java | 29 ++++++++++++++++++++ APL2.1/TP02/Saisie/Saisie.java | 24 ++++++++++++++++ APL2.1/TP02/Sirocco/Sirocco.java | 22 +++++++++++++++ APL2.1/TP03/Damier/Damier.class | Bin 0 -> 1065 bytes APL2.1/TP03/Damier/Damier.java | 24 ++++++++++++++++ APL2.1/TP03/Question/Question.class | Bin 0 -> 1009 bytes APL2.1/TP03/Question/Question.java | 28 +++++++++++++++++++ 21 files changed, 253 insertions(+) create mode 100644 APL2.1/TP01/Arguments/Arguments.class create mode 100644 APL2.1/TP01/Arguments/Arguments.java create mode 100644 APL2.1/TP01/Demarrage/Demarrage.class create mode 100644 APL2.1/TP01/Demarrage/Demarrage.java create mode 100644 APL2.1/TP01/Grille/Grille.class create mode 100644 APL2.1/TP01/Grille/Grille.java create mode 100644 APL2.1/TP01/Somme/Somme.class create mode 100644 APL2.1/TP01/Somme/Somme.java create mode 100644 APL2.1/TP01/Tri/Tri.class create mode 100644 APL2.1/TP01/Tri/Tri.java create mode 100644 APL2.1/TP02/Boutons/Boutons.java create mode 100644 APL2.1/TP02/Choix/Choix.class create mode 100644 APL2.1/TP02/Choix/Choix.java create mode 100644 APL2.1/TP02/Contingences/Contingences.class create mode 100644 APL2.1/TP02/Contingences/Contingences.java create mode 100644 APL2.1/TP02/Saisie/Saisie.java create mode 100644 APL2.1/TP02/Sirocco/Sirocco.java create mode 100644 APL2.1/TP03/Damier/Damier.class create mode 100644 APL2.1/TP03/Damier/Damier.java create mode 100644 APL2.1/TP03/Question/Question.class create mode 100644 APL2.1/TP03/Question/Question.java diff --git a/APL2.1/TP01/Arguments/Arguments.class b/APL2.1/TP01/Arguments/Arguments.class new file mode 100644 index 0000000000000000000000000000000000000000..c997241c75d89483853142256a5d33aef69d4eed GIT binary patch literal 949 zcmaJkA1M5<1E3Mel4~5Ey7WKtMw238YG@)t&sSiF4Frf>}4%r==@a~WB z*%zPnL6bi82lzw$4L()xLSrEiH`%#&?woV)xp(I0<@p7Gr+924ikoq)V0DE8>n3g^ z&2figgCY9dc5QvY5Y87)7>ufFONM04cIBI4zbU`Pbs`vKnqM~ow5VGG*~%ZEy7 zUwdM3EcK~s`^hMFV%W8C7xy@_7IN5Qi2qAMlxrDpn_bz`466&Y%>e5oU&}uAs)htl zO**kv`5m>PsTnEy6%+T7r&5Q??UMc-#<1QOJy}(5OX&BuJ|)lBf;wT?%P*M5e2Aot z)y|e;;DeyBLvu|nN_4_e2qy55A$#4e?VhQgyqf())sbjv<&8MXbfGn+dcy&O_1bl% zS9OH%OOpC&y24eC$*^Aux9vzjJ0Vu)g)eE`U$p!sKcyh4~a!;W%|$%L>OM zhTL3#i?lIp{U3*2MCh>xUkEf`#AuDvE<=`)jTC=?eIWc literal 0 HcmV?d00001 diff --git a/APL2.1/TP01/Arguments/Arguments.java b/APL2.1/TP01/Arguments/Arguments.java new file mode 100644 index 0000000..560b7ef --- /dev/null +++ b/APL2.1/TP01/Arguments/Arguments.java @@ -0,0 +1,5 @@ +public class Arguments { + public static void main(String[] args) { + for (String name : args) System.out.println("Bonjour " + name); + } +} \ No newline at end of file diff --git a/APL2.1/TP01/Demarrage/Demarrage.class b/APL2.1/TP01/Demarrage/Demarrage.class new file mode 100644 index 0000000000000000000000000000000000000000..30d24f0f7abc6bd1426608160d9b1d305e6e4e59 GIT binary patch literal 639 zcmY+CUr*Ce7{;G7x^^uc6xcstLqU)ZlqFn%3gRMUMnaT0!UbG)*eoS$XKH8SN6~Mg zCN=TG8}IxAejDTSu8D+mlIQpKecyA=bDHz}?~k7VcG0phjar_ujJEdd*B?u7x92}` zd^RzU1q+L)i!?-*MDB>(6 z^BdoxzA)gKRDGP(VWNaGV`=?{2~3ig+P<^>)LA+xA-Ah(JG%2?$C%X~6-vlIHowAH zOi>`}85$WXS_&za^%R!SNHIxP3n^@}W~M0K80gR;cw7!P@+hJ}|3%)w;ViLMqooF; gRodG`1>30N3A4}nevYw#H+(4(6r_*MbnwYTU zSGZ)u(num27ybbM1pmYMI(HyxNc1kw`Of=0=YIeF^&5ai)E#6|a4>~y8C=J-jT;V% zDA_36n9=a2jf%jmz#JjH?1z55N-(PPTLkk_|CJ(KS@T1+KJ2ws^g^}+_Lx2ChlHu> z?%JMwD;t3fyNy;H`C)fS7ml@J*?IF!4leSYR(}|E)MH;4XP-oV5U2;b(uIpLfm<$a z%HLygUYN~J=env46|rURyW-i44GG1zGDsZLCo7`d8Zthy>9 z*aI2uD>ey*>OWXFFLi3Y+mBU`@6aFWg7bX8-`M08V_sCr-V$LlnRD4qum(EmKV$ef zB8dkfW}!bvzZ6Ixg5@|{W!A*n@;-w;GT<*@nNFO9404!YtW!V0fXRBtGZwxewQQ`E ziq>oM9pe@U$zx0h+4Eoq<{*EMHV(8HUTv$!G#-N%L@#hk7nkT*u6i( zwHw#EP{V>B;6L#nxDxM7NhqOlk~jC=H|L&v?!9k*{XIDau#R;T1}02Q;zkBpPRD6vbLdBV%CB!X4Z-aL+;! z^MtV%zOOXn26yQGF~^2WJ?hyhiD^=UjXZ# zk_R#%q&p%ACA)-dX-Gl!OZ<&qsHDp+^1D$$A8-4WH(b5q9!TL zmgf`di`Wt^;6yClg!(uOgRRe2;`78Ae(?*#6KaTHRivNq~Nq{c{GW<5# zn_)|A^@Sgxue>2#<98}P@1#cCfBsAHuD+z#jLjaOfO97 zKaqI9@lm5MXTQH8SvY|Pe1{&|iXh8%RvvMsWjWlnURQCTF;IG1iOno@G423V+G7pJx9iuc?3j{r~0w literal 0 HcmV?d00001 diff --git a/APL2.1/TP01/Somme/Somme.java b/APL2.1/TP01/Somme/Somme.java new file mode 100644 index 0000000..72c01f6 --- /dev/null +++ b/APL2.1/TP01/Somme/Somme.java @@ -0,0 +1,10 @@ +public class Somme { + public static void main(String[] args) { + int sum = 0; + for (String nb : args) { + sum += Integer.parseInt(nb); + } + + System.out.println("Somme = " + sum); + } +} \ No newline at end of file diff --git a/APL2.1/TP01/Tri/Tri.class b/APL2.1/TP01/Tri/Tri.class new file mode 100644 index 0000000000000000000000000000000000000000..e1e4a666c4144a080b04850684b7b02597399755 GIT binary patch literal 651 zcmZuv%Wl&^6g^`np4Pauw6wh3Qr?aOjl_mU0SO@?MG6!tRX15p!YG;&+tI{9>YguQ z!x|P)A(Ri`WB33h9%r0ILDZJ!-nnznIrrX~Z@<3G06f4>hy|>LIFI!Z8@RBDi@4;x z%OS2Hme`co5(ple+?0<6{G@RpPW>(yWy<6N8%eKosNSg7 zNae#;x3nf7?mFO7w^W1I&(*lfm$)hrc8jSU=x4^^7xt~$amWaZ2qm^7T*GyV8xd~e zmc;D{caTJAAeCrFxQlzNi6DWM6T!Xyp&pb1Uau{1?j+vMOFh(Ynp=VO%ISMe8LSFWJ6U*)CPfVm^v$ zK<&o=!UAhmwf{l|ZZe@6ml8gc}{#Gu&;`3fg-58R7#Sfrx8R1$`zi z;VgZZnxO`twwcbph8_P=oX*~1wHc@J{bP80Z$0t;_xI*8{Ew*7)IT9`gkD9sMSZI9 i4@fEbeged-Vw=<{GnRQ8!TSj*u_Au(x$$Bu^y(kTZHb2f literal 0 HcmV?d00001 diff --git a/APL2.1/TP01/Tri/Tri.java b/APL2.1/TP01/Tri/Tri.java new file mode 100644 index 0000000..5a1bb70 --- /dev/null +++ b/APL2.1/TP01/Tri/Tri.java @@ -0,0 +1,13 @@ +import java.util.Arrays; + +public class Tri { + public static void main(String[] args) { + int[] intArray = new int[args.length]; + for (int i = 0; i < args.length; i++) { + intArray[i] = Integer.parseInt(args[i]); + } + + Arrays.sort(intArray); + System.out.println(Arrays.toString(intArray)); + } +} \ No newline at end of file diff --git a/APL2.1/TP02/Boutons/Boutons.java b/APL2.1/TP02/Boutons/Boutons.java new file mode 100644 index 0000000..1632416 --- /dev/null +++ b/APL2.1/TP02/Boutons/Boutons.java @@ -0,0 +1,29 @@ +import javax.swing.*; +import java.awt.*; + +public class Boutons { + public static void main(String[] args) { + JFrame fenetre = new JFrame(); + + fenetre.setSize(500, 300); + fenetre.setLocation(0, 0); + fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + + JButton BT1 = new JButton("OwO"); + fenetre.add(BT1, BorderLayout.WEST); + + JButton BT2 = new JButton("OwO"); + fenetre.add(BT2, BorderLayout.EAST); + + JButton BT3 = new JButton("OwO"); + fenetre.add(BT3, BorderLayout.NORTH); + + JButton BT4 = new JButton("OwO"); + fenetre.add(BT4, BorderLayout.SOUTH); + + JButton BT5 = new JButton("OwO"); + fenetre.add(BT5, BorderLayout.CENTER); + + fenetre.setVisible(true); + } +} \ No newline at end of file diff --git a/APL2.1/TP02/Choix/Choix.class b/APL2.1/TP02/Choix/Choix.class new file mode 100644 index 0000000000000000000000000000000000000000..8fde239f7122d434b976ca6177af882056a132e7 GIT binary patch literal 894 zcmZuvTTc@~6#k~&?QWNXbmdZ1L{xN33+o*PB#|lvQo)F6g2snwcYr1BPBYyK_^*5^ zi6p+7_Z`nfdkS`wsvMSaC3hDGRq8q%ft$v=+CuxMSh2152l8 zY}|8@#eEx|jiQduS}55lYv7!Xc^keqA6R&3;Sob-IgG-1g(2+~YYaw327=*AHH^eo zw^bMF1FttJVzhV|F^qYis)zgw_nSQ0_jh6yM*B;;(Akk))evi;20N7l86MATU=HIb zFu2-2_B%&}_czxRZ;2cp<4F!rwRnaFhVhG-)ovWiXkE!}o1t(qv-zF}q3q}Bs&#d; zw{ z(NZc@FBCNzhT)_|vViUSp=eOG)e-Sd_?4)e-o}RB#{fmDvccm}(%K5- zy%u}C+l(ts*%8}qq0Uo=m*7Xe%lDe*0nwQ1Xa6nmRlO4{-iZ54NcLYmuh+~fvelLm zQCParvp;J8t!SEB*a`a&>wPTNFpW|AVEUv$FM$Hd3GyaMGt%blDcCnM7_O1bBte6I z+I8F@TSI>$O>v-ehScsU($!L){m!#;4@N1S?!hc&ddQr?qNM%y4B1`RImN(MV&%wM zG!k=An`U{ghoSO>kw}wdY0e$)Azzv>TsP6CdsS;fjQk&L6~oDRHvN1THu1<3hXKqW k2Ooo2#1P&PW)pe5BSZ}&_)Oddv2PJ?l`x;A9x2@X3l<*02><{9 literal 0 HcmV?d00001 diff --git a/APL2.1/TP02/Choix/Choix.java b/APL2.1/TP02/Choix/Choix.java new file mode 100644 index 0000000..22ab185 --- /dev/null +++ b/APL2.1/TP02/Choix/Choix.java @@ -0,0 +1,25 @@ +import javax.swing.*; +import java.awt.*; + +public class Choix { + public static void main(String[] args) { + JFrame fenetre = new JFrame(); + fenetre.setSize(500, 300); + fenetre.setLocation(0, 0); + fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + + ButtonGroup houses = new ButtonGroup(); + JRadioButton gryffondor = new JRadioButton("Gryffondor"); + JRadioButton serpentard = new JRadioButton("Serpentard"); + JRadioButton serdaigle = new JRadioButton("Serdaigle"); + + houses.add(gryffondor); + houses.add(serpentard); + houses.add(serdaigle); + + fenetre.add(gryffondor, BorderLayout.NORTH); + fenetre.add(serpentard, BorderLayout.CENTER); + fenetre.add(serdaigle, BorderLayout.SOUTH); + fenetre.setVisible(true); + } +} \ No newline at end of file diff --git a/APL2.1/TP02/Contingences/Contingences.class b/APL2.1/TP02/Contingences/Contingences.class new file mode 100644 index 0000000000000000000000000000000000000000..7e5c520372ced0b68ae0303212c35c67ae112860 GIT binary patch literal 1241 zcmZuxTT>HB6#kk_GGQE$1i2}SsJjM}kX_e1$}Wi;0VAM6F#6OaEjv0)Q=N&o^3BJ6 zS$~Q?OsY(kKVbjMzU}ksIf3O;#Z1-d%lGv;-#L9|{{HXFR{+=X)WKOy*|_AO2UBda zY;tV!Hl~v(II!_kFI@c0v&%MqacFUc7guduOX50{Z`io$Aicx9#k0$7uCkf2aofQt z?%0^+@mDs#B{9bbi#AF&?g}Jsdx00u3dAx~YXVkDH=U%B@4a`HVf6zc){ijA9Sj^W$LQzF*#MzK}d)S>Z&=-d>4~ACy?g(n?mz7 zfrZ7gkz2~e?<8BBsIFmVvxN2wIePzGVs#X1&TJmDM@B^88bhB z7$L0=_5JrJ}yNA^6ePSYr8j9+R)e4>fK1+t0mriEVo zfFEhj)PHC7ycJ=jgV9>Pjj>zSm^DDGQ#723FrFQ= z(x=HwmPlvzWiQg7fyF23O_TUhIFzA_i|E5N`Z0^+^g*VuOz0X0@f;`c62oX=1n-Ic T0b}?Rr|=iXDd~&ks|T6y`xqSp literal 0 HcmV?d00001 diff --git a/APL2.1/TP02/Contingences/Contingences.java b/APL2.1/TP02/Contingences/Contingences.java new file mode 100644 index 0000000..882b56c --- /dev/null +++ b/APL2.1/TP02/Contingences/Contingences.java @@ -0,0 +1,29 @@ +import javax.swing.*; +import java.awt.*; + +public class Contingences { + public static void main(String[] args) { + JFrame fenetre = new JFrame(); + + fenetre.setSize(500, 300); + fenetre.setLocation(0, 0); + fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + + JTextField myTextField = new JTextField("Hello World!"); + myTextField.setBackground(Color.GRAY); + myTextField.setForeground(new Color(0, 255, 0)); + fenetre.add(myTextField, BorderLayout.SOUTH); + + JTextArea myTextArea = new JTextArea("Hello World!"); + myTextArea.setBackground(Color.BLACK); + myTextArea.setForeground(new Color(0, 255, 0)); + myTextArea.setLineWrap(true); + + JScrollPane myPane = new JScrollPane(myTextArea); + myPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED); + myPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED); + fenetre.add(myPane, BorderLayout.CENTER); + + fenetre.setVisible(true); + } +} \ No newline at end of file diff --git a/APL2.1/TP02/Saisie/Saisie.java b/APL2.1/TP02/Saisie/Saisie.java new file mode 100644 index 0000000..0006919 --- /dev/null +++ b/APL2.1/TP02/Saisie/Saisie.java @@ -0,0 +1,24 @@ +import javax.swing.*; +import java.awt.*; + +public class Saisie { + public static void main(String[] args) { + JFrame fenetre = new JFrame(); + + fenetre.setSize(500, 300); + fenetre.setLocation(0, 0); + fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + + JTextField MyTextField = new JTextField("Hello World!"); + MyTextField.setBackground(Color.GRAY); + MyTextField.setForeground(new Color(0, 255, 0)); + fenetre.add(MyTextField, BorderLayout.SOUTH); + + JTextArea MyTextArea = new JTextArea("Hello World!"); + MyTextArea.setBackground(Color.BLACK); + MyTextArea.setForeground(new Color(0, 255, 0)); + fenetre.add(MyTextArea, BorderLayout.CENTER); + + fenetre.setVisible(true); + } +} \ No newline at end of file diff --git a/APL2.1/TP02/Sirocco/Sirocco.java b/APL2.1/TP02/Sirocco/Sirocco.java new file mode 100644 index 0000000..f54a41b --- /dev/null +++ b/APL2.1/TP02/Sirocco/Sirocco.java @@ -0,0 +1,22 @@ +import javax.swing.*; +import java.awt.*; + +public class Sirocco { + public static void main(String[] args) { + // un objet pour servir de fenetre + JFrame fenetre = new JFrame(); + // on configure la fenetre + fenetre.setSize(500, 300); + fenetre.setLocation(0, 0); + fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + // un composant pour afficher du texte + JLabel etiquette = new JLabel("Bonjour !"); + // on configure l'etiquette + etiquette.setHorizontalAlignment(JLabel.RIGHT); + etiquette.setVerticalAlignment(JLabel.BOTTOM); + // on ajoute le composant dans la fenetre, au milieu + fenetre.add(etiquette, BorderLayout.CENTER); + // et on montre le resultat + fenetre.setVisible(true); + } +} \ No newline at end of file diff --git a/APL2.1/TP03/Damier/Damier.class b/APL2.1/TP03/Damier/Damier.class new file mode 100644 index 0000000000000000000000000000000000000000..5eb3feb9655b1f623e782422132a4a53118a0322 GIT binary patch literal 1065 zcmZ`&OHUI~6#g!q>80%e1uTjc5D;x^p$Z7{5QUaUO#u@Kq`EMdb}WPKOf#K|u=ZED zbi-N~t&zkZp#R0ai4o78qCkR^%$ak~`OfRRXTJUZ@)f`&(tcb)pC32T&oR)9K|egW zCB={wx23ql5%I%^s650t?)ssj&xbgMr8Xk9g!J8$;y%Y9$0&n$)-Vlcj=>X&ZZRlH zE3Y%OWeihatCn_jdsFNb$)c2mVKQ_@US#&f8<8jqvyj+uY{M+f$iS8jN910win5F6 z7-R5nSXDcxFBvjEkP;^1Ve|ky-ig1DOcj@k}XPv_crhnI;r6y zrZh}TF@sr#PPYZI?Ul0~bcua|ZE)TKmRyiej?0vN)l)g>_v+o~`H_2}ME z>p#+xR?(uqm1K5)jb?AOEQ4If3|%HAU7+hM*jCld6Bp+aH!!kQb$cbfxk#HM@`Q<9 zz?90CshiGB^nCKaMp_Ljuw_(?#%e{LN4LY*>AuNtd^eI$ig zA?bCE3N3s$u9GgIKcJ8uIE;BlKci{(7@lm0Qir-44+lqgxHSoB%hUR1V zvf*$Y{mq9-47T$hL)|PWm*j>YWY1{yVXx-GKt*1+cN literal 0 HcmV?d00001 diff --git a/APL2.1/TP03/Damier/Damier.java b/APL2.1/TP03/Damier/Damier.java new file mode 100644 index 0000000..873dad7 --- /dev/null +++ b/APL2.1/TP03/Damier/Damier.java @@ -0,0 +1,24 @@ +import javax.swing.*; +import java.awt.*; + +public class Damier { + public static void main(String[] args) { + int size = Integer.parseInt(args[0]); + + JFrame fenetre = new JFrame("Damier"); + fenetre.setSize(size * 50, size * 50); + fenetre.setLocation(100, 100); + fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + GridLayout grid = new GridLayout(size, size); + fenetre.setLayout(grid); + + for (int i = 0; i < size * size; i++) { + JPanel panel = new JPanel(); + if (i % 2 == 0) panel.setBackground(Color.CYAN); + else panel.setBackground(Color.WHITE); + fenetre.add(panel); + } + + fenetre.setVisible(true); + } +} \ No newline at end of file diff --git a/APL2.1/TP03/Question/Question.class b/APL2.1/TP03/Question/Question.class new file mode 100644 index 0000000000000000000000000000000000000000..749fecdd757be1591d244719f8a0e2bbe6cda9e7 GIT binary patch literal 1009 zcmZuw+foxj5IqB%>=J?`3kd{KgEtbA5b=gw6d@ReiV0RMs)A3OWQ3uTU1~2NJo%#k z<4aOys(iNm2tUQLXM-iB>_d0Y^f|rVXJ&r<`uYvPB3^}X6}MH~(Qr3}0nAF1k|r(9 zoQjNwtcqL+8s??RtGE}!h$Jm&xF5nOW;Hy}@KD7g4Uc7RQF0eGJdu7$#j=VOhTy6& zh5L+QFqPhAPzqL)GmMsm$;)25&h58Gy+u1p+Yly0JoT=0XdD~)mSOJatFA4~{S`?J zRV~kM@S>35kvAT9Tw$5>5*x-et}*B`{*ZT0h?3tf+D4m@!A+wrxGf>8VLZjNFxI4b zj`e>TC8N$;3=`|3&Chbjmggi}+(|YL1UH@J8pG7ZA5`UU3YO`(hUq%8{ze#u|Eum8 zrmQ-4k-NR&xvoXi4puxtwk%_%T;17Wh)H1HIC1kEmfhrb$vCwK{n`bDi}hN zsD0>9C{QW)xrc$8KG=m)%0yW_F{7tLa087=E3lb-0I-S{GN! zJ&e}$NEgv%#Se8E2K;bLhQVAy(PJINbBVyY5BffnlWroD)hDG>I!OHOwTP(SafrGb zr$;wUUC$tlEIqCTdT~pL(CJ4}fsQ>w)DgoW;;=D^QzY<_r1?bRFx;d%1Gx1Y=t10> literal 0 HcmV?d00001 diff --git a/APL2.1/TP03/Question/Question.java b/APL2.1/TP03/Question/Question.java new file mode 100644 index 0000000..575311e --- /dev/null +++ b/APL2.1/TP03/Question/Question.java @@ -0,0 +1,28 @@ +import javax.swing.*; +import java.awt.*; + +public class Question { + public static void main(String[] args) { + JFrame fenetre = new JFrame("Damier"); + fenetre.setSize(300, 200); + fenetre.setLocation(100, 100); + fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + + + JLabel question = new JLabel("Aimez-vous les chiens ?", SwingConstants.CENTER); + question.setVerticalAlignment(SwingConstants.BOTTOM); + + JPanel buttonPanel = new JPanel(); + JButton yes = new JButton("Oui"); + JButton no = new JButton("Non"); + JButton noAnswer = new JButton("NSPP"); + + buttonPanel.add(yes, BorderLayout.CENTER); + buttonPanel.add(no, BorderLayout.CENTER); + buttonPanel.add(noAnswer, BorderLayout.CENTER); + + fenetre.add(buttonPanel, BorderLayout.CENTER); + fenetre.add(question, BorderLayout.NORTH); + fenetre.setVisible(true); + } +} \ No newline at end of file