End of year Java Project Question - File I/O

Hello.
My project involves allowing the user (which should be someone learning the very basics of Java and OOP) to copy and paste a one class program into a JTextArea. Then, they click a button which analyzes their code and visually shows how objects in their program interact with one another. My problem is that I am not sure of how to GET their code after it is pasted. I read up on FileReader/Writer but it seems like they save .txt files; I do not need to save the user's program on disk but only in memory and analyze their. Does anyone know of how I could do this? I obviously do not want to save it as a String because if the code is 100 lines long, then it just gets too messy. I would like to be able to read line by line what the user is trying to accomplish in their program in a txt file. If I could save a txt file and at close of the program, delete it, that could work too.
Any help? Thanks in advance.

Does anyone know of how I could do this? I obviously do not want to
save it as a String because if the code is 100 lines long, then it just
gets too messy. I would like to be able to read line by line what the
user is trying to accomplish in their program in a txt file. If I could save
a txt file and at close of the program, delete it, that could work too.huh? you can write a whole application on one line
for (int i = 0 ; i < 10; i++){ System.out.println("Line 1"); System.out.println("line 2");  etc... }
This is ambitious for an end of class project (a class project even)
your application have to check the syntax, java keyword, keep what object is instantiate, what method is invoked..if that method belongs to the class...etc..

Similar Messages

  • Making java project .exe file

    how can you make your java project an executable file
    I mean how can people execute a java project like they are executing programs that written in c++(.exe files)
    Thanks

    <--- SEARCH FORUMS

  • How to create the exe file for java project.

    How to create the exe file for java project.
    am done the project in java swing , i like to create the project in exe format, so any one help for me,
    send the procedure for that.
    thanking u.

    How to create the exe file for java project.Have you ever heard of google? I pasted your exact "question" into a google search:
    http://www.google.com/search?q=How+to+create+the+exe+file+for+java+project.
    and got several useful links.
    Better search terms might yield even better results.
    Sheesh.

  • Convert Java Project to exe file

    Helloz everyone,
    I have completed a java project. Now I have to convert it in exe file for windows.
    Can u please guide me. I can use any third party tool.
    But I want that it can be installed on any computer whenever double clicked and it make a icon. Whenever user click on that icon then it run the application.
    Thanks in advance.
    ViVeK

    Your jar command appears to be incomplete; it should lookk about like this:
    jar cvmf0 manifest_file MyJar.jar MyPackage/MyClass.class MyPackage/MyClass.gif MyPackage/MyClass.txt MyPackage/MyClass.html
    The 'm' in the command represents the manifest file. The 'f' represents the jarfile name. These can be reversed in order, but must be reversed respectively - that is, if the 'f' comes before the 'm', then the MyJar.jar needs to come before the manifest_file.
    The contents of the manifest needs - in the simplest cases - to look like this:
    Line 1. Main-Class: MyPackage.MyClass
    Line 2.
    Note please the Line x. do not appear; however the line 2 must exist and must be empty. IOW, a carrage return must exist at the end of line 1.
    Note too that the MyPackage part is optional. It's there if you have a specifically named package.
    Note lastly that you may not have .gif, .txt, etc files to add to your jarfile.

  • I m not able to create xml file in Java Project

    hi all,
    I have created one java project just to try with Ant Builder. I have created one class inside it. and now i m creating an XML file inside that project.
    But as soon as i try to create the File -> New -> File and give the .xml extention of the file this gives error into the project.
    Will you suggest me the solution for that?
    Thanks in advance.

    Assuming that you are facing this problem in NDS, here is the solution.
    Go to Windows--> Preferences --> WorkBench -->File Associations
    In the File Types list select *.xml
    This will display the default associated XML editor as
    XML Editor(default) in the bottom list box.
    Click on add button near the bottom list box and select Text Editor, click Ok.You will see one more entry in the list box as "Text Editor".
    Select this entry and click on the default button.
    Click Ok and close the preferences dialogue.
    Now create a new xml file.You wont see the error this time.
    Please note that this will treat all simple xml files you will create as TEXT Files and always open with Text Editor.You can override this behaviour with right click on the file and select appropriate editor from the "Open With" context menu.
    The error you are talking about is because the XML editor tries to check well-formedness and basic syntax rules for the file that you newly created, actually is a noce feature of the IDE.
    Rgds,
    Amol

  • How to open java files in a java project

    hi ,
    i have to implement a java program analyzer and now i have implement a java parser using javaCC. My parser parse a java file at a time and i have to read and parse all java files in a java project. my idea is to enter
    java project name *.jpx as an input and search java files in project and parse them one by one, or , to enter the folder path of java source files of project and parse them.
    i am a beginer of java language and i don't know where to start to do it.
    is there someone tell me which way is easier and better for my case and some ways to implement it. i search sample files that is similar to my case but i cannot find any.
    thanks in advance.
    ami

    if u don't mind , can u tell me which tutorial i
    should read for that? http://java.sun.com/docs/books/tutorial/essential/io/
    This... for example.
    xH4x0r

  • How can i import dll files in java project in eclipse?

    Hi All,
    How can i import or link dll files in java project in eclipse?....
    dll files contains
    import com.ms.com.ComLib;
    import com.ms.com.Variant;
    import com.ms.com.ComFailException;
    import com.ms.wfc.data.AdoException;
    import com.ms.wfc.data.AdoEnums;
    Any idea of this please tell me.....
    I am using eclipse 3.4 and JRE 1.4
    Is this possible?
    Please tell me!!!!!!!!!!!!!
    Voddapally

    iMovie cannot edit mpg files, unles they come directly from a supported camera.
    I would suggest that you use a free third party app to convert it.
    Get MPEG Streamclip from Squared 5, which is free.
    Drag you mpg clip into MPEG Streamclip.
    Then, FILE/EXPORT USING QUICKTIME
    Choose Apple Intermediate Codec, and save it where you can find it. You should be able to import this file into iMovie, using the FILE/IMPORT/MOVIE command.
    Note: If your file is an MPEG2 clip, you may need to purchase the Apple QuickTime MPEG2 Playback Component from Apple. MPEG Streamclip will tell you if you need this. Don't buy it unless you have to. It costs about $20. You just have to install the component. MPEG Streamclip will use it in the background.

  • Adding java projects in eclipse instead of jar files

    I have 2 java projects, one is in C:/test/ProjectA and another is C:/test/ProjectB
    Under projectA and ProjectB i have sub projects.
    I mainly work on ProjectB and import the jar of ProjectA in eclipse.
    Now I have removed jar file of ProjectA reference through eclipse and import projects to workspace, added projects under java build path. clean and build project. no compilation error in eclipse.
    when i do this, one of the class file is not getting loaded while server startup:
    07-Sep-2011 09:28:03 org.apache.catalina.loader.WebappClassLoader validateJarFile
        INFO: validateJarFile(C:\project\europa\NOS-OCT-TEST\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\ESW\WEB-INF\lib\javaee.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
        NOS 0    [main] ERROR org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/ESW]  - Error configuring application listener of class com.bgc.ecm.core.web.listener.Log4jRemappingListener
        java.lang.ClassNotFoundException: com.bgc.ecm.core.web.listener.Log4jRemappingListener
             at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1386)
             at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1232)
    when i add relevant jar file to the project and do a clean build server is getting started as expected.
    But my changes are not reflecting since it is referring old jar file.
    I am using Tomcat server as development environment.
    What i want is instead of refering jar file in eclipse, add projects so that the new changes should reflect the changes without ant build for creating jar file and instead only with eclipse build with source code of the dependent project and run the application.

    847389 wrote:
    I have 2 java projects, one is in C:/test/ProjectA and another is C:/test/ProjectB
    Under projectA and ProjectB i have sub projects.
    I mainly work on ProjectB and import the jar of ProjectA in eclipse.
    Now I have removed jar file of ProjectA reference through eclipse and import projects to workspace, added projects under java build path. clean and build project. no compilation error in eclipse.If you have imported the depended jar, and if its a java project. the eclipse by default refer these while compiling. I mean before using either of the ant script the or build project option in eclipse. And because of this it is not giving error.
    >
    when i do this, one of the class file is not getting loaded while server startup:
    07-Sep-2011 09:28:03 org.apache.catalina.loader.WebappClassLoader validateJarFile
    INFO: validateJarFile(C:\project\europa\NOS-OCT-TEST\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\ESW\WEB-INF\lib\javaee.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
    NOS 0    [main] ERROR org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/ESW]  - Error configuring application listener of class com.bgc.ecm.core.web.listener.Log4jRemappingListener
    java.lang.ClassNotFoundException: com.bgc.ecm.core.web.listener.Log4jRemappingListener
         at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1386)
         at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1232)
    And when you deploy the build app in tomcat it looks for the dependent jar/classes in lib or classses folder, and as it is not there the error is thrown.
    If you are using ant script then please specify which jar files to load in lib folder.
    when i add relevant jar file to the project and do a clean build server is getting started as expected.
    But my changes are not reflecting since it is referring old jar file.
    I am using Tomcat server as development environment.
    What i want is instead of refering jar file in eclipse, add projects so that the new changes should reflect the changes without ant build for creating jar file and instead only with eclipse build with source code of the dependent project and run the application.If you want this, then write ant script compatible of loading both the jar's.
    Or you can make the ant to prompt the user which jars to be loaded, while building (I suggest this option, rather than loading all the jar's of project A and project B).

  • Writing a setup file for Java project

    Hello friends,
    I am Kiran , very new to this Forum and also for java programming, my SE programmed a java project.
    now I got to do two things --
    1.I have to create a jar file with those class files and also an exe file which can execute that jar file.
    2. I have to write a "setup file" for automatic instalation of my Java project.
    so I request my friends to help in these two issues by providing some suggestions to do them.
    Thank you in advance.
    Kiran Karnati.

    1.I have to create a jar file with those class filesI suggest you use ant to build the jar file. Thee are many tutorials available if you use google.
    and also an exe file which can execute that jar file.Java will execute the jar file e.g.
    java -jar myjar.jar
    Of from windows just double click on the jar file.
    2. I have to write a "setup file" for automatic instalation of my Java project. You can do this with ant for remote deployment or use a batch file or use another jar which when run unpacks the application.
    BTW Is Kiran a girl's name or a boy's name or both?

  • Cannot compile Java files or create Java Project

    Hi,
    I cannot compile java files and also didn't see any option
    for creating java project using flex 2 builder.
    Actually am trying to create a FDS project with an option to
    compile on the server. I am using Weblogic 8.1 SP5 as my server.
    thank you
    sun

    hi
    this is may jvm.config file. Can anyone tell me if it is
    right because all the fields are blank.
    # VM configuration
    # Where to find JVM, if {java.home}/jre exists then that JVM
    is used
    # if not then it must be the path to the JRE itself
    # If no java.home is specified a VM is located by looking in
    these places in this
    # order:
    # 1) JAVA_HOME environment variables (same rules as java.home
    above)
    # 2) bin directory for java.dll (windows) or
    lib/<ARCH>/libjava.so (unix)
    # 3) ../jre
    # 4) registry (windows only)
    java.home=C:\Adobe\Flex Builder 2.0 Beta 3\Flex SDK 2.0\jre
    # Arguments to VM
    java.args=-ea -Xmx384m
    # Environment variables we care about, whitespace-separated
    env=
    # java.class.path - use this for adding individual jars or
    # directories. When directories are included they will be
    searched
    # for jars and zips and they will be added to the classpath
    (in
    # addition to the directory itself), the jar to be used in
    launching
    # will be appended to this classpath
    java.class.path=C:\Adobe\Flex Builder 2.0 Beta 3\Flex SDK
    2.0\jre
    # where to find shared libraries, again use commas to
    separate entries
    java.library.path=
    thanks
    sun

  • ATTN: Oracle North American Payroll Customers:End of Year Phase 1 and Q3...

    ATTN: Oracle North American Payroll Customers: End of Year Phase 1 and Q3 2007 Statutory Update Released!
    Dear Oracle North American HCM Customer,
    North American End of Year Phase 1 and the United States (US) Third
    Quarter Statutory Updates (Q3), 2007 have been released!
    US Q3 2007 Statutory Update patch numbers:
    * R11i: 6155000
    * R12: 6155000
    *Note – FPK RUP2 is not required for the US Q3 2007 Statutory Update
    End of Year Phase 1 (includes Q3 Statutory Update) patch numbers:
    · R11i: 6133333
    * R12: 6133333 (targetted for October 8th release)
    We would like to make you aware of several important points. Please read
    this entire note carefully.
    1. US Q3 2007 Statutory Update highlights
    2. End of Year Phase 1 highlights
    3. Other Important Notes
    4. Lifetime Support Policy: Coverage for Applications
    5. R11i HRMS Product Information
    6. Payroll Recommended Patches
    7. HR Recommended Patches
    8. Other Information
    A. US Q3 2007 Statutory Update highlights
    * JIT and School District Updates
    * Miscellaneous Statutory Bug Fixes
    Please see the readmes on Metalink for full details:
    3rd Qtr 2007 US Payroll Readme for Rel 11i – Note: 458431.1
    B. End of Year Phase 1 highlights
    US:
    * JIT/Geocode updates
    * Annual Geocode Patch Released
    o Patch 6117000 11i one-off released 04-Sep-2007
    o Included in EOY Phase 1
    o Readme Note: 456835.1
    * Wage Accumulation
    o Significant enhancement to the way the application
    accumulates wages for reporting
    o Joint project with Vertex to enhance processing of
    reciprocity rules at state and local levels
    o Changes within the Vertex engine allow for improved handling
    of multiple work jurisdictions
    o Provides users with the ability to control how work taxes
    affect taxes at residence locations and if wages should be
    accumulated at employee’s residence location
    o Readme Note: 460678.1
    o
    Note:
    Quantum 2.9.1 will be the pre-requisite for End of Year 2007 processing
    Additional Updates included in 2.9.1:
    o 5520588 – Resident State Tax Not given credit for Work State
    County Tax Withheld (Lives in NY works where ‘local’ tax is
    withheld)
    o 5897764 - FIT W/H Should be 35% After $1M Supplemental Wages
    even if Employee is Exempt
    o 5937604 - Delaware state income tax is being over-withheld
    on the second (and subsequent) supplemental payments in the
    same pay period.
    o 5730236 - YTD EI Deduction Stopped at 729.29 INSTEAD OF 729.30
    Evergreen Forms:
    The following forms are available from Evergreen for W-2s and 1099-Rs
    · Blank perforated W-2 #5208 Window envelope 4444-1
    · Blank perforated 1099-R #5179 Window envelope 6161-1
    · Preprinted W-2 #5218 Window envelope 5151-1
    · Preprinted 1099-R #7159-4 Window envelope 7777-1
    **Note: This is the last year we will support the preprinted W-2 and
    1099R. For EOY 2008 we will only support the pdf version of these two
    reports that print on blank forms.
    Customers can order forms at 800-248-2898 or go to www.evergrn.com
    <http://www.evergrn.com>
    RR Donnelley (formerly Moore) Forms:
    The following forms are available from RR Donnelley (formerly Moore) for
    W-2s and 1099-Rs
    * Blank perforated W-2 (with printed instructions on back) -
    LW28700BW (50 PK)
    * Blank perforated W-2 (with printed instructions on back) -
    LW28700B (2000 BULK)
    * Blank perforated W-2 (blank on back) - LW28700BLANKW (50 PK)
    * Blank perforated W-2 (blank on back) - LW28700BLANK (2000 BULK)
    * Window envelope for W-2 - 7987E
    * Blank perforated 1099R (with printed instructions on back) -LR4UPB
    (50 PK)
    * Blank perforated 1099R (with printed instructions on back)
    LR4UPBBULK (2000 BULK)
    * Blank perforated 1099R (blank on back) - L4UPBLANK (50 PK)
    * Blank perforated 1099R (blank on back) - L4UPBLANKBULK (2000 BULK)
    * Window envelope for 1099R - DW4ALT
    Customers can order forms at 877-526-3885 – reference Oracle customer #
    521836
    Canada:
    * Miscellaneous Bug Fixes
    Mexico:
    * Miscellaneous Bug Fixes
    Please see the readme on Metalink for full details:
    US 2007 Payroll Year End Phase 1 Readme Rel 11i Note 456990.1
    US 2007 Payroll Year End Phase 1 Readme Rel 12Note 456991.1
    MX 2007 Payroll Year End Phase 1 Readme Rel 11i NOTE.458559.1
    MX 2007 Payroll Year End Phase 1 Readme Rel 12 NOTE.458566.1
    CA 2007 Payroll Year End Phase 1 Readme Rel 11i NOTE.458561.1
    CA 2007 Payroll Year End Phase 1 Readme Rel 12 NOTE.458563.1
    C. Other Important Notes
    US Check/Deposit Advice XML
    There are some additional dependencies for this patch that were not
    originally communicated. Applying the EOY Phase 1 patch first satisfies
    these dependencies. If there is a need to apply this patch prior to
    applying EOY Phase 1 we are exploring possible alternative
    pre-requisites and will send out a notice late next week with more
    information.
    * 11i one-off Patch 6399100 released 21-Sep-2007
    * R12 will be part of Release Update (RUP) 12.0.4
    Oracle will de-support the Live Checkwriter and Deposit Advice for US
    and Canada beginning with 2007 EOY Phase 1. Archive Checkwriter and
    Deposit Advice will continue to be supported. What this means is that
    new code changes and bug fixes will not be tested on the Live
    Checkwriter and Deposit Advice. Additionally, enhancements made to the
    Archive version will NOT be made for the Live version.
    Desupport of Standard Tax Interface
    Oracle no longer supports the Standard Tax interface. Taxes will
    continue to be calculated and tax rate changes from the Vertex Data
    Updates will continue. New code changes and bug fixes will not be tested
    on the Standard Interface and we cannot guarantee that all functionality
    will continue to work. Additionally, enhancements made to taxes will NOT
    be made for the Standard Tax Interface. We strongly recommend that you
    upgrade immediately to the Enhanced Tax interface.
    Vertex Customer Café:
    The Customer Café is a comprehensive online information source
    specifically for Vertex customers. It’s easier than ever to get the
    support and information you need to maximize your investment in Vertex
    products. Some of the many benefits to using the Customer Café include:
    o Access to monthly data download files, release bulletins, schedules
    and considerations.
    o Early notification bulletins, late rate notifications, and support
    notices.
    o Online Knowledge Center that provides quick answers to questions and
    issues.
    o Online inquiry submission
    o Access to fully-indexed online documentation for all Vertex software
    products.
    o Easy access to Vertex software training information and registration.
    To register for the Customer Café, just visit the Vertex website at
    www.vertexinc.com <http://www.vertexinc.com/>.
    Year End Information for Payroll:
    Family pack K rollup 2 (5337777) is mandatory for R11i Year End and is a
    pre-requisite for Year End Phase 1. This patch was released on Friday,
    June 22, 2007.
    The R12 RUP (12.0.2) is mandatory for year end for R12
    For the complete R12 Payroll Mandatory Patch List see Metalink Note 386434.1
    For the complete R11i Payroll Mandatory Patch List see Metalink Note
    111499.1
    <http://metalink.oracle.com/metalink/plsql/showdoc?db=NOT&id=111499.1
    <http://metalink.oracle.com/metalink/plsql/showdoc?db=NOT&id=111499.1>>
    For additional non-mandatory North American Payroll patches see Metalink
    Note 74292.1
    <http://metalink.oracle.com/metalink/plsql/showdoc?db=NOT&id=74292.1
    <http://metalink.oracle.com/metalink/plsql/showdoc?db=NOT&id=74292.1>>
    D. Lifetime Support Policy: Coverage for Applications
    Important Reminder:
    Please pay attention to the Oracle E-Business Suite Support dates for
    your point release. Statutory or regulatory updates are not available
    beyond the ‘Extended Support Date’.
    11.5.7 came out of Premier Support in May 2007
    11.5.8 will come out of Premier Support in Nov 2007
    11.5.9 will come out of Premier Support in Jun 2008
    Extended Support has not been offered for 11.5.7, 11.5.8 or 11.5.9
    Premier and Extended Support include - Tax legal and regulatory updates
    Sustaining Support Does NOT include new tax, legal, and regulatory updates.
    For the full definitions of what this means to an 11.5.7/11.5.8 customer
    please read the full fact sheet available at:-
    http://www.oracle.com/support/library/data-sheet/oracle-lifetime-support-policy-datasheet.pdf
    *NOTE: For 2007 Payroll Year End, minimally you will need to be on 11.5.9.
    E. R11i HRMS Product Information
    For the latest Oracle HRMS Product Family - Release 11i Information,
    please see Metalink Note:135266.1
    This page contains important information including:
    * High Priority Alerts
    * Mandatory Patches
    * Family Packs and Minipacks
    * Latest Legislative Data - hrglobal.drv
    * Maintenance Pack Information
    F. Payroll Recommended Patches
    The Payroll recommended patch spreadsheet Metalink Note 74292.1 contains
    additional features and functions.
    G. HR Recommended Patches
    The HR Recommended spreadsheet contains a list of patches needed to be
    in compliance for HR Statutory reporting i.e. EEO-1, VETS-100 etc.
    The spreadsheet is located on Metalink in Note number: 273196.1
    H. Other Information
    1. MetaLink - http://metalink.oracle.com <http://metalink.oracle.com/>
    <http://metalink.oracle.com/>
    MetaLink is a customer resource provided by Oracle World-wide Support.
    The Applications section of Metalink contains all the latest product
    documentation and documentation updates for Oracle’s products.
    2. Payroll World
    Payroll World is an email distribution list for North American Oracle
    Payroll customers used to quickly disseminate information regarding
    product updates, patches, and statutory changes. To be added to this
    email distribution list, send e-mail to: [email protected]
    <mailto:[email protected]>
    Subject: Oracle North American Payroll World Contact Update with your
    contact name, CSI number, and company name
    3. Metalink Service Request profiles:
    Please update all Service Request profiles on Metalink with any updates
    to Database Version, Product Version, and/or contact information
    Metalink->UserProfile button
    4. Information for NEW North American Payroll customers:
    A pamphlet is available for all North American Payroll customers
    explaining Vertex, Payroll World, SIG's, etc.
    The North American Payroll Handout document can be located in Metalink
    Note 316077.1

    Chris,
    If you are referring to (Patch 7395025 - Q3 2008 JIT SQWL UPDATE FOR R11I), then you can apply it on 11.5.9. Just make sure you have all pre-req. patches applied.
    Note: 737173.1 - 2008 US Payroll Year End Phase 1 Readme Rel 11i
    https://metalink2.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=737173.1

  • Java Project

    Hi, My name is Francisco, I am new in Java and have this project due this week can someone really help me, I am really struggling with this project. I am using IDE (NETBEANS) for developing this application. I really appreciate if someone can help me. Below is the project requirements.
    Thank so much.
    This practical work is to write a media management software suite. It stores details of your photos, music and movies (at least these three).
    There is a need to standardise three names for software swapping. You should adhere to the following:
    * the front end package should be called frontend
    * the back end package should be called backend
    * the interfaces Storage and Storable to be declared in a separate package called utilities
    * the primary class implemented in the back end (the one that implements storage) should be called Database
    You should spell these identifiers exactly as above, otherwise your frontend/backend will not swap with other components.
    Detail
    The project must be written using two separate packages, a front end and a back end. The front end interfaces with the user, takes input requests and returns results. Typical commands would be:
    * add/photo
    * add/soundTrack
    * search all for titles containing "river"
    * seacrh all for artist containing "river"
    * delete a particvular item.
    Each entry in the system should have a title, date of entry and notes. Additionally, music should have an artist, and movies should have a length of movie entry.
    The back-end provides the storage, and will simply use a Vector, configured as a Vector<Entry> or similar. This separation of systems in to front and back end (user interface and the database) is a common feature of modern large-scale software.
    Interfacing
    The front end and the back end will "talk" to each other using an interface. This interface will be standard and is specified here. This interface will be extended during the next week, but will be fixed after the lecture on October 25th.
    Classes to be stored in the back-end will implement the Storable interface. It may be a tagging interface, but designers may extend it as required.
    interface Storable {
    // designers may add requirements here
    The main back-end class will implement the Storage interface. It must not be modified after the due date for setting it (you will find out why later).
    interface Storage {
    void add(Storable s);
    void delete(Storable s);
    void saveDatabase(String s); // saves database to file specified by String
    void loadDatabase (String s); // load the database
    // iterate through the database
    void reset(); // reset
    boolean hasMore(); // if there is another element available for the next() method
    Storable next(); // get the next item
    Input/output
    Output (display to the user) should be on-screen using JFrames, JPanels etc. You should mainly write text [g.drawChars("... ], but a bit of colour (a graphic in a separate JPanelto distinguish photos from music etc) is a requirement.
    Input should be using the Scanner class.
    You can improve the input & output by adding GUI components (buttons, textboxes etc) either by directly using Swing components or by using the Form generator in Netbeans. But if you do this, then it's up to you. In particular, event handling in Java -which you will need to understand if you use the Swing components directly - is fairly complex (but well covered in the tutorial). Note that the full GUI interaction - including event handling - is covered in HIT212.
    Options
    For small amount of extra marks:
    * Input using JOptionPane (see API and tutorial)
    * Input using a text box (see Using Text Components in the Java tutorial).
    * Using buttons etc (the full GUI)
    It will jazz your presentation up, but if you want to avoid a bit of extra research, or are having trouble with the concepts, avoid the last two options. The full GUI is taught in the next subject and - in particular - you will have to understand Java's model for event-handlers and event-listeners. It's all in the tutorial, but will not be discussed in class or tutorials.
    Saving the database
    Assuming the database is saved as a Vector of Storables, the whole Vector may be saved by defining an ObjectOutputStream:
    ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream("C:/..."));
    The Vector (assume it is called store) is then put to disc by the following code:
    oos.writeObject(store);
    oos.close();
    Reading the database back in is as simple. Just define an ObjectInputStream. See the API (ObjectOutputStream, ObjectInputStream) for details.
    [Hint: Not all Objects can be written to disc - for security, by default objects cannot be written to disc. If a designer intends objects to be written, they must implement the tagging interface Serializable. Look up Serializable in the API]
    Requirements
    * Storage must be implemented using a Vector.
    * There must be two distinct packages - backend and frontend. These must be implemented as Java packages.
    * All classes to be stored must implement the Storable interface (which may be modified)
    * The back end must implement the Storage interface (which cannot be modified).
    * Group size of one or two. Individuals can identify the code areas they primarily wrote.
    Marking criteria
    The following criteria will be used
    * Good coding style, methods short and clear, good variable naming, follows Java naming conventions
    * Interfaces used as specified. All front-end/back-end communication enforced through the storage class

    Don't sit on your thumbs waiting for magic to happen. Also, nobody here is going to do your homework for you. If you have some succinct, specific, java-related questions you might get somewhere. As it is right now, you're going nowhere in a hurry.

  • Running eclipse java project on command prompt

    Hi all,
    I have one simple java project and that is very well running in eclipse. I have added some external JARs to that project. It performs this job- it creates connection to server, and listens to the signals from server.
    My question is - how do I run that java project on command prompt?*
    I want to run that using ANT or simply I want to make a JAR file so I can execute JAR on command prompt. I created JAR, but it doesn't contain external jar which I added to the project. So I was not able to run that project.
    Can you please tell me any of the method - using ANT or by making JAR?
    Also can you be little bit more explanatory in reply?
    Thanks

    I want to make a JAR file so I can execute JAR on command prompt.This is very likely a good way to proceed. It is explained in great detail in Sun's Tutorial in the section on [Packaging Programs in JAR Files|http://java.sun.com/docs/books/tutorial/deployment/jar/index.html].
    I created JAR, but it doesn't contain external jar which I added to the project. So I was not able to run that project.Yes - the jar file you create has to know about the classes and other resources in that external jar. Otherwise, at runtime, the program will not be able to get at the stuff it needs. Usually you don't include that other jar (or its contents) in the jar file you are creating. Instead you provide your jar file with a manifest that describes the other jar's location. Details are also in the tutorial.
    One thing to note is that Sun's tutorial provides a lot of explanatory, conceptual, material. To that end it keeps the context simple and transparent by describing the steps as they would be carried out by someone working at the command line. The Eclipse documentation and forums might provide a more click-this-drag-that "explanation". If you do follow the method in the Tutorial and get stuck, post a description of the actual commands you used and their outcome.

  • How to run a Java project in NWDS...

    Hi All,
    First of all , i dont know if i am writing in the right forum for this question.
    I am new in NWDS.
    My question is, how can i run my java project in NWDS without  having any portal available (we had some problems running projects in EP 2004 and so we will install a new version EP 2004s )?
    Thank you!
    Regard,
    Ari

    Hi Lohi,
    Thank you for your help.
    Yes i am creating Ear file by using the Java programs with NWDS .
    You mean to deploy mannualy with SDM inside my server?
    How can i than, utilize that into IE?
    Can i run ear without using EP.
    Sometimes i want to run my project in my house where i dont have acess in any SDM or everything else.
    Can you give me please more step by step instruction because i am new with these technologies.
    Thank you ,
    Ari

  • How to connect java project to sql server 2008 r2 database

    i want to create an java application which has to create a database and later access it. My problem is that i am not able to connect sql server 2008 r2 database driver on to the netbeans.i have sql server 2008 r2 installed on my system.please
    suggest me the step by step procedure to establish the connection

    Hi ENG,
    To establish a connection to SQL Server from a Java project, you have to download the JDBC driver for SQL Server from
    here.
    After extracting the jar files(like sqljdbc.jar) from the above link, add the driver to the netbeansIDE.
    Test establishing a connection with the below Java Class.
    import java.sql.*;
    public class Test {
    public static void main(String[] srg) {
    String driverName = "com.microsoft.sqlserver.jdbc.SQLServerDriver"; //load the jdbc driver
    String dbURL = "jdbc:sqlserver://localhost:1433; DatabaseName=test"; //connection string to the db hosted on localhost
    String userName = "sa"; //user name
    String userPwd = "123456"; //password
    Connection dbConn;
    try {
    Class.forName(driverName);
    dbConn = DriverManager.getConnection(dbURL, userName, userPwd);
    System.out.println("Connection Successful!"); //print Connection Successful! if connection establishes
    } catch (Exception e) {
    e.printStackTrace();
    A demonstration video from Youtube for you reference.
    Connect NetBeans Project with Microsoft SQL Server 2008 - YouTube
    Since this is a question regarding Java, I suggest you post your subsequent questions to a java dedicated forum. It is appropriate and more experts will assist you.
    If you have any question, feel free to let me know.
    Eric Zhang
    TechNet Community Support

Maybe you are looking for