Warning when compiling form in Java

1

Hello, good night

Today I bring you a problem to see if you could help me with this warning that JCreator Pro gives me when compiling my Java program

Note: C:\Users\JosePadron\Documents\JCreator 
Pro\MyProjects\SistemaFacturacion\formularios\frmLogin.java uses or 
overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

Process completed.

frmLogin.java code

package formularios;

import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTextField;
import javax.swing.JPasswordField;
import javax.swing.JButton;
import javax.swing.ImageIcon;
import javax.swing.Icon;
import javax.swing.SwingConstants;

public class frmLogin extends JFrame {
//Componentes
private JLabel lblUsuario;
private JLabel lblClave;
private JLabel lblImagen;
private JTextField txtUsuario;
private JPasswordField txtClave;
private JButton btnAceptar;
private JButton btnCancelar;


public frmLogin() {
    //Colocamos propiedades del formulario
    setTitle("Ingreso al sistema");
    setLayout(null);
    setSize(390, 180);
    setResizable(false);
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    //Creacion de iconos
    Icon icoAceptar = new 
  ImageIcon(getClass().getResource("/images/aceptar.jpg"));
    Icon icoCancelar = new 
 ImageIcon(getClass().getResource("/images/cancelar.png"));
    Icon icoImagen = new ImageIcon(getClass().getResource("/images/ingreso.png"));

    //Creacion de objetos
    lblUsuario = new JLabel("Usuario:");
    txtUsuario = new JTextField(10);
    lblClave = new JLabel("Clave:");
    txtClave = new JPasswordField(10);
    lblImagen = new JLabel(icoImagen);
    btnAceptar = new JButton("Aceptar", icoAceptar);
    btnCancelar = new JButton("Cancelar", icoCancelar);


    //Adicionar objetos al formulario
    add(lblUsuario);
    add(txtUsuario);
    add(lblClave);
    add(txtClave);
    add(btnAceptar);
    add(btnCancelar);
    add(lblImagen);

    //Propiedades de los objetos
    btnAceptar.setHorizontalTextPosition(SwingConstants.CENTER);
    btnAceptar.setVerticalTextPosition(SwingConstants.BOTTOM);
    btnAceptar.setToolTipText("Ingresa al sistema");

    btnCancelar.setHorizontalTextPosition(SwingConstants.CENTER);
    btnCancelar.setVerticalTextPosition(SwingConstants.BOTTOM);
    btnCancelar.setToolTipText("Cancela la operacion de ingresar al sistema");

    //Colocar los objetos en el formulario
    lblUsuario.reshape(20, 20, 100, 20);
    txtUsuario.reshape(120, 20, 100, 20);
    lblImagen.reshape(240, 20, 128, 128);

    lblClave.reshape(20, 45, 100, 20);
    txtClave.reshape(120, 45, 100, 20);

    btnAceptar.reshape(20, 75, 90, 60);
    btnCancelar.reshape(120, 75, 90, 60);



}
}
    
asked by darioxlz 14.12.2017 в 00:36
source

1 answer

1

The culprit is the method reshape() , it is inadvisable to use it, instead of that you can use the setBounds() method that likewise receives 4 arguments.

    
answered by 14.12.2017 / 01:42
source