Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void readFile(){
- try {
- Scanner output=new Scanner(cakeDetalies);
- while(output.hasNext()){
- c[i]=new cake();
- String s=output.next();
- c[i].setName(s);
- s=output.next();
- c[i].setQuantity(Integer.parseInt(s));
- s=output.next();
- c[i].setPrice(Integer.parseInt(s));
- list.addElement(c[i].name);
- i++;
- }
- } catch (FileNotFoundException ex) {
- Logger.getLogger(client.class.getName()).log(Level.SEVERE, null, ex);
- }
- }
- void writeFile(int size){
- try {
- iutput = new PrintWriter("cakeDetalies.txt");
- for(int i=0;i<size;i++)
- iutput.println(c[i].getProduct());
- iutput.close();
- } catch (FileNotFoundException ex) {
- }
- }
- void initializeList(int size){
- try {
- iutput = new PrintWriter(cakeDetalies);
- } catch (FileNotFoundException ex) {
- Logger.getLogger(client.class.getName()).log(Level.SEVERE, null, ex);
- }
- for(int i=0;i<size;i++){
- list.addElement(c[i].getName());
- iutput.println(c[i].getProduct());
- }
- iutput.close();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement