Can Someone please help i need to create a GUI out of this code for 24hours from now.
Can someone please send me the code to create this gui. Its all coded in notepad. Thanks
ScubaSam
-3
Newbie Poster
public class Appointment
{
protected String datum;
protected String tyd;
protected String plek;
protected String naam;
protected String deskripsie;
public int icount = 0;
public Appointment()
{
this("","","","","");
}
public Appointment(String datum, String tyd, String plek, String naam, String deskripsie)
{
this.datum = datum;
this.tyd = tyd;
this.plek = plek;
this.naam = naam;
this.deskripsie = deskripsie;
}
public void setDatum(String sdtm)
{
this.datum = datum;
}
public void setTyd(String std)
{
this.tyd = tyd;
}
public void setPlek(String splk)
{
this.plek = plek;
}
public void setNaam(String snm)
{
this.naam = naam;
}
public void setDeskripsie(String sdes)
{
this.deskripsie = deskripsie;
}
public String getdatum()
{
return datum;
}
public String gettyd()
{
return tyd;
}
public String getplek()
{
return plek;
}
public String getnaam()
{
return naam;
}
public String getdeskripsie()
{
return deskripsie;
}
public String vertel()
{
return "\n" + " AFSPRAAK" + "\n" + "\n" + "Datum : " + datum + "\n" + "Tyd : " + tyd + "\n" + "Plek : " + plek + "\n" + "Naam : " + naam + "\n" + "Deskripsie : " + deskripsie + "\n";
}
public static void main(String args[])
{
Appointment p1 = new Appointment("19 September 2011","9 uur","6 Tarentaal Ln","Gert Fourie","Uiteensetting van Besigheid");
System.out.println(p1.vertel());
}
}
public class BusinessContact extends Kontak
{
private String faxNo;
private String companyNaam;
private String posisie;
public BusinessContact(String nNaam, String nTelno, String nEpos, String nAdres, String nCompanyNaam, String nPosisie, String nFaxNo)
{
super(nNaam, nTelno, nEpos, nAdres);
faxNo = nFaxNo;
companyNaam = nCompanyNaam;
posisie = nPosisie;
}
public BusinessContact()
{
super("","","","");
faxNo = "";
companyNaam = "";
posisie = "";
}
public String getFaxNo()
{
return faxNo;
}
public String getCompanyNaam()
{
return companyNaam;
}
public String getPosisie()
{
return posisie;
}
public void setFaxNo(String nFaxNo)
{
faxNo = nFaxNo;
}
public void setCompanyNaam(String nCompanyNaam)
{
companyNaam = nCompanyNaam;
}
public void setPosisie(String nPosisie)
{
posisie = nPosisie;
}
public String getContactDetails()
{
String detail = "";
detail += "Company: " + companyNaam + "\n";
detail += "Posisie: " + posisie + "\n";
detail += "Tel nommer: " + super.getTelNo();
return detail;
}
public String toString()
{
String result = "";
result += super.toString();
result += "\n" + "Fax nommer: " + faxNo + "\n";
result += "Company Naam: " + companyNaam + "\n";
result += "Posisie: " + posisie;
return result;
}
public static void main(String[]args)
{
BusinessContact obj1 = new BusinessContact("Martin Louw","0844012567","louwmartin@yahoo.com","Lategan 18","ABSA","IT Developer","0384993749");
System.out.println(obj1.toString());
System.out.println("\n" + "Details after set methods" + "\n");
System.out.println(obj1.toString());
}
}
public abstract class Kontak
{
private String Naam;
private String Telno;
private String epos;
private String Adres;
public Kontak(String nm, String tel, String pos, String ad)
{
Naam = nm;
Telno = tel;
epos = pos;
Adres = ad;
}
public Kontak()
{
this("","","","");
}
public void setNaam(String nm)
{
Naam = nm;
}
public void setTelNo(String tl)
{
Telno = tl;
}
public void setePos(String ep)
{
epos = ep;
}
public void setAdres(String ad)
{
Adres = ad;
}
public String getNaam()
{
return Naam;
}
public String getTelNo()
{
return Telno;
}
public String getePos()
{
return epos;
}
public String getAdres()
{
return Adres;
}
public String toString()
{
return "\nNaam : " + Naam + " Tel No : " + Telno + " E-pos : " + epos ; //+ "\n" + "Adres : " + Adres + "\n";
}
public abstract String getContactDetails();
public static void main(String[] args)
{
// Kontak k1 = new Kontak();
// Kontak k2 = new Kontak("William","0729288750","Williamshaw@Ymail.com","7de laan ");
// System.out.println(k1);
// System.out.println(k2);
}
}
import java.util.Scanner;
public class Organiser
{
public String naam = "";
public static int count = 0;
public PersonalContact[] pPcon = new PersonalContact[50];
public static Kontak[] kontak = new Kontak[50];
public static Appointment[] pApp = new Appointment[50];
// public static Appointment app = new Appointment();
public static Scanner input = new Scanner(System.in);
public void addcon()
{
System.out.println("\nNaam: ");
String nNaam = input.next();
System.out.println("\nTelefoon nommer: ");
String nTelno = input.next();
System.out.println("\nEpos: ");
String nEpos = input.next();
System.out.println("\nAdres: ");
String nAdres = input.next();
System.out.println("\nHuisno: ");
String nHuisno = input.next();
System.out.println("\nVerjaarsdag: ");
String nVerjaarsdag = input.next();
PersonalContact naam = new PersonalContact(nNaam,nTelno,nEpos,nAdres,nHuisno,nVerjaarsdag);
pPcon[count] = naam;
count++;
}
public String Search()
{
System.out.println("\nNaam: ");
String nNaam = input.next();
String details = "";
for(int i=0; i<pPcon.length;i++)
{
if(pPcon[i]!= null && nNaam.equals(pPcon[i].getNaam()))
{
details = pPcon[i].toString();
}
}
if(!details.equals(""))
{
return details;
}
else
{
return "Geen so kontak nie";
}
}
public void delete()
{
System.out.println("\nNaam: ");
String nNaam = input.next();
boolean rem = false;
for(int i=0; i<pPcon.length;i++)
{
if(pPcon[i]!= null && nNaam.equals(pPcon[i].getNaam()))
{
pPcon[i] = null;
System.out.println(nNaam+" removed");
rem = true;
}
}
if(rem == false)
{
System.out.println("Geen so kontak nie");
}
}
public void edit()
{
System.out.println("\nNaam: ");
String nNaam = input.next();
int keuse = 0;
for(int i=0; i<pPcon.length;i++)
{
if(pPcon[i]!= null && nNaam.equals(pPcon[i].getNaam()))
{
System.out.println("\n1. Naam");
System.out.println("2. Telefoon Nommer");
System.out.println("3. Epos");
System.out.println("4. Adres");
System.out.println("5. Huisno");
System.out.println("6. Verjaarsdag");
keuse = input.nextInt();
switch(keuse)
{
case 1: System.out.print("Enter new name :");
pPcon[i].setNaam(input.next());
System.out.println("Name changed");
break;
case 2: System.out.print("Enter new phone number :");
pPcon[i].setTelNo(input.next());
System.out.println("Number changed");
break;
case 3: System.out.print("Enter new email:");
pPcon[i].setEpos(input.next());
System.out.println("Email changed");
break;
case 4: System.out.print("Enter new Adres:");
pPcon[i].setAdres(input.next());
System.out.println("Adres changed");
break;
case 5: System.out.print("Enter new Home number:");
pPcon[i].setHuisNo(input.next());
System.out.println("Home Number changed");
break;
case 6: System.out.print("Enter new Birthday:");
pPcon[i].setVerjaarsdag(input.next());
System.out.println("Birthday changed");
break;
}
}
}
}
public void edita()
{
System.out.println("\nNaam: ");
String Naama = input.next();
int keusea = 0;
for(int j=0; j<pApp.length;j++)
{
if(pApp[j]!= null && Naama.equals(pApp[j].getnaam()))
{
System.out.println("\n1. Datum");
System.out.println("2. Tyd");
System.out.println("3. Plek");
System.out.println("4. Naam");
System.out.println("5. Deskripsie");
keusea = input.nextInt();
switch(keusea)
{
case 1: System.out.print("Enter Date :");
pApp[j].setDatum(input.next());
System.out.println("Date changed");
break;
case 2: System.out.print("Enter new Time :");
pApp[j].setTyd(input.next());
System.out.println("Time changed");
break;
case 3: System.out.print("Enter Place:");
pApp[j].setPlek(input.next());
System.out.println("Place changed");
break;
case 4: System.out.print("Enter Name:");
pApp[j].setNaam(input.next());
System.out.println("Name changed");
break;
case 5: System.out.print("Enter new Description:");
pApp[j].setDeskripsie(input.next());
System.out.println("Description changed");
break;
}
}
}
}
public void addApp()
{
System.out.println("\ndatum: ");
String Datum = input.next();
System.out.println("\ntyd: ");
String tyd = input.next();
System.out.println("\nplek: ");
String plek = input.next();
System.out.println("\nnaam: ");
String naam = input.next();
System.out.println("\ndeskripsie: ");
String deskripsie = input.next();
Appointment a = new Appointment(Datum,tyd,plek,naam,deskripsie);
pApp[count] = a;
count++;
}
public void deletea()
{
System.out.println("\nNaam: ");
String naam = input.next();
boolean rem = false;
for(int i=0; i<pApp.length;i++)
{
if(pApp[i]!= null && naam.equals(pApp[i].getnaam()))
{
pApp[i] = null;
System.out.println(naam+" removed");
rem = true;
}
}
if(rem == false)
{
System.out.println("Geen so Afspraak nie");
}
}
public String toString()
{
String all = "";
int tel = 0;
/* for(int k=0; k< pPcon.length; k++)
{
if(pPcon[k]!=null)
{
tel++;
}
}*/
for(int i=0;i<pPcon.length;i++)
{
if(pPcon[i]!= null)
all += pPcon[i].toString();
}
return all;
}
public static void main(String[]args)
{
Organiser myOrg = new Organiser();
Scanner input = new Scanner(System.in);
int keuse = 0;
while(true)
{
System.out.println("\n1. Add new contact");
System.out.println("2. Search addressbook");
System.out.println("3. Remove contact from addressbook");
System.out.println("4. Change details of a contact");
System.out.println("5. Add new appointment");
System.out.println("6. Remove Appointment");
System.out.println("7. Change Appointment");
System.out.println("8. Save");
System.out.println("9. Load");
System.out.println("10. Exit");
int i = input.nextInt();
if ( i == 1 )
myOrg.addcon();
if ( i == 2 )
myOrg.Search();
if ( i == 3 )
myOrg.delete();
if ( i == 4 )
myOrg.edit();
if ( i == 5 )
myOrg.addApp();
if ( i == 6 )
myOrg.deletea();
if ( i== 7 )
myOrg.edita();
if (i == 9 )
{
WriteFileCon write = new WriteFileCon();
WriteFileAppoint write2 = new WriteFileAppoint();
write.insertInfo(kontak,count);
write2.insertInfo(pApp, count);
}
if (i == 10 )
{
ReadFileCon read = new ReadFileCon();
ReadFileAppoint read2 = new ReadFileAppoint();
kontak = read.retrieveInfo();
count = read.iCount;
pApp = read2.retrieveInfo();
count = read2.iCount;
}
}
}
}
public class PersonalContact extends Kontak
{
private String huisNo;
private String verjaarsdag;
public PersonalContact(String nNaam, String nTelno, String nEpos, String nAdres, String nHuisNo, String nVerjaarsdag)
{
super(nNaam, nTelno, nEpos, nAdres);
verjaarsdag = nVerjaarsdag;
huisNo = nHuisNo;
}
public PersonalContact()
{
super("","","","");
verjaarsdag = "";
huisNo = "";
}
public String getNaam()
{
return super.getNaam();
}
public void setNaam(String naam)
{
super.setNaam(naam);
}
public void setTelNo(String tel)
{
super.setTelNo(tel);
}
public void setEpos(String epos)
{
super.setePos(epos);
}
public String getHuisNo()
{
return huisNo;
}
public String getVerjaarsdag()
{
return verjaarsdag;
}
public void setHuisNo(String nHuisNo)
{
huisNo = nHuisNo;
}
public void setVerjaarsdag(String nVerjaarsdag)
{
verjaarsdag = nVerjaarsdag;
}
public String getContactDetails()
{
String details;
details = "Huis nommer: " + huisNo;
details += "\n" + "Tel nommer: " + getTelNo();
return details;
}
public String toString()
{
String result = "";
result += super.toString();
//result += "\n" + "Huis nommer: " + huisNo + "\n";
//result += "Verjaarsdag: " + verjaarsdag;
return result;
}
/*public static void main(String[]args)
{
PersonalContact obj1 = new PersonalContact("William shaw","0843846332","Williamshaw@ymail.com","7de laan","10","11-01");
System.out.println(obj1.toString());
System.out.println("\n" + "Details after set methods" + "\n");
System.out.println(obj1.toString());
}*/
}
import java.io.*;
import java.util.*;
public class ReadFileAppoint
{
private ObjectInputStream input;
public int iCount = 0;
public Appointment[] readRecord()
{
Appointment[] rekord = new Appointment[50];
try
{
input = new ObjectInputStream(new FileInputStream("Appointments.ser"));
iCount = 0;
while (true)
{
rekord[iCount]= (Appointment)input.readObject();
iCount++;
}
}
catch(EOFException e)
{
System.out.println("End of file: "+e);
}
catch(ClassNotFoundException e)
{
System.err.println("Problem with creation object");
}
catch(IOException e)
{
System.err.println("Problem with reading");
}
closeFile();
return rekord;
}
private void closeFile()
{
try
{
input.close();
}
catch(IOException e)
{
System.err.println("Problem with reading");
}
}
public static void main(String[] args)
{
Appointment[] ct = new Appointment[50];
ReadFileAppoint RF = new ReadFileAppoint();
ct = RF.retrieveInfo();
}
public Appointment[] retrieveInfo()
{
Appointment[] ct = new Appointment[50];
ct = readRecord();
return ct;
}
}
import java.io.*;
import java.util.*;
public class ReadFileCon
{
private ObjectInputStream input;
int iCount = 0;
public Kontak[] readRecord()
{
Kontak[] rekord = new Kontak[50];
try
{
input = new ObjectInputStream(new FileInputStream("Kontak.ser"));
iCount = 0;
while (true)
{
rekord[iCount]= (Kontak)input.readObject();
iCount++;
}
}
catch(EOFException e)
{
System.out.println("End of file: "+e);
}
catch(ClassNotFoundException e)
{
System.err.println("Problem with creation object");
}
catch(IOException e)
{
System.err.println("Problem with reading");
}
closeFile();
return rekord;
}
private void closeFile()
{
try
{
input.close();
}
catch(IOException e)
{
System.err.println("Problem with reading");
}
}
public static void main(String[] args)
{
Kontak[] ct = new Kontak[50];
ReadFileCon RF = new ReadFileCon();
ct = RF.retrieveInfo();
System.out.println(ct[1].toString());
}
public Kontak[] retrieveInfo()
{
Kontak[] ct = new Kontak[50];
ct = readRecord();
return ct;
}
}
import java.io.*;
import java.util.*;
public class WriteFileAppoint
{
ObjectOutputStream output;
public void openFile()
{
try
{
output = new ObjectOutputStream(new FileOutputStream("Appointments.ser"));
}
catch (IOException e)
{
System.err.println("Problem opening file");
}
}
public void writeFileAppoint(Appointment rekord)
{
try
{
output.writeObject(rekord);
}
catch(IOException e)
{
System.err.println("Problem writing to file");
}
}
public void closeFile()
{
try
{
output.close();
}
catch(IOException e)
{
System.err.println("Problem with closing file");
}
}
public static void main(String[] args)
{
Appointment[] rekord = new Appointment[50];
WriteFileAppoint WF = new WriteFileAppoint();
rekord[0]=new Appointment("Sally","Potch","10-:?',.0456","2","asd");
rekord[1]=new Appointment("Tom","Potch","123456","asd","asd");
rekord[2]=new Appointment("Dick","Potch","123000","3","asd");
rekord[3]=new Appointment("Harry","Potch","120056","asd","aad");
WF.insertInfo(rekord,4);
}
public void insertInfo(Appointment[] ct,int iIndex)
{
openFile();
for(int iCount =0; iCount <= iIndex - 1; iCount++)
{
writeFileAppoint(ct[iCount]);
}
closeFile();
}
}
import java.io.*;
import java.util.*;
public class WriteFileCon
{
ObjectOutputStream output;
static Kontak[] rekord = new Kontak[50];
public void openFile()
{
try
{
output = new ObjectOutputStream(new FileOutputStream("Contact.ser"));
}
catch (IOException e)
{
System.err.println("Problem opening file");
}
}
public void writeFileCon(Kontak rekords)
{
try
{
output.writeObject(rekords);
}
catch(IOException e)
{
System.err.println("Problem writing to file");
}
}
public void closeFile()
{
try
{
output.close();
}
catch(IOException e)
{
System.err.println("Problem with closing file");
}
}
public static void main(String[] args)
{
WriteFileCon WF = new WriteFileCon();
rekord[0]=new PersonalContact("Sally","Potch","100456","2","asd","lololo");
rekord[1]=new BusinessContact("Tom","Potch","123456","asd","asd","asd","asd");
rekord[2]=new PersonalContact("Dick","Potch","123000","3","asd","lolohjgjlo");
rekord[3]=new BusinessContact("Harry","Potch","120056","asd","aad","asda","asdaaa");
WF.insertInfo(rekord,4);
}
public void insertInfo(Kontak[] ct,int iIndex)
{
openFile();
for(int iCount =0; iCount <= iIndex - 1; iCount++)
{
writeFileCon(ct[iCount]);
}
closeFile();
}
}
Ezzaral
commented:
Nope.
-3
Recommended Answers
Jump to PostYou need to ask specific question as we are not here coding service on demand.
Jump to PostIn the same way you studied and wrote all that code, you can do the same and create a gui. Surely, you shouldn't have a problem if you managed to study and write all that code, to program a gui.
Look at your notes, create the gui and call …
All 5 Replies
peter_budo
2,532
Code tags enforcer
Team Colleague
Featured Poster
You need to ask specific question as we are not here coding service on demand.
javaAddict
commented:
Absolutely Right
+13
javaAddict
900
Nearly a Senior Poster
Team Colleague
Featured Poster
In the same way you studied and wrote all that code, you can do the same and create a gui. Surely, you shouldn't have a problem if you managed to study and write all that code, to program a gui.
Look at your notes, create the gui and call the methods of the classes.
Majestics
84
Posting Pro
Hire a freelancer.
quuba
81
Posting Pro
ScubaSam, ensure that all the set-methods inside Appointment.java are correctly written.
iamthwee
What you need is java GUI builder and another week.
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.