GoConqr has a new look! Let us know what you think.

Quiz

Encuentra el error

Tefa Yanez 3 questions Updated 19 Feb 2016

Take the quiz

Questions in this quiz (3)

  1. 1import java.awt.*;
    public class RectangleAreaCalculator extends JFrame
    {
    private static final int HEIGHT = 400; // Representa al alto de la ventana
    private static final int WIDTH = 700; // Representa al ancho de la ventana

    public RectangleAreaCalculator()
    {
    setTitle(“Rectangle Area Calculator”);
    setSize(WIDTH, HEIGHT);
    setVisible(true);
    setDefaultCloseOperation(EXIT_ON_CLOSE);
    }

    }
    1. AFalta la clase JFrame
    2. BFalta importar librería "import javax.swing.JFrame;"
    3. CLa visibilidad no se encuentra activada
  2. 2import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;

    public class HolaMundoSwing {

    JFrame frame = new JFrame("HolaMundoSwing");
    final JLabel label = new JLabel("Hola Mundo");
    frame.getContentPane().add(label);

    //frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    frame.addWindowListener(new java.awt.event.WindowAdapter(){
    public void windowClosing(WindowEvent e){
    System.exit(0);
    }
    }
    );

    frame.pack();
    frame.setVisible(true);
    }
    }
    1. AFalta declaración de main
    2. BFalta declaración de Librerías
    3. CSin parámetro
  3. 3package area;

    import javax.swing.*;

    import java.awt.event.*;

    import java.awt.*;

    public class arearec extends JFrame {
    private JLabel lengthLabel, widthLabel, areaLabel;

    private JTextField lengthText, widthText, areaText;

    private JButton calculateButton, exitButton;
    private static final int HEIGHT = 400;

    private static final int WIDTH = 700;
    1. AFalta la extensión JFrame
    2. BFalta especificar el ancho de la ventana principal.
    3. CFalta la declaración del Botón de Salida

Information

Description
Seleccione los posibles errores que presentan cada código
Language
Español
Views
6
History
Created on 8 Feb 2015 · updated on 19 Feb 2016
Rating
No ratings yet
Rate this quiz
Rate this quiz

Feedback

What is it about?

What do you think of the new look?

How do you like it?