Create Address Book Complete With Menu System

Oct 19, 2014

So for the last few weeks I have been working on a Java project for school. I see the light at the end of the tunnel, but I have run into some speed bumps with my main class. It was working fine, but I was pulling an all night and I deleted some of my code by mistake.Now I am not seeing what is exactly wrong. Anyways, the project was to create an address book complete with a menu system.

Here are all of my classes:

import java.util.ArrayList;
/**
* A model of an address book which keeps track of contacts.
* An address book object should keep track of the concept of a current contact (think index).
* You must use an ArrayList for your implementation.
*/
public class AddressBook {
Contact contact = new Contact();

[code]....

View Replies


ADVERTISEMENT

Build Address Book?

Feb 2, 2015

I am trying to build an address book, and I started from what i know how to do.

public class Persona {
String nome;
String indirizzo;
int cellulare;
public Persona(String nom, String ind, int cel) {
nome = nom;
indirizzo = ind;
cellulare = cel;

[code].....

Now I would like the program to take a string I insert on command line (for example java Cerca"Robert Baratheon") and compare it to the nome field of every Persona in the address book.

View Replies View Related

Designing Address Book In Java

Jan 12, 2014

I am designing an address book. I have come up with the following design:

Address Book:
Attributes : Entry
Methods: add(), delete(), search()

Entry:
Attributes : Name, Address, Phone Number
Methods: addName(),editName(),deleteName(),addPhone(),editPhone(),deletePhone(),addAddress(),editAddress(),deleteAddress()

Name:
Attributes: firstName, lastName

PhoneNumber:
Attributes:areaCode, phoneNumber

Address:
Attributes:streetNumber,streetName,city,zip.

View Replies View Related

Address Book - Unique Object Names

Aug 22, 2014

I found out what my next java class project is, and i am trying to get a head start on it. It is a simple address book. it needs to have 4 choices that get cycled through until quit is chosen:

1. add business contact
2. add personal contact
3. display contacts
4. quit

I have made an abstract contact class with a personal subclass and business subclass(all 3 are required). they have all been made, with set/get methods(the wonders of encapsulation and polymorphism have finally hit home!). The main program needs to add a new subclass object when chosen, and it needs to accept and store contacts by type

So, i am figuring 2 object arraylists for business/personal.

My question is: how do you create an object without having a name for it already programmed? Does it even need to have a unique name, since it would be stored in a seperate index and/or arraylist?

Contact contact = new Contact();
this.firstname = "Be";
this.secondname ="Ginner";
this.phonenumber = "921-456-0102";
personalArray.add (contact);

Then cycle through, changing the properties, and add again to personalArray?

View Replies View Related

ArrayList - Contact Information / Address Book

Jul 5, 2014

I have a question about arraylist objects.... I want to create an address book that will contain a persons information (name, phone, address, email..etc..). The first two snippets of code are from the same class ContactArrayList and the last one is from the class Contact. Do I need to create a separate arraylist for each data type? Is it possible to use a single arraylist to contain all the object (person) information and then be searched for using a GUI? I would also like to be able to access this data to be manipulated using a JFrame (add, edit, and search).

public class ContactArrayList<E> implements List<E> {
public int size, capacity;
E contact;
private E[] contacts;
public ContactArrayList() {
size = 0;
capacity = 20;

[Code] ....

View Replies View Related

Web Services :: Telephone Book - Enter Phone Number / Correct Person With Name And Address Should Appear

Nov 30, 2014

Applications: Netbeans (8.0.1), Apache Tomcat

My Aim: Creation of a telephone book

How should it work:

I have a Database with Data of people (name, adress, phone number).

If a user enters a phone number (CLIENT) -> the correct person with the name and adress should appear.

I build up the infrastructure and now I'm at the point that I have to create a Webmethod for it. I just worked on projects like addition of two integers, hello "name", ... I think this example now is harder, BUT i can learn a lot!

View Replies View Related

How To Find IP Address Of System

Dec 5, 2013

In my java program I'm changing my IP(using proxy) and sending the request to some sites. Later some point of time, I want to know my current IP address through java program itself. How to get hold of my current IP address? Also which IP address will it show? The proxy one or the original IP ?

View Replies View Related

Create A Menu Where The User Can Create A New Account?

Oct 5, 2014

I'm having some difficulty with my bank account project. I'm supposed to create a menu where the user can create a new account, withdraw, deposit, view their balance, and exit. There's issues with the account creation.

Here's my necessitated class below: BankAccount, TestBankAccount, SavingsAccount, CurrentAccount, and Bank

/*---------------------------------------------------
Plagiarism Statement
 
I certify that this assignment is my own work and that I have not copied in part or whole or otherwise plagiarized the work of other students and/or persons.
 
----------------------------------------------------------*/ 

package BankAccount;
 import java.util.Date;
import java.util.Random;
 //Project 3
public class BankAccount {
protected static int accountID;

[code]....

View Replies View Related

How To Create A Menu

May 12, 2014

I'm trying to create a GUI java application.

I want a menu with buttons that looks like this:

Button 1: Start
Button 2: Help
Button 3: About Me

If you press one of the buttons you will get to another frame with new buttons, new labels and so on.

Next step for instance if you press button 1, I'd like my program to get this frame:

Different alternatives, and a text field with a button. One commando leads to one new JFrame with new buttons, text fields and so on.

View Replies View Related

Create JTable When Click On New On Menu Bar

Dec 5, 2014

I want to create a Jtable when i click on "new" on the menu bar,but if i click on it, i still not see the table.Here is the code:

package mestint
import java.awt.BorderLayout;
import java.awt.EventQueue;
import java.awt.*;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JTable;
import javax.swing.border.BevelBorder;
import javax.swing.table.DefaultTableModel;
import javax.swing.*;

[code].....

View Replies View Related

Swing/AWT/SWT :: Create A Sub Menu For Every List Item In A Jlist

Oct 8, 2014

I would like to create a sub menu for every list item in a Jlist. I need the UI like avast interface. If we hover over an list item, its sub menu should be shown. I attempted to put an sub menu but didn't work. Is this possible in Swing?

View Replies View Related

JSF :: 2.2 And Netbeans 8.0 - Create A Website That Has Common Header / Footer And Menu

Aug 26, 2014

I am working with Netbeans 8.0 and JSF2.2. I am trying to create a web site that has a common header, footer, and menu. The only part that would be dynamic is the content. So here goes...

1) I need a common template that has 4 parts, Header, Footer, Menu, Content
2) The header, footer and menu are to be in a separate files of which are called from the main template
3) The content will change based on the menu item changed
4) The menu has to change the content section only

I know how to do this in HTML but I am trying to set up some thing in JSF to learn more on JSF pages. All I am looking for is an example that I can follow along with having the multiple pages as well having the menu change the content (I have done a ton of internet searching but nothing really fits the bill).

This is the code I have currently.

Index (Main Template)
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
xmlns:h="http://xmlns.jcp.org/jsf/html">

[Code] .....

View Replies View Related

How To Find Ip Address And Mac Address From Another Computer

Nov 12, 2014

I want to ask how to track ip address and mac address of a different computer using java?

View Replies View Related

Reading Json Of Nested Menu Without Giving Menu Names In Java

Aug 14, 2014

I want to read json file as follow;
 
{
  "M": {
  "row": [
  {
  "col1": "c00"
  },
  {
  "col1": "c10",
  "col2": "c11"
  },
  {
  "col1": "c20",
  "col2": "c21",
  "col3": "c22"
  }
  ]
  }
}
 
Next to reading I need to assign to two dimensional array, but without giving "col1","col2","col3" a lot. 

The array is for example, Array[3][] = {{"c00"},{"c10","c11"},{"c20","c21","c22"}};

View Replies View Related

Create A Restaurant Ordering System Using JFrame

Oct 14, 2014

How to create a restaurant ordering system using JFrame .....

View Replies View Related

Create A Simple User Database That Could Eventually Turn Into A Login System

Jun 6, 2014

So I'm trying to create a simple user database that I could eventually turn into a login system. I created a simple table on MySQL with a name and address for the sake of simplicity. I tried to create simple statement inside my main method that would connect to my MySQL server and when I run my program I get a ClassNotFoundException from "org.gjt.mm.mysql.Driver"..Here is what I have in my main method thus far:

public static void main(String args[]) {
try {
Class.forName("org.gjt.mm.mysql.Driver"); //Load the driver
Connection conn = DriverManager.getConnection("jdbc:mysql://localhost/data", "root", ""); //Connect
/*
conn.createStatement().execute("CREATE TABLE people (" + "id int(64) NOT NULL AUTO_INCREMENT," + "name varchar(255) NOT NULL," + "address varchar(255) NOT NULL," + "UNIQUE (id)," + "FULLTEXT(name, address))");

[code]....

I downloaded Connector/J in the the binary .zip form and extracted it to my C: drive and put the .jar file into my java directories lib folder. I also added the directory of the .jar file into my CLASSPATH and I still get the exception.

View Replies View Related

How To Develop Complete Arithmetic Class

Nov 21, 2014

 import java.util.*;
 public class TestArithmetic {
  public static void main(String [] args) {
  Scanner console = new Scanner (System.in);
  System.out.println("Enter First Number");
int x1 = console.nextInt();
System.out.println("Enter Second Number");

[code]...

View Replies View Related

How To Complete For Loop For Forward Method

Mar 3, 2015

I can't figure out how to complete the for loop for the forward method that needs to calculate each pixel on the path setting it to white, starting at location (x,y) and ending at r.

public class Turtle
{
private static BufferedImage img;
private static int black = 0;
private static int blue = 255; // 2^8-1
private static int green = 65280; //(2^8-1)*2^8
private static int red = 16711680; //(2^8-1)*2^16
private static int white = 16777215; // 2^24-1
private double x,y,theta; // what does a Turtle know?
static // a static initializer list

[code]....

View Replies View Related

Creating A System That Will Ask User To Create A File That Will Store To Text File

Mar 9, 2015

I am new to java and I am creating a system that will ask the user to create a file that will store to a text file, Once the user created the file I have a class that will let the user input the subject name that has been created, However, I keep on getting this java.util.nosuchelementexception.Here's my code:

public void display_by_name()
{
String id, name,total;
String key[]=new String[30];
String value[]=new String[30];
int i=0;

[code]....

View Replies View Related

Servlets :: Retrieve Complete Rows Of Table Using JSP

May 8, 2014

I have one table in mysql in that some rows are there i want to retrieve all rows using servlet and jsp concept and i have done half of the way but not getting output it is showing some info and nothing getting printed on page except columns heading and here is my bean class..

public class TimeDetailBean {
private Time intime;
private Time outtime;
private Date date;
private String eid;

public Time getInTime() {
return intime;

[Code] .....

View Replies View Related

Applet Doesn't Run Complete In HTML File

Aug 7, 2014

I compiled the applet, then put the applet in an HTML file using notepad and saved the html file in the right place for it to run correctly. The HTML file runs smoothly, but then it only shows the scrollbar part of my applet, and not the images or any text...

Why is This?????

Java Code:

import java.awt.*;
import java.applet.Applet;
import java.awt.event.*;
import javax.swing.ImageIcon;
public class Temperature_Convert extends Applet
implements AdjustmentListener {
private Image temp;
private Scrollbar bar;
private int old, newtemp = 0;

[code]....

View Replies View Related

Give A Complete Resource Of File I/O Serialization

Aug 15, 2014

Can you tell me or give a complete resource of file I/O, serialization!

View Replies View Related

Api That Convert Speech To Text But Complete English Not Predifined Words Only

Oct 16, 2014

java api that convert speech to text but complete english not predifined words only.

View Replies View Related

Deleting And Editing Phone Book Entries

Jun 22, 2014

I have a program for a phone directory. It needs to add, delete, append, and edit telephone records. I've gotten it to write and search the files. Just need to get it to delete and edit them.

Here's what I have so far:

import java.nio.file.*;
import java.io.*;
import java.nio.channels.FileChannel;
import java.nio.ByteBuffer;
import static java.nio.file.StandardOpenOption.*;
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;

[code]....

View Replies View Related

Remove Book And PrintAuthorBook Methods Won't Work

Nov 25, 2014

Why my borrowBook, returnBook, getBookIndex, remove book and printAuthorBook methods wont work. They all have a parameter that is a string and Im guessing its a common problem in all the methods. I think all my code for Book class is right. Iv attached the two classes. I also attached the test library which tests the two classes.

public class Book
{
// The fields:
private String author;
private String title;
public int pages;
public String refNumber;
public int numBorrowings;
boolean available;
// add more fields here

[code]....

View Replies View Related

Program With Ability To Book Appointments For A Number Of Different Services

Sep 30, 2014

I am creating an apointment application. This programm will have the ability to book apointments for a number of different services, such as doctors, hairdressers, teachers etc for a number of cities.

These information will be placed on a combo box and ideally i would like to provide only the options available acording to the choices made so far.

So, for example we have
A Pediatric in London
A Vet in London
A Sergeon in Berlin
A Barber in Berlin
A Heardresser in Rome
A Programmer teacher in London
An English teacher in Rome

My thinking is that the user choses the city, for example London, then there will be a type of service combo box. In this case (of London) it will hold Doctors and Teachers. If Doctors is chosen, the next field will hold the available Medical specialty, i.e. Pediatrics and Vets and according to that choice the apropriate doctor will pop up.

My problem is not how to programm that. i havent got there yet.

My problem is how to design it! I am thinking that each individual will be an object. each having the same fields, city, type of service etc. But in such a way i am not sure how i can manage to get all the appropriate information in order to poppulate the combo boxes.

I would have to search all the objects for each combo box? From a rough testing i did, i think i could easily get all the individuals that resign in London, but that would give me two records for the doctors(for example).

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved