Question

Assignment: My Contact Manager v4 The last release of My Contact Manager was a hit! Consumers...

Assignment: My Contact Manager v4

The last release of My Contact Manager was a hit! Consumers are exploding with excitement about the upcoming release for Android smart-phones: My Contact Manager v4! Leaks indicate that this release will no longer be constrained by finite arrays but will use the dynamic ArrayList class to hold arbitrarily many contacts!

There is just one problem: the programmer hired to complete this highly publicized release has decided to retire from the world of computing and become a lumberjack. We wish him all the best.

Your task is to re-factor My Contact Manager v3 so that it now utilizes an ArrayList of the Contact class. The GUI is unnecessary as a separate development team is designing the mobile GUI, they only require the Contact Manager functionality. Therefore, this implementation will be developed to operate via the command line.

Exceed the Expectations:

Implement the GUI yourself! This will require converting the ArrayList into a 2D array as needed to use the JTable class.

Its about having need to update this software from previous version.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

public static void main(String[] args) throws IOException {

// TODO Auto-generated method stub

ArrayList<String> contact = new ArrayList<String>();

contact.add("A - 122345");

contact.add("B - 323232");

contact.add("C - 121223");

JFrame f = new JFrame();

f.setTitle("Contact App");

Object[][] name_arr = (Object[][]) contact.toArray();

name_arr = (String[][])name_arr;

String[] column_name = {"Contact details"};

JTable j = new JTable(name_arr, column_name);

j.setBounds(30, 40, 200, 300);

JScrollPane sp = new JScrollPane(j);

f.add(sp);

f.setSize(500, 200);

f.setVisible(true);

}

Add a comment
Know the answer?
Add Answer to:
Assignment: My Contact Manager v4 The last release of My Contact Manager was a hit! Consumers...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT