STUDYSHIELDS ASSIGNMENT HELP

  • Home
  • Blog
  • Courses
    • Child Category 1
    • Child Category 2
    • Child Category 3
    • Child Category 4
  • Services
  • Country
    • Childcare
    • Doctors
  • Home
  • Blog
  • Sample Works
  • Order Now

Friday, February 5, 2016

The purpose of this lab is to give you a chance to use some of the data stream tools we have been discussing in a simple application

 February 05, 2016     No comments   

The Calendar Program

The purpose of this lab is to give you a chance to use some of the data stream tools we have been discussing in a simple application. The assignment is to write a calendar application which allows the user to select a date, and either retrieve a previously stored calendar entry, or save a calendar entry.

Your program should present a GUI interface which allows the user to specify the month, day, and year of the calendar entry. The GUI should also have a text area for displaying and editing a particular entry. It will also need two buttons, one for saving an entry, and the other for retrieving an entry.

Required program elements:

1. Your user interface must allow the user to enter the month, day, and year. You can do this using text fields for input, or you can use ComboBoxes if you feel adventurous.
2. The only GUI components which create events that your program needs to handle are the save and retrieve buttons.
3. Don t go overboard making your GUI beautiful! We are just looking for basic functionality here!
4. You must have a separate class which manages the calendar data. You will have a minimum of three classes in your application, a user interface class, the calendar manager class, and a calendar test class. The user interface class creates an instance of the calendar manager in its constructor and stores it in a member variable.
5. The calendar manager must provide methods which support saving a specific calendar entry and retrieving a specific calendar entry. The interfaces must be defined to only pass a single day s calendar entry across the interface.
6. The calendar manager must store calendar data into files according to month+year. That is, the calendar entries for December 2011 must all be stored in the same file.
7. The calendar manager must use ObjectInput/OutputStreams to read/write data from/to files. The calendar manager will use an array to store String objects. The position of a String in this array corresponds to the calendar entry for a specific day.
8. The save method of the calendar manager will need to determine if a file exists for the requested month and year. If so, the object from that file must be read into the calendar manager. Otherwise, the calendar manager must create an empty String array. The new entry must be saved to the appropriate day s location in the array. The modified array must be saved to the appropriate file.
9. The retrieve method of the calendar manager will need to determine if a file exists for the requested month and year. If not, return an error string indicating that there is


Here is my GUI portion of the code

import javax.swing.*;
import java.awt.*;

public class Main extends JFrame
{
private static final long serialVersionUID = 1L;
public Main()
{
super.setTitle(" Choose Date");
Font font1 = new Font("SansSerif", Font.PLAIN, 16);

JTextField jtext = new JTextField();
jtext.setSize(200,100);
jtext.setHorizontalAlignment(JTextField.LEFT);

JPanel textPanel = new JPanel(new BorderLayout());
textPanel.add(jtext, BorderLayout.NORTH);

JPanel buttonsPanel = new JPanel(new GridLayout(1,2,5,10));

JButton jSearch = new JButton("Search");
jSearch.setFont(font1);
jSearch.setBackground(Color.WHITE);
jSearch.setForeground(Color.RED);
JButton jSave = new JButton("Save");
jSave.setFont(font1);
jSave.setBackground(Color.WHITE);
jSave.setForeground(Color.RED);

buttonsPanel.add(jSearch);
buttonsPanel.add(jSave);

JPanel ComboBoxPanel = new JPanel(new FlowLayout());

JComboBox month = new JComboBox(new Object[]
{"January", "February", "March", "April","May","June","July","August","September","October","November","December"});
month.setForeground(Color.red);
month.setBackground(Color.white);

JComboBox day = new JComboBox(new Object[]
{"1", "2", "3", "4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31"});
day.setForeground(Color.red);
day.setBackground(Color.white);

JComboBox year = new JComboBox(new Object[]
{"1980", "1981","1982","1983", "1984","1984","1985", "19 86","1987","1988","1989","1990",
"1991","1992","1993","1994","1995","1996","1997","1998","1999","2000","2001","2002","2003"
,"2004","2005","2006","2007","2008","2009","2010","2011","2012","2013","2014"});
year.setForeground(Color.red);
year.setBackground(Color.white);




ComboBoxPanel.add(month);
ComboBoxPanel.add(day);
ComboBoxPanel.add(year);


JPanel mainPanel = new JPanel(new BorderLayout());

mainPanel.add(ComboBoxPanel, BorderLayout.NORTH);

mainPanel.add(textPanel, BorderLayout.CENTER);

mainPanel.add(buttonsPanel, BorderLayout.SOUTH);

add(mainPanel, BorderLayout.CENTER);


}
public static void main(String[] args) {
Main frame = new Main();
frame.setSize(350, 125);
frame.setLocationRelativeTo(null);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setResizable( false );
frame.setVisible(true);

}

}
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg
Email ThisBlogThis!Share to XShare to Facebook
Newer Post Older Post Home

0 comments:

Post a Comment

Click Here to Place order

Popular Posts

  • A “criminal minds” Aileen Wournos individual will be your “patient”
     A “criminal minds” Aileen Wournos individual will be your “patient”  A brief history of the patient including diagnoses (documented or your...
  • CEO Jane Lionel has some hard decisions to make with regard to some of the company’
     CEO Jane Lionel has some hard decisions to make with regard to some of the company’solder hands, and even on the eve of that decision, I be...
  • Problem in Supply Chain
    Problem in Supply Chain Problem 2. (Chapter 11: The Storage and Handling System) Compare the constrast private ownership of storage space to...

Recent Posts

Unordered List

Pages

  • Home

Text Widget

Blog Archive

  • November 2022 (20)
  • October 2022 (50)
  • September 2022 (119)
  • August 2022 (107)
  • February 2022 (501)
  • January 2022 (443)
  • December 2021 (488)
  • November 2021 (1574)
  • October 2021 (28)
  • September 2021 (11)
  • July 2021 (8)
  • June 2021 (15)
  • May 2021 (39)
  • April 2021 (15)
  • March 2021 (303)
  • February 2021 (712)
  • January 2021 (903)
  • December 2020 (2)
  • September 2020 (33)
  • April 2016 (5183)
  • March 2016 (3763)
  • February 2016 (4356)
  • January 2016 (1749)
  • December 2015 (22)
  • November 2015 (147)
  • October 2015 (23)

Sample Text

Copyright © STUDYSHIELDS ASSIGNMENT HELP | Powered by Blogger
Design by Hardeep Asrani | Blogger Theme by NewBloggerThemes.com | Distributed By Gooyaabi Templates