Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package ayudantia;
- import java.awt.Graphics;
- import java.awt.Image;
- import javax.swing.ImageIcon;
- import javax.swing.JPanel;
- import java.awt.EventQueue;
- import javax.swing.JFrame;
- import javax.swing.JButton;
- import javax.swing.JLabel;
- import java.awt.event.ActionListener;
- import java.awt.event.ActionEvent;
- import java.awt.Color;
- import java.awt.Toolkit;
- public class adivina_quien {
- private JFrame frame;
- /**
- * Launch the application.
- */
- public static void main(String[] args) {
- EventQueue.invokeLater(new Runnable() {
- public void run() {
- try {
- adivina_quien window = new adivina_quien();
- window.frame.setVisible(true);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- });
- }
- /**
- * Create the application.
- */
- public adivina_quien() {
- initialize();
- }
- /**
- * Initialize the contents of the frame.
- */
- private void initialize() {
- frame = new JFrame();
- frame.setIconImage(Toolkit.getDefaultToolkit().getImage("C:\\Users\\JPRG\\Downloads\\simpsons\\The-Simpsons-Hit-Run-2-icon.png"));
- frame.getContentPane().setBackground(new Color(255, 255, 0));
- frame.setBounds(100, 100, 1280, 750);
- frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- frame.getContentPane().setLayout(null);
- final JLabel label = new JLabel("");
- label.setBounds(588, 0, 152, 210);
- label.setIcon(new ImageIcon("C:\\Users\\JPRG\\Downloads\\simpsons\\bart-simpson.png"));
- frame.getContentPane().add(label);
- final JLabel label_1 = new JLabel("");
- label_1.setBounds(165, 67, 46, 14);
- frame.getContentPane().add(label_1);
- final personaje p1 = new personaje("moe", true,false,false,false,false,false,true,label_1);
- final JLabel label_2 = new JLabel("");
- label_2.setBounds(252, 67, 46, 14);
- frame.getContentPane().add(label_2);
- final JLabel Label = new JLabel("New label");
- Label.setBounds(750, 0, 119, 210);
- Label.setIcon(new ImageIcon("C:\\Users\\JPRG\\Downloads\\simpsons\\abraham-simpson.png"));
- frame.getContentPane().add(Label);
- final JLabel lblNewLabel_1 = new JLabel("New label");
- lblNewLabel_1.setBounds(137, 463, 138, 210);
- lblNewLabel_1.setIcon(new ImageIcon("C:\\Users\\JPRG\\Downloads\\simpsons\\apu-nahasapeemapetilon.png"));
- frame.getContentPane().add(lblNewLabel_1);
- final JLabel label_3 = new JLabel("");
- label_3.setBounds(10, 477, 130, 209);
- label_3.setIcon(new ImageIcon("C:\\Users\\JPRG\\Downloads\\simpsons\\carl-carlson.png"));
- frame.getContentPane().add(label_3);
- final JLabel lblNewLabel_2 = new JLabel("New label");
- lblNewLabel_2.setBounds(307, 463, 119, 210);
- lblNewLabel_2.setIcon(new ImageIcon("C:\\Users\\JPRG\\Downloads\\simpsons\\castulo-smithers.png"));
- frame.getContentPane().add(lblNewLabel_2);
- final JLabel lblNewLabel_3 = new JLabel("New label");
- lblNewLabel_3.setBounds(480, 464, 73, 209);
- lblNewLabel_3.setIcon(new ImageIcon("C:\\Users\\JPRG\\Downloads\\simpsons\\cletus-del-roy.png"));
- frame.getContentPane().add(lblNewLabel_3);
- final JLabel lblNewLabel_4 = new JLabel("New label");
- lblNewLabel_4.setBounds(587, 463, 138, 204);
- lblNewLabel_4.setIcon(new ImageIcon("C:\\Users\\JPRG\\Downloads\\simpsons\\dr-julius-hilbbert.png"));
- frame.getContentPane().add(lblNewLabel_4);
- final JLabel lblNewLabel_5 = new JLabel("New label");
- lblNewLabel_5.setBounds(735, 463, 138, 205);
- lblNewLabel_5.setIcon(new ImageIcon("C:\\Users\\JPRG\\Downloads\\simpsons\\jefe-gorgory.png"));
- frame.getContentPane().add(lblNewLabel_5);
- final JLabel lblNewLabel_7 = new JLabel("New label");
- lblNewLabel_7.setBounds(971, 467, 119, 196);
- lblNewLabel_7.setIcon(new ImageIcon("C:\\Users\\JPRG\\Downloads\\simpsons\\lisa-simpson.png"));
- frame.getContentPane().add(lblNewLabel_7);
- final JLabel lblNewLabel_8 = new JLabel("New label");
- lblNewLabel_8.setBounds(1061, 479, 165, 172);
- lblNewLabel_8.setIcon(new ImageIcon("C:\\Users\\JPRG\\Downloads\\simpsons\\maggie-simpson.png"));
- frame.getContentPane().add(lblNewLabel_8);
- final JLabel lblNewLabel_9 = new JLabel("New label");
- lblNewLabel_9.setBounds(750, 243, 138, 188);
- lblNewLabel_9.setIcon(new ImageIcon("C:\\Users\\JPRG\\Downloads\\simpsons\\marge-simpson.png"));
- frame.getContentPane().add(lblNewLabel_9);
- final JLabel lblNewLabel_10 = new JLabel("New label");
- lblNewLabel_10.setBounds(866, 243, 130, 188);
- lblNewLabel_10.setIcon(new ImageIcon("C:\\Users\\JPRG\\Downloads\\simpsons\\milhouse-van-houten.png"));
- frame.getContentPane().add(lblNewLabel_10);
- final JLabel lblNewLabel_13 = new JLabel("New label");
- lblNewLabel_13.setBounds(853, 0, 143, 210);
- lblNewLabel_13.setIcon(new ImageIcon("C:\\Users\\JPRG\\Downloads\\simpsons\\patty-bouvier.png"));
- frame.getContentPane().add(lblNewLabel_13);
- final JLabel lblNewLabel_14 = new JLabel("New label");
- lblNewLabel_14.setBounds(975, -17, 152, 245);
- lblNewLabel_14.setIcon(new ImageIcon("C:\\Users\\JPRG\\Downloads\\simpsons\\reverendo-alegria.png"));
- frame.getContentPane().add(lblNewLabel_14);
- final JLabel lblNewLabel_15 = new JLabel("New label");
- lblNewLabel_15.setBounds(1115, 0, 130, 210);
- lblNewLabel_15.setIcon(new ImageIcon("C:\\Users\\JPRG\\Downloads\\simpsons\\selma-bouvier.png"));
- frame.getContentPane().add(lblNewLabel_15);
- final JLabel lblNewLabel_16 = new JLabel("New label");
- lblNewLabel_16.setBounds(602, 243, 138, 196);
- lblNewLabel_16.setIcon(new ImageIcon("C:\\Users\\JPRG\\Downloads\\simpsons\\troy-mcclure.png"));
- frame.getContentPane().add(lblNewLabel_16);
- JButton btnNewButton_13 = new JButton("Millhouse");
- btnNewButton_13.setBounds(894, 448, 89, 23);
- btnNewButton_13.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- if (lblNewLabel_10.isVisible()){
- lblNewLabel_10.setVisible(false);
- }else {
- lblNewLabel_10.setVisible(true);
- }
- }
- });
- frame.getContentPane().add(btnNewButton_13);
- JButton btnNewButton = new JButton("troy McClure");
- btnNewButton.setBounds(633, 448, 107, 23);
- btnNewButton.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent arg0) {
- if (lblNewLabel_16.isVisible()){
- lblNewLabel_16.setVisible(false);
- }else {
- lblNewLabel_16.setVisible(true);
- }
- }
- });
- frame.getContentPane().add(btnNewButton);
- JButton btnNewButton_1 = new JButton("abraham");
- btnNewButton_1.setBounds(760, 222, 89, 23);
- btnNewButton_1.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent arg0) {
- if (Label.isVisible()){
- Label.setVisible(false);
- }else {
- Label.setVisible(true);
- }
- }
- });
- frame.getContentPane().add(btnNewButton_1);
- JButton btnNewButton_2 = new JButton("Bart");
- btnNewButton_2.setBounds(633, 222, 89, 23);
- btnNewButton_2.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent arg0) {
- if (label.isVisible()){
- label.setVisible(false);
- }else {
- label.setVisible(true);
- }
- }
- });
- frame.getContentPane().add(btnNewButton_2);
- JButton btnNewButton_3 = new JButton("Marge");
- btnNewButton_3.setBounds(772, 448, 89, 23);
- btnNewButton_3.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent arg0) {
- if (lblNewLabel_9.isVisible()){
- lblNewLabel_9.setVisible(false);
- }else {
- lblNewLabel_9.setVisible(true);
- }
- }
- });
- frame.getContentPane().add(btnNewButton_3);
- JButton btnNewButton_4 = new JButton("Apu");
- btnNewButton_4.setBounds(165, 684, 89, 23);
- btnNewButton_4.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- if (lblNewLabel_1.isVisible()){
- lblNewLabel_1.setVisible(false);
- }else {
- lblNewLabel_1.setVisible(true);
- }
- }
- });
- frame.getContentPane().add(btnNewButton_4);
- JButton btnNewButton_5 = new JButton("Carl");
- btnNewButton_5.setBounds(32, 684, 89, 23);
- btnNewButton_5.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- if (label_3.isVisible()){
- label_3.setVisible(false);
- }else {
- label_3.setVisible(true);
- }
- }
- });
- frame.getContentPane().add(btnNewButton_5);
- JButton btnNewButton_6 = new JButton("Smitters");
- btnNewButton_6.setBounds(317, 684, 89, 23);
- btnNewButton_6.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- if (lblNewLabel_2.isVisible()){
- lblNewLabel_2.setVisible(false);
- }else {
- lblNewLabel_2.setVisible(true);
- }
- }
- });
- frame.getContentPane().add(btnNewButton_6);
- JButton btnNewButton_7 = new JButton("Cletus");
- btnNewButton_7.setBounds(480, 684, 89, 23);
- btnNewButton_7.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- if (lblNewLabel_3.isVisible()){
- lblNewLabel_3.setVisible(false);
- }else {
- lblNewLabel_3.setVisible(true);
- }
- }
- });
- frame.getContentPane().add(btnNewButton_7);
- JButton btnNewButton_8 = new JButton("Hibbert");
- btnNewButton_8.setBounds(617, 678, 89, 23);
- btnNewButton_8.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- if (lblNewLabel_4.isVisible()){
- lblNewLabel_4.setVisible(false);
- }else {
- lblNewLabel_4.setVisible(true);
- }
- }
- });
- frame.getContentPane().add(btnNewButton_8);
- JButton btnNewButton_9 = new JButton("GorGorY");
- btnNewButton_9.setBounds(745, 677, 89, 23);
- btnNewButton_9.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- if (lblNewLabel_5.isVisible()){
- lblNewLabel_5.setVisible(false);
- }else {
- lblNewLabel_5.setVisible(true);
- }
- }
- });
- final JLabel lblNewLabel_6 = new JLabel("New label");
- lblNewLabel_6.setBounds(856, 474, 105, 210);
- lblNewLabel_6.setIcon(new ImageIcon("C:\\Users\\JPRG\\Downloads\\simpsons\\lenny-leonard.png"));
- frame.getContentPane().add(lblNewLabel_6);
- frame.getContentPane().add(btnNewButton_9);
- JButton btnNewButton_10 = new JButton("Lenny");
- btnNewButton_10.setBounds(866, 678, 89, 23);
- btnNewButton_10.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- if (lblNewLabel_6.isVisible()){
- lblNewLabel_6.setVisible(false);
- }else {
- lblNewLabel_6.setVisible(true);
- }
- }
- });
- frame.getContentPane().add(btnNewButton_10);
- JButton btnNewButton_11 = new JButton("Lisa");
- btnNewButton_11.setBounds(1001, 677, 89, 23);
- btnNewButton_11.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- if (lblNewLabel_7.isVisible()){
- lblNewLabel_7.setVisible(false);
- }else {
- lblNewLabel_7.setVisible(true);
- }
- }
- });
- frame.getContentPane().add(btnNewButton_11);
- JButton btnNewButton_12 = new JButton("Maggie");
- btnNewButton_12.setBounds(1115, 677, 89, 23);
- btnNewButton_12.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- if (lblNewLabel_8.isVisible()){
- lblNewLabel_8.setVisible(false);
- }else {
- lblNewLabel_8.setVisible(true);
- }
- }
- });
- frame.getContentPane().add(btnNewButton_12);
- JButton btnNewButton_14 = new JButton("reverendo alegria");
- btnNewButton_14.setBounds(988, 222, 119, 23);
- btnNewButton_14.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- if (lblNewLabel_14.isVisible()){
- lblNewLabel_14.setVisible(false);
- }else {
- lblNewLabel_14.setVisible(true);
- }
- }
- });
- frame.getContentPane().add(btnNewButton_14);
- final JLabel lblNewLabel_12 = new JLabel("New label");
- lblNewLabel_12.setBounds(1107, 235, 119, 210);
- lblNewLabel_12.setIcon(new ImageIcon("C:\\Users\\JPRG\\Downloads\\simpsons\\montgomery-burns.png"));
- frame.getContentPane().add(lblNewLabel_12);
- JButton btnNewButton_15 = new JButton("SR. Burns");
- btnNewButton_15.setBounds(1137, 445, 89, 23);
- btnNewButton_15.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- if (lblNewLabel_12.isVisible()){
- lblNewLabel_12.setVisible(false);
- }else {
- lblNewLabel_12.setVisible(true);
- }
- }
- });
- frame.getContentPane().add(btnNewButton_15);
- final JLabel lblNewLabel_11 = new JLabel("New label");
- lblNewLabel_11.setBounds(1008, 242, 119, 210);
- lblNewLabel_11.setIcon(new ImageIcon("C:\\Users\\JPRG\\Downloads\\simpsons\\moe-szyslak.png"));
- frame.getContentPane().add(lblNewLabel_11);
- JButton btnNewButton_16 = new JButton("Moe");
- btnNewButton_16.setBounds(1018, 448, 89, 23);
- btnNewButton_16.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- if (lblNewLabel_11.isVisible()){
- lblNewLabel_11.setVisible(false);
- }else {
- lblNewLabel_11.setVisible(true);
- }
- }
- });
- frame.getContentPane().add(btnNewButton_16);
- JButton btnNewButton_17 = new JButton("paty");
- btnNewButton_17.setBounds(876, 221, 89, 23);
- btnNewButton_17.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- if (lblNewLabel_13.isVisible()){
- lblNewLabel_13.setVisible(false);
- }else {
- lblNewLabel_13.setVisible(true);
- }
- }
- });
- frame.getContentPane().add(btnNewButton_17);
- JButton btnNewButton_18 = new JButton("selma");
- btnNewButton_18.setBounds(1137, 221, 89, 23);
- btnNewButton_18.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- if (lblNewLabel_15.isVisible()){
- lblNewLabel_15.setVisible(false);
- }else {
- lblNewLabel_15.setVisible(true);
- }
- }
- });
- frame.getContentPane().add(btnNewButton_18);
- JButton btnHombre = new JButton("hombre");
- btnHombre.setForeground(Color.BLACK);
- btnHombre.addActionListener(new ActionListener() {
- @SuppressWarnings("deprecation")
- public void actionPerformed(ActionEvent arg0) {
- lblNewLabel_14.hide();
- lblNewLabel_16.hide();
- lblNewLabel_10.hide();
- lblNewLabel_11.hide();
- lblNewLabel_12.hide();
- lblNewLabel_6.hide();
- lblNewLabel_5.hide();
- lblNewLabel_4.hide();
- lblNewLabel_3.hide();
- lblNewLabel_2.hide();
- lblNewLabel_1.hide();
- label.hide();
- Label.hide();
- label_3.hide();
- }
- });
- btnHombre.setBounds(59, 361, 104, 36);
- frame.getContentPane().add(btnHombre);
- JButton btnMujer = new JButton("mujer");
- btnMujer.addActionListener(new ActionListener() {
- @SuppressWarnings("deprecation")
- public void actionPerformed(ActionEvent e) {
- lblNewLabel_7.hide();
- lblNewLabel_8.hide();
- lblNewLabel_9.hide();
- lblNewLabel_13.hide();
- lblNewLabel_15.hide();
- }
- });
- btnMujer.setBounds(191, 362, 107, 34);
- frame.getContentPane().add(btnMujer);
- JButton btnNewButton_19 = new JButton("reiniciar");
- btnNewButton_19.addActionListener(new ActionListener() {
- @SuppressWarnings("deprecation")
- public void actionPerformed(ActionEvent e) {
- lblNewLabel_7.show();
- lblNewLabel_8.show();
- lblNewLabel_9.show();
- lblNewLabel_13.show();
- lblNewLabel_15.show();
- lblNewLabel_14.show();
- lblNewLabel_16.show();
- lblNewLabel_10.show();
- lblNewLabel_11.show();
- lblNewLabel_12.show();
- lblNewLabel_6.show();
- lblNewLabel_5.show();
- lblNewLabel_4.show();
- lblNewLabel_3.show();
- lblNewLabel_2.show();
- lblNewLabel_1.show();
- label.show();
- Label.show();
- label_3.show();
- }
- });
- btnNewButton_19.setBounds(331, 361, 97, 36);
- frame.getContentPane().add(btnNewButton_19);
- JLabel lblNewLabel = new JLabel("New label");
- lblNewLabel.setBounds(10, 1, 521, 390);
- lblNewLabel.setIcon(new ImageIcon("C:\\Users\\JPRG\\Downloads\\simpsons\\clearart-145.png"));
- frame.getContentPane().add(lblNewLabel);
- }
- public Image getFrameIconImage() {
- return frame.getIconImage();
- }
- public void setFrameIconImage(Image iconImage) {
- frame.setIconImage(iconImage);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement