private MainPanel() { super(); JLabel label = new JLabel(new DragHereIcon()); label.setText("<html>Drag <b>Files</b> Here"); label.setVerticalTextPosition(SwingConstants.BOTTOM); label.setHorizontalTextPosition(SwingConstants.CENTER); label.setForeground(Color.GRAY); label.setFont(new Font(Font.SERIF, Font.PLAIN, 24)); label.setDropTarget( new DropTarget(label, DnDConstants.ACTION_COPY, new FileDropTargetAdapter(), true)); // Test: label.setTransferHandler(new FileTransferHandler()); add(label); setPreferredSize(new Dimension(320, 240)); }
public Pregunta13(int s) { this.s = s; pregunta = 13; setLayout(null); setBounds(150, 5, 1080, 720); preguntinis = "13. Es una caracteristica del socialismo:"; resp13 = new String[4]; resp13[0] = "Comercio controlado por el sector privado"; resp13[1] = "Comercio controlado por el Gobierno"; resp13[2] = "Diferencias de clases sociales"; resp13[3] = "El empleo es bien pagado"; opc1 = new JButton(resp13[0]); opc1.setBounds(50, 300, 290, 30); opc1.addActionListener(this); add(opc1); opc2 = new JButton(resp13[1]); opc2.setBounds(50, 350, 290, 30); opc2.addActionListener(this); add(opc2); opc3 = new JButton(resp13[2]); opc3.setBounds(50, 400, 290, 30); opc3.addActionListener(this); add(opc3); opc4 = new JButton(resp13[3]); opc4.setBounds(50, 450, 290, 30); opc4.addActionListener(this); add(opc4); titulo = new JLabel(preguntinis, SwingConstants.CENTER); titulo.setFont(new Font("Century Ghotic", Font.BOLD, 20)); titulo.setBounds(0, 90, 1080, 50); titulo.setHorizontalTextPosition(SwingConstants.CENTER); add(titulo); puntua = new JLabel("Score: " + s); puntua.setFont(new Font("Century Ghotic", Font.BOLD, 17)); puntua.setBounds(910, 600, 1080, 50); add(puntua); salir = new JButton("Salir"); salir.setBounds(50, 610, 100, 30); salir.addActionListener(this); add(salir); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); fondo = new JLabel(); ImageIcon icon = new ImageIcon(getClass().getResource("/imagenes/imagen.jpg")); fondo.setIcon(icon); fondo.setBounds(0, 0, 1080, 720); add(fondo); setVisible(true); }
public Pregunta15(int s) { this.s = s; pregunta = 15; setLayout(null); setBounds(150, 5, 1080, 720); preguntinis = "15. Durante la segunda guerra mundial, ¿Cuál de los siguientes paises pertenecia a los paises aliados?"; resp15 = new String[4]; resp15[0] = "Francía"; resp15[1] = "Alemania"; resp15[2] = "México"; resp15[3] = "Italia"; opc1 = new JButton(resp15[0]); opc1.setBounds(50, 300, 290, 30); opc1.addActionListener(this); add(opc1); opc2 = new JButton(resp15[1]); opc2.setBounds(50, 350, 290, 30); opc2.addActionListener(this); add(opc2); opc3 = new JButton(resp15[2]); opc3.setBounds(50, 400, 290, 30); opc3.addActionListener(this); add(opc3); opc4 = new JButton(resp15[3]); opc4.setBounds(50, 450, 290, 30); opc4.addActionListener(this); add(opc4); titulo = new JLabel(preguntinis, SwingConstants.CENTER); titulo.setFont(new Font("Century Ghotic", Font.BOLD, 20)); titulo.setBounds(0, 90, 1080, 50); titulo.setHorizontalTextPosition(SwingConstants.CENTER); add(titulo); puntua = new JLabel("Score: " + s); puntua.setFont(new Font("Century Ghotic", Font.BOLD, 17)); puntua.setBounds(910, 600, 1080, 50); add(puntua); salir = new JButton("Salir"); salir.setBounds(50, 610, 100, 30); salir.addActionListener(this); add(salir); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); fondo = new JLabel(); ImageIcon icon = new ImageIcon(getClass().getResource("/imagenes/imagen.jpg")); fondo.setIcon(icon); fondo.setBounds(0, 0, 1080, 720); add(fondo); setVisible(true); }
public Pregunta24(int s) { this.s = s; pregunta = 24; setLayout(null); setBounds(150, 5, 1080, 720); preguntinis = "24. ¿Cuál opción incluye los tres sectores sociales?"; resp24 = new String[4]; resp24[0] = "Agropecuario, Industrial y de Servicios"; resp24[1] = "Agropecuario, de Servicios y Comunicaciones"; resp24[2] = "Transporte, Comunicaciones y Sevicios"; resp24[3] = "Servicios, Comunicaciones y Cableado"; opc1 = new JButton(resp24[0]); opc1.setBounds(50, 300, 290, 30); opc1.addActionListener(this); add(opc1); opc2 = new JButton(resp24[1]); opc2.setBounds(50, 350, 290, 30); opc2.addActionListener(this); add(opc2); opc3 = new JButton(resp24[2]); opc3.setBounds(50, 400, 290, 30); opc3.addActionListener(this); add(opc3); opc4 = new JButton(resp24[3]); opc4.setBounds(50, 450, 290, 30); opc4.addActionListener(this); add(opc4); titulo = new JLabel(preguntinis, SwingConstants.CENTER); titulo.setFont(new Font("Century Ghotic", Font.BOLD, 20)); titulo.setBounds(0, 90, 1080, 50); titulo.setHorizontalTextPosition(SwingConstants.CENTER); add(titulo); puntua = new JLabel("Score: " + s); puntua.setFont(new Font("Century Ghotic", Font.BOLD, 17)); puntua.setBounds(910, 600, 1080, 50); add(puntua); salir = new JButton("Salir"); salir.setBounds(50, 610, 100, 30); salir.addActionListener(this); add(salir); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); fondo = new JLabel(); ImageIcon icon = new ImageIcon(getClass().getResource("/imagenes/imagen.jpg")); fondo.setIcon(icon); fondo.setBounds(0, 0, 1080, 720); add(fondo); setVisible(true); }
public void execute_TestCase2() throws Exception { setUndecorated(true); setRootPaneCheckingEnabled(false); setForeground(Color.BLACK); setBackground(Color.WHITE); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setBounds(100, 100, 774, 353); setLocationRelativeTo(null); setVisible(true); contentPane = new JPanel(); contentPane.setFocusCycleRoot(true); contentPane.setDebugGraphicsOptions(DebugGraphics.NONE_OPTION); contentPane.setBounds(new Rectangle(100, 100, 130, 100)); contentPane.setBackground(Color.WHITE); setContentPane(contentPane); contentPane.setLayout(null); JLabel lblEnterThePath = new JLabel("Select Path of Working Folder"); lblEnterThePath.setForeground(new Color(128, 128, 128)); lblEnterThePath.setFont(new Font("Tahoma", Font.BOLD, 11)); lblEnterThePath.setBackground(new Color(0, 0, 0)); lblEnterThePath.setBounds(63, 104, 187, 31); contentPane.add(lblEnterThePath); txtHello = new JTextField(); txtHello.setName(""); txtHello.setBounds(271, 104, 296, 31); txtHello.setEditable(false); contentPane.add(txtHello); txtHello.setColumns(10); JLabel lblSelectPathOf = new JLabel("Select Path of Configuration File"); lblSelectPathOf.setForeground(new Color(128, 128, 128)); lblSelectPathOf.setFont(new Font("Tahoma", Font.BOLD, 11)); lblSelectPathOf.setBounds(63, 149, 187, 28); contentPane.add(lblSelectPathOf); textField_1 = new JTextField(); textField_1.setBounds(271, 146, 296, 31); textField_1.setEditable(false); contentPane.add(textField_1); textField_1.setColumns(10); JLabel lblWelcomeToVitalhealth = new JLabel("Welcome to VitalHealth Test Automation Framework"); lblWelcomeToVitalhealth.setHorizontalTextPosition(SwingConstants.CENTER); lblWelcomeToVitalhealth.setForeground(new Color(128, 128, 128)); lblWelcomeToVitalhealth.setFont(new Font("Tahoma", Font.BOLD, 14)); lblWelcomeToVitalhealth.setHorizontalAlignment(SwingConstants.CENTER); lblWelcomeToVitalhealth.setBackground(Color.BLACK); lblWelcomeToVitalhealth.setBounds(191, 22, 465, 34); contentPane.add(lblWelcomeToVitalhealth); Button button = new Button("Browse"); button.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent arg0) { showOpenFileDialog(); } }); button.setForeground(Color.WHITE); button.setFont(new Font("Dialog", Font.BOLD, 12)); button.setBackground(new Color(51, 153, 255)); button.setBounds(573, 104, 113, 31); contentPane.add(button); Button button_1 = new Button("Browse"); button_1.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { showOpenFileDialog1(); } }); button_1.setForeground(Color.WHITE); button_1.setFont(new Font("Dialog", Font.BOLD, 12)); button_1.setBackground(new Color(51, 153, 255)); button_1.setBounds(573, 146, 113, 31); contentPane.add(button_1); Button button_2 = new Button("RUN TEST"); button_2.setForeground(Color.WHITE); button_2.setFont(new Font("Dialog", Font.BOLD, 12)); button_2.setBackground(new Color(30, 144, 255)); button_2.setBounds(63, 205, 623, 34); contentPane.add(button_2); Button button_3 = new Button("DOWNLOAD SAMPLE EXCEL WEB"); button_3.setActionCommand("DOWNLOAD SAMPLE EXCEL WEB"); button_3.setForeground(new Color(128, 128, 128)); button_3.setFont(new Font("Dialog", Font.BOLD, 12)); button_3.setBackground(Color.WHITE); button_3.setBounds(564, 309, 200, 34); contentPane.add(button_3); Button button_4 = new Button("DOWNLOAD SAMPLE EXCEL MOBILE"); button_4.setForeground(new Color(128, 128, 128)); button_4.setFont(new Font("Dialog", Font.BOLD, 12)); button_4.setBackground(Color.WHITE); button_4.setActionCommand("DOWNLOAD SAMPLE EXCEL MOBILE"); button_4.setBounds(23, 309, 227, 34); contentPane.add(button_4); JLabel icon = new JLabel(""); Image img = new ImageIcon(this.getClass().getResource("/VitalHealth.png")).getImage(); icon.setIcon(new ImageIcon(img)); icon.setBounds(23, 11, 173, 71); contentPane.add(icon); // L1 l1 = new L1(); L2 l2 = new L2(); button_4.addActionListener(new L1(Constants.Download_ExcelWeb, Constants.Excel_NameMobile)); button_3.addActionListener(new L1(Constants.Download_ExcelWeb, Constants.Excel_NameWeb)); button_2.addActionListener(l2); }