Create a class inherited from JFrame
and send it in another class with this code
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
JFrameEjemplo window = new JFrameEjemplo();
window.setVisible(true);
} catch (Exception e) {
JOptionPane.showMessageDialog(null, e.getMessage());
}
}
});
}
My question is related to whether it is necessary to incorporate all that code or only with this code it is necessary:
public static void main(String[] args) {
JFrameEjemplo window = new JFrameEjemplo();
window.setVisible(true);
}