hola buenas pues he estaod intentando hacer una interfaz grafica en java y no lo consigo y nada no hay manera haber si alguien me echa una mano.
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author Alarcon
*/
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
//declaro los elementos de que voy a utilizar
// Concesionario owner;
//botones de accion
//etiquetas
//campo
//contenedore
//creamos los botones
// ButtonGroup union =new ButtonGroup();
// for(int i=0;i<tableNames.;i++){
//
// }
public DeleteRecordDialog(){
// super(owner,title,true);
// this.owner=owner;
//inicializamos los botones
cancelar
= new JButton("Cancelar"); mostrar
= new JButton("Mostrar Tabla");
//inicializamos etiquetas
tablas
= new JLabel("Tablas"); clPrimaria
= new JLabel("Clave Primaria:");
//inicializamos campo para recoger datos
//agregamos los contenedores
PN_Tablas.add(tablas);
PN_Recoger.add(clPrimaria);
PN_Recoger.add(key);
PN_Botones.add(aceptar);
PN_Botones.add(cancelar);
PN_Botones.add(mostrar);
getContentPane().add(PN_Tablas);
getContentPane().add(PN_Recoger);
getContentPane().add(PN_Botones);
setSize (320,200);
setVisible(true);
validate();
}
}
public static void main
(String arg
[]) { DeleteRecordDialog deleteRecordDialog = new DeleteRecordDialog();
}
}
y el error :
run:
Exception in thread "main" java.lang.NullPointerException
at DeleteRecordDialog.<init>(DeleteRecordDialog.java:59)
at DeleteRecordDialog.main(DeleteRecordDialog.java:83)
Java Result: 1
GENERACIÓN CORRECTA (total time: 2 seconds)