toufik3119
Messages postés8Date d'inscriptionvendredi 2 janvier 2009StatutMembreDernière intervention31 mai 2009
-
31 mai 2009 à 20:32
scriptiz
Messages postés1424Date d'inscriptiondimanche 21 décembre 2008StatutMembreDernière intervention14 septembre 2023
-
31 mai 2009 à 22:04
Bonjour,
voila j'ai un probleme avec la manipulation des fichier sous java ,
je suis entrain de creé un iditeur UML (pour constuir des diagramme).
pour chaque activité il faut que le programme récupére des information et les enregistrer dans un fichier object ;
,et j'ai creé une botton pour modifier les information d'une activité , pour cela il faux récuperé les information déja donné et les modifié ,
voila la classe pour récupéré les information :
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.Serializable;
}
public void setnom(String a){ nom.setText(a);};
public void setcap(String a){ capa.setText(a);};
public void setsour(String a){ source.setText(a);};
public void setinfo(String a){ info.setText(a);};
public String getnom(){ return nom.getText();}
public String getcap(){ return capa.getText();}
public String getsour(){ return source.getText();}
public String getinfo(){ return info.getText();}
public boolean getact(){ return act;}
public String toString(){return inf;}
}
pour enregisté cette objet j'ai fait ca dans la classe main :
ObjectOutputStream oos;
try {
oos = new ObjectOutputStream(
new BufferedOutputStream(
new FileOutputStream(
new File("info.txt"))));
}
et voila l'erreur qui se pose quand je clic sur modifier:
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at propo.getnom(propo.java:170)
at modifier.actionPerformed(modifier.java:42)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
stp si quelq'un peut m'aidé n'ésite pas ...
merci.
scriptiz
Messages postés1424Date d'inscriptiondimanche 21 décembre 2008StatutMembreDernière intervention14 septembre 2023425 31 mai 2009 à 22:04
Ce serait tellement gentil de mettre ton code entre <code> et </code > afin que tout le monde puisse profiter de ton indentation et de la lisibilité de celui-ci.