Oui ca marche merci pour votre aide
Actuellement Si Je vue faire l'inverse, a partir d'un button « B2» qui se trouve à JInternalFrame « Detail » je vue revenir à JInternalFrame « IUEmploye »
j'ai essayer cette Solution mais j'ai eu cette erreur
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at projet.TEST.jButton1ActionPerformed(TEST.java:90)
at projet.TEST.access$000(TEST.java:15)
at projet.TEST$1.actionPerformed(TEST.java:54)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
voici les deux class IUEmploye et Detail
/**************IUEmploye
import javax.swing.JDesktopPane;
publicclass IUEmploye extends javax.swing.JInternalFrame{
IUMenu menu;
Detail L;
public IUEmploye (){
initComponents();
}
public IUEmploye (IUMenu menu){
this.menu = menu;
try{
initComponents();
}
catch(SQLException ex){
System.out.println(ex.getMessage());
}
}
....
privatevoid jButton2ActionPerformed(java.awt.event.ActionEvent evt){
// TODO add your handling code here:
L = new Detail ();
menu.d.add(L);
try{
L.setSelected(true);
}
catch(PropertyVetoException ex){
Logger.getLogger(IUMenu.class.getName()).log(Level.SEVERE, null, ex);
}
L.setLocation(20, 10);
L.setVisible(true);
this.setVisible(false);
}
}
//******Detail
import java.beans.PropertyVetoException;
public class Detail extends javax.swing.JInternalFrame {
/** Creates new form Detail */
IUMenu m;
IUEmploye em;
public Detail () {
initComponents();
}
public Detail (IUMenu m) {
initComponents();
this.m = m;
}
private void B2(java.awt.event.ActionEvent evt) {
em = new IUEmploye ();
m.d.add(em);
try {
em.setSelected(true);
} catch (PropertyVetoException ex) {
}
em.setLocation(20, 10);
em .setVisible(true);
this.setVisible(false);
}