2 things. The first: I don't know how to program in Java and I'm following it as a kind of guide but the one who made that guide wrote the code with many errors and I have had to fix it by searching forums and things like that. The detail is that a JFrame was created and the code to be placed was explained, but the JFrame has so many functions that it did not specify exactly where the code goes. Is this
persona p;
private void formWindowOpened(java.awt.event.WindowEvent evt) {
//Obejeto para almacenar datos
Object[][] dtPer;
String[] columNames = {"id", "Nombre", "Ap. Paterno", "Ap. Materno", "E-Mail"};
//se utiliza la función
dtPer = p.getDatos();
//Se colocan los datos en la tabla
DefaultTableModel datos = new DefaultTableModel(dtPer, columNames);
tabla.setModel(datos);
}
Where exactly does it go? and you're passing parameters and you also didn't specify what they're for since "evt" isn't being used.
The second: I have this JFrame in a different package than where I have the Main class. How do I call that JFrame from the Main so that it is executed?
As I can see in the code you share, you are accessing a JFrame event that is executed only when it starts, to access this event you must: Right click on Jframe >> Events >> Window >> WindowOpened (I add image)
To display a view from main you must import the package and the view class:
import paquete.clase;
To display it you must create a view object and use the setVisible() function, or simply define it as the main view.