JTable and loading 350 Mb file

Hi guys, can you help me,
What is the best way to load and to handle such a big amount of data? I want to visualize them in a Table, let say JTable. Can someone give me a link with a control or piece of code that handles the data in parts?

this is my custom table:
class MyTableModel extends javax.swing.table.AbstractTableModel {
protected java.util.Vector data;
protected java.lang.Object data2[][];
protected String[] columnNames = {"Hello", "Johnny, "World"};
public MyTableModel() {
super();
data = new java.util.Vector();
public int getColumnCount() {
return columnNames.length;
public int getRowCount()
return data.size();
public void clear() {
data.removeAllElements();
fireTableDataChanged();
public void removeRow( int i ) {
data.removeElementAt(i);
fireTableRowsDeleted(i,i);
public String getColumnName(int col) {
return columnNames[col];
public Object getValueAt(int row, int col) {
Object[] o = (Object[])data.elementAt(row);
return o[col];
public Class getColumnClass(int c) {
return getValueAt(0, c).getClass();
public boolean isCellEditable(int row, int col) {
return col > 0 && row < getRowCount()-1;
/*public void setValueAt(Object value, int row, int col) {
data2[row][col] = value;
if (isCellEditable(row, col))
fireTableCellUpdated(row, col);
public void addRow(Object o[]) {
for( int i=0; i<o.length; i++ ) {
if( o[i] == null ) {
o[i] = new String();
data.addElement(o);
// entry added to the end, so fire an event to notify the table
// to update itself
fireTableRowsInserted(data.size()-1,data.size()-1);
}

Similar Messages

  • In logic Pro, when I open up an audio track and load an audio file, there is no sound. I will finally get a sound out of one of the audio tracks after opening at least 5 of them alternately. Is anyone familiar with this kind of bug? It's really frustratin

    In logic Pro, when I open up an audio track or software track and load an audio file/loop or software file loop, there is no sound. I will finally get a sound out of one of the audio or software tracks after opening at least 5 of them alternately. Is anyone familiar with this kind of bug? It's really frustrating as this takes much time to complete work.
    os x, Mac OS X (10.6)

    I'm not sure I follow your words Fuzzynormal. You've helped by offering the insight that my issue in Logic Pro 9 is not a bug but a feature. But fell short of enlightenment by being a judge of character and of how one should interact in this forum. You insinuate that I haven't tried to solve the issue on my own when in fact I have. These forums are always my last resort. You further suggest that I am complaining. This is not a complaint. It is a genuine issue that I cannot figure out. Then you think that Brazeca is holding my hand and being a nice guy. Brazeca is helping people like me who might not be as adept at using Logic Pro as probably you are.This community forum was established to raise questions, answers and dicussion to help Apple's customers better undertand their operating systems and related issues. You are doing a disservice by not contributing positively and by trying to make this forum what you want it to be. You may have all the time in the world to try figuring out stuff but we are not all like you. We all have different schedules and different levels of understanding. And that is what this forum is for - to help people move forward. If you can't contribute positively then keep silent. And by the way, you say to "read the words that are printed down to explain to you how that works" what words are you talking about? Why don't you be of some help instead of trying to own this forum. 

  • I want to save and load the swf-file to a local disk of any user. Possible?

    Hi, It's good to see you.
    I am a developer in Web Flash Game.( I use AS3.0 )
    I want to save and load the swf-file to a local disk of any user,
    Because I want to decrease the time for loading a flash movie from site.
    Is it possible?
    If it is possible, I hope the swf-file has only one loading from site and
    it will be loaded from a local disk of any user after that.
    (I know a concept of Internet temporary file.
    I want to know the other techniques of only using AS3.0.)

    Hi,
    I have similar problem. We are producing a 70 meg browser based game and would like the user to be able to cache the game to avoid reloading the game the next time. Can this be done if the user authorise the save? If, so how? We don't care where the game is cached .
    Can we prompt the user to download the file by providing a link from within the SWF application?

  • CLASSPATH issues on DOS/NT and loading of jar files

    Hello all,
    I have the following problem on running WebLogic 5.1 on
    NT. The CLASSPATH is getting truncated after a certain number of
    characters. I have a lot of third party jar files that I use in my
    application. How do I overcome this problem ? I tried increasing my DOS
    environment space by changing the default values in config.sys.
    What are other alternatives ?
    One idea that I have is to use URLClassLoader to load the jar files. I
    am running a RMI based application and I need to load these jar files
    before I load the RMI code. Where would I run this URLClassLoader code
    ? Is there some system startup class that can load jar files ?
    Thanks,
    Aswin.

    Thanks for the reply. I much appreciate it. What about the other idea that I
    had outlined-loading these jar files using a ClassLoader. Is that viable ?
    Aswin.
    Cameron Purdy wrote:
    In Win2k: Control Panel, System, Advanced, Environment Variables
    ComSpec=%SystemRoot%\system32\cmd.exe /e:16384
    You still will not be able to have a command line exceeding a certain size
    (around 1k or so). That is a hardcoded limit somewhere inside the NT kernel
    ("kernel" being a poor term for the piece so named in NT ;-).
    Peace,
    Cameron Purdy
    Tangosol, Inc.
    http://www.tangosol.com
    Tangosol: How Weblogic applications are customized
    "Aswin Dinakar" <[email protected]> wrote in message
    news:[email protected]..
    Hello all,
    I have the following problem on running WebLogic 5.1 on
    NT. The CLASSPATH is getting truncated after a certain number of
    characters. I have a lot of third party jar files that I use in my
    application. How do I overcome this problem ? I tried increasing my DOS
    environment space by changing the default values in config.sys.
    What are other alternatives ?
    One idea that I have is to use URLClassLoader to load the jar files. I
    am running a RMI based application and I need to load these jar files
    before I load the RMI code. Where would I run this URLClassLoader code
    ? Is there some system startup class that can load jar files ?
    Thanks,
    Aswin.

  • Mapping and loading  single ASCII file into multiple tables in ODI

    We get an ASCII file that contains several different transactions (records) and I need to validate and map each record to different table in the target database using Oracle Data Integrator tool. Is it possible ? If so, how and how difficult it is ?
    I would appreciate a quick response.
    Thanks,
    Ram

    Hi Madha,
    Using Demo version, we are trying to load data from ASCII file. When trying to execute, we are getting the following error:
    7000 : null : com.sunopsis.jdbc.driver.file.a.icom.sunopsis.jdbc.driver.file.a.i
    at com.sunopsis.jdbc.driver.file.a.f.getColumnClassName(f,java)
    at com.sunopsis.sql.e.a(e.java)
    at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execCollOrders(SnpSessTaskSql.java)
    The file has all text fields and no date fields. we made sure that there is data for all fields being loaded.
    Question is whether there is any problem in creating data in the Demo database which cameup with installation?
    I mean, do we need to create any privileges to insert/add/delete ? We are running this as user SUPVERVISOR .
    I appreciate if you can respond to this.
    thanks,
    Ram

  • Cuepoints in video and loading a swf file

    PLease help i am stuck once again!
    I have a video with a cuepoint called end in a video. At this
    point i would like an external swf file say excel.swf to appear and
    then close the video movie.
    I ahve no idea and im stuck :(
    The code i have so far is this:
    on (click) {
    this._parent.test_vid.play()
    i guess the code will need to go in here somewhere but im
    nnot sure .

    I'm sorry, but I happen to digress greatly with Michael's approach. I started using AIR  just yesterday ( 3 hours or so ), and I firmly believe in reinventing the wheel as a strong method of learning. Just to be clear, I do this on my own free time, so I have no need to worry about COGs, after all, I'm just learning. Otherwise, though it's a strong and great response if I were to build a somewhat bigger application, it's way too much more than the original scope of the application. It's like using a bazooka to kill ants . Regarding the scope of the application, it should support loading / writing of SWFs, and editing of XMLs for certain pre-defined entities. As I stated already, I am certain that I'd be able to do this in a very short span of time with another approach (more xmls, embedding assets directly to the SWF that loads the edited swf, etc.) It's more of a challenge to myself than anything else . I'm really grateful for all your help, so if you want, I can keep you up to date on how I deal with the issue.

  • Reading and loading a flat file to a table by line by line

    Hi All
    My requirement is like this, i receive a daily a file which are having transaction realted data,
    For ex: The first row will also have the transaction num and the second and third rows will be transaction realted infomation and in the 4th record i will have new transaction num and the following rows are realted to 2nd trans num details In the flat file i able to identify which record is transn num related data, now the issue will be the following will not have the transaction num informations, blindly 2 and 3 rows are having transaction num1 info only
    TRAN123
    'SALE'
    '450'
    TRAN245
    'SALE'
    '123'
    my output : TRAN123 is having a sale of 450 and TRAN245 is having a sale 123
    For this i need to read the data from the flat file by an order only
    Thanks
    Ranga

    Ranganathan wrote:
    Hi All
    My requirement is like this, i receive a daily a file which are having transaction realted data,
    For ex: The first row will also have the transaction num and the second and third rows will be transaction realted infomation and in the 4th record i will have new transaction num and the following rows are realted to 2nd trans num details In the flat file i able to identify which record is transn num related data, now the issue will be the following will not have the transaction num informations, blindly 2 and 3 rows are having transaction num1 info only
    TRAN123
    'SALE'
    '450'
    TRAN245
    'SALE'
    '123'
    my output : TRAN123 is having a sale of 450 and TRAN245 is having a sale 123
    For this i need to read the data from the flat file by an order only
    Thanks
    RangaUTL_FILE
    but consider using EXTERNAL TABLE instead

  • Saving and Loading variables in a .txt file (Offline)

    I'm working a software we've done with Flash, but we'd want
    people to be able to save the variables they selected. We need them
    to be able to save the value of about 10 variables in a file on
    their desktop, and then be able to load that file again.
    Is it possible to do that without having to use php or stuff
    like that (that's why we want to make it an offline applications so
    we don't have to use php to be able to save files).
    I know Actionscript looks a lot like Javascript and with
    Javascript it's really easy to do, but all the saving functions are
    blocked in Flash for security reasons.
    If anyone knows how to do that, to simply save and load a
    .txt file, please let me know. If it would be possible also to
    change the .txt to whatever else it would be even better. The file
    can still be opened in Notepad but at least it looks a bit more
    professionnal to have our own extension. Again in Javascript or
    with a .bat file it's really easy to save variables to whatever
    type of file, even to non existing types, it simply creates a text
    file with an unknown ending.
    Thanks!

    I found a page that explains in a really easy way how to
    communicate with Javascript if the flash object is contained in an
    html page, but I couldn't find any page explaining how it works if
    it's not in an html page. On our side, before using the software
    we're creating we'll convert it to a .exe. How can we call a
    Javascript from that .exe since we can't incorporate the Javascript
    in the container since there isn't really a container... Is there a
    way to link to a Javascript (.js) that would be in the same folder
    as the .exe? Or would there be a way to incorporate the Javascript
    right into the .exe?
    Let me know if any of you have a solution for that.
    Thanks!
    http://livedocs.adobe.com/flash/9.0/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=Liv eDocs_Parts&file=00000342.html#wp126566

  • Loading of JSP files run as rwservlet.

    When I look at the trace file of the .jsp report run as rwservlet, I noticed that a major percent of time is spent in the generation and creation of JSP parser and XML definitions.
    How can I pre-compile and load the class files rather than compiling and loading every time the report is accessed? Is there a setting in the config file or a command line option?

    Murali,
    You are right, a precomplie option would be available in next release
    Thanks
    The Oracle Reports team

  • Problem with loading  data from file in ../demo/file/test

    hi there,
    I am using ODI to load text files located on a UNIX server where ODI is installed.
    I am using the FILE_GENERIC data server and physical schema that came with ODI and I can reverse and load the demo files located in ../demo/file
    I created a sub-directory 'test' under ../demo/file and placed a file there.
    When I try to reverse this file (in directory ../demo/file/test) I get the error 'The directory ../demo/file/test specified in your schema does not exist'
    I am sure the userid has equal rights to both directories ../demo/file and ../demo/file/test
    What could I be missing?

    In the topology manager
    1. in the logical architecture : If it doesn't already exists (it should exist if your can use it on your local PC), you import the file technology
    2. In the physical architecture, you create your data server for files .In your case, it shoud already exist for same reason as above. Is has a blue icon under the file technology
    2. Select the Data Server, right click and select Insert Physical Schema . The Physical Schema window appears. On Definition tab, enter a name and then the path of your directory in the data schema field. No need to enyter a work schema for files.
    4. Go to the Context tab, Select a Context and an existing Logical Schema for this new Physical Schema.
    Select an existing Context in the left column, the type the name of a Logical Schema in the right column. This Logical Schema is automatically created and associated to this physical schema in this context.
    It should work but i have never experienced it on a Linux system...

  • Load JP2 image file with GeoRasterLoader

    Hi to all,
    We are trying to set up Oracle GeoRaster tools (stand-alone client-side java Executables found in %ORACLE_HOME%\md\...) in order to view and load JP2 image files to Oracle.
    Our test environment has Oracle 11g r2 (11.2.0.3.0) EE with Spatial Option on Microsoft Windows XP Professional 2002 SP3.
    Following the instructions for loading JP2 we download and install jai_imageio-1_1-lib-windows-i586.exe from: http://download.java.net/media/jai-imageio/builds/release/1.1/
    1.     Please find an example of the command we use to invoke GeoRasterLoader from command line:
    java oracle.spatial.georaster.tools.GeoRasterLoader SE004 ORCL 1521 RD RD thin 32 T OKXE_ORTHOS GEORASTER "blocking=true blocksize=(256,256,3) spatialExtent=TRUE" "C:\Temp\0458041985\0458041985.jp2,1,OKXE_ORTHOS_RDT,C:\Temp\0458041985\0458041985.j2w,2100"
    Got connection
    Loading image: C:\Temp\0458041985\0458041985.jp2
    java.lang.NullPointerException
    at oracle.spatial.georaster.rasterio.JGeoRasterAdapter.setSRS(JGeoRasterAdapter.java:4509)
    at oracle.spatial.georaster.rasterio.JGeoRasterAdapter.setMetadataStream(JGeoRasterAdapter.java:4520)
    at oracle.spatial.georaster.rasterio.JGeoRasterAdapter.storeFromStream(JGeoRasterAdapter.java:4921)
    at oracle.spatial.georaster.rasterio.GeoRasterAdapter.doImport(GeoRasterAdapter.java:632)
    at oracle.spatial.georaster.rasterio.GeoRasterAdapter.loadFromFile(GeoRasterAdapter.java:1863)
    at oracle.spatial.georaster.tools.GeoRasterLoader.load(GeoRasterLoader.java:458)
    at oracle.spatial.georaster.tools.GeoRasterLoader.main(GeoRasterLoader.java:243)
    java.lang.NullPointerException: null
    The georaster object is not loaded correctly!!
    Loader Finished.
    2.     When using the GeoRaster Viewer for retrieving jp2 file from file we get an error message “ Can’t load Image” The error messages that appear in the command prompt are as follows:
    C:\Oracle\product\11.2.0\dbhome_1\md\demo\georaster\java>java -Xms128m -Xmx564m oracle.spatial.georaster.tools.GeoRasterTool
    java.lang.RuntimeException: - Unable to render RenderedOp for this operation.
    at javax.media.jai.RenderedOp.createInstance(RenderedOp.java:827)
    at javax.media.jai.RenderedOp.createRendering(RenderedOp.java:867)
    at javax.media.jai.RenderedOp.getWidth(RenderedOp.java:2179)
    at oracle.spatial.georaster.tools.GeoRasterTool.actionPerformed(GeoRasterTool.java:1471)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
    at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
    at javax.swing.AbstractButton.doClick(AbstractButton.java:302)
    at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1051)
    at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1092)
    at java.awt.Component.processMouseEvent(Component.java:5517)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3135)
    at java.awt.Component.processEvent(Component.java:5282)
    at java.awt.Container.processEvent(Container.java:1966)
    at java.awt.Component.dispatchEventImpl(Component.java:3984)
    at java.awt.Container.dispatchEventImpl(Container.java:2024)
    at java.awt.Component.dispatchEvent(Component.java:3819)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
    at java.awt.Container.dispatchEventImpl(Container.java:2010)
    at java.awt.Window.dispatchEventImpl(Window.java:1791)
    at java.awt.Component.dispatchEvent(Component.java:3819)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
    PS. He have no problems in viewing and loading other type of image files like tif
    TIA,
    George

    Hi Tomek,
    3 to 4 MB with the following image header. Anyway, we also tried jp2 image files from other sources
    Thanks,
    BR / George
    Output from Display Header
    File Name: I:\Okxe\Orthos_June\0438042165\0438042165.jp2
    File Information:
    Standard : : Jpeg 2000 File
    Format : Lossless JPEG 2000 compression
    Pixels per Line : 1600
    Number of Lines : 1200
    Samples per pixel : 3
    File bits per sample : 8
    Actual bits per sample : 8
    Untiled file
    Number of overviews : 5
    Overview sampling method: Gaussian
    Scanning device resolution : 84 : microns
    Orientation : 4 : Row major order, origin at top left
    NO scan line headers : non-scannable file
    Packet size (16-bit words) : 0
    Free vlt space (16-bit words) : 0
    Free packet space (16-bit words) : 0
    Raster to UOR matrix:
    Identity Matrix (ones on the diagonal, zero otherwise)
    Raster to World Matrix:
    Units: Unknown or Unspecified
    amx[ 0]= 0,25, amx[ 1]= 0, amx[ 2]= 438000
    amx[ 3]= 0, amx[ 4]= -0,25, amx[ 5]= 4216800
    438000 , 4216800
    438400 , 4216800
    438400 , 4216500
    438000 , 4216500
    Geotiff_Information:
    Version: 1
    Key_Revision: 1.0
    Tagged_Information:
    ModelTiepointTag (2,3):
    0 0 0
    438000 4216800 0
    ModelPixelScaleTag (1,3):
    0.25 0.25 0
    End_Of_Tags.
    Keyed_Information:
    GTRasterTypeGeoKey (Short,1): RasterPixelIsArea
    End_Of_Keys.
    End_Of_Geotiff.
    Corner Coordinates:
    Upper Left ( 438000.000, 4216800.000)
    Lower Left ( 438000.000, 4216799.750)
    Upper Right ( 438000.250, 4216800.000)
    Lower Right ( 438000.250, 4216799.750)
    Center ( 438000.125, 4216799.875)

  • Save and load variables in java

    Hi ,
    I need a help about Save and load .
    I have a project(tool) which have JText, JRadioButton and other things also.
    I want to save all the changes for the next execution ( fresh startup or fresh bring up of the tool).
    Please let me know what will be the better way to save and load.
    can i get below use of C# in Java similar way ( below one is the C# code)
    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "9.0.0.0")]
        internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
            private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
            public static Settings Default {
                get {
                    return defaultInstance;
            [global::System.Configuration.UserScopedSettingAttribute()]
            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
            [global::System.Configuration.DefaultSettingValueAttribute("PATH")]
            public string SourceDirectory {
                get {
                    return ((string)(this["SourceDirectory"]));
                set {
                    this["SourceDirectory"] = value;
    }Can i do Strore and load without any File storage?
    Thanks in advance

    Assuming you are deploying applet or webstart than perhaps you can use PersistenceService?
    http://download-llnw.oracle.com/javase/1.5.0/docs/guide/javaws/developersguide/examples.html#PersistenceService

  • Why won't CS6 load a project file?

    Here's my problem, I have one really big project and Premiere opens it just fine. But once it begins to load it eventually freezes. I've tried moving the files off an external drive onto my local drive, I've tried to delete some of the files in case the project just has too much memory used & I've tried to clean out the media cache folders. Nothing is solving the problem, what do you guys think might be the problem?

    If those externals are USB that could definitely be an issue. USB3 can sustain read speeds to hold say footage but the read-write issues of having anything other than footage on one is a problem. If you've got a project file or cache files over USB3, it's very problematic.
    Also, your RAM and CPU cycle speed are both on the low end of usability for practical things. Could run CS6 okay but won't really do too well with the CC versions. Like me, you've got a quad-core machine, more cores & faster bus speeds are better. Sigh.
    The Tweakers Page is a great resource ... some of the all-time HUGE participants on these forums put together a series of real-world tests of the Adobe DVA's run through computers ... they have a file you download & it's got a resource monitoring program and a PrPro project file that's not "long" but is loaded with PrPro & AfterEffects stuff that is designed to test every part of your computer ... CPU, front-side bus & disc-access speeds, RAM & GPU/vRAM use, disc-in/out, all of it. A lot of people have run this and loaded the log-files back up to their site so they have real-world data on different computer parts & combinations and how they actually work.
    Tweaker's Page ...
    http://ppbm7.com/index.php/tweakers-page
    Among other stuff there, they've got some great info on how to "array" your video "stuff" ... from OS, program, and project file locations on the computer to where cache files, previews, database, and footage should be placed on systems ranging from two drives to mega-drives. Project files, cache files, database ... all have a ton of read-write cycles, and so need fast access both in/out. Spreading these files out on multiple internal drives or a combo of internal/external using eSATA & Thunderbolt connections for the externals is recommended ... or putting them all on a RAID 0 4/5 disc array of say 2 Tb drives. Internal SSD discs (secondary, not the system or C drive) for cache/previews/database is also good.
    Footage files need mostly simple read-times & data transport, so they can be on say a USB3 external and be acceptable, and say export files also can be on such a drive.
    Depending on the connections to your externals, you may need to say move project files internal (even if on the same as the system, not optimal) and leave the footage on the externals. But reading up a bit might give you some ideas on how to proceed ...
    Neil

  • Creating the outline and Loading data for TBC in 11.1.2.2

    Hi all, feelin kinda dumb here because this task really should not be as difficult as it seems.
    I am trying to Load the TBC application in 11.1.2.2 Essbase. I have followed the documentation to
    1. Install EIS
    2. create the metadata repository and load the xml file provided
    I now need to create the essbase cube from this metadata repository, I cannot seem to find any real steps as to how to do this, everything I found was pertaining to creating the repository. Can anyone help define what needs to be done and what steps I need to take, I am new to EIS and Studio so the simpler the better :)
    thanx

    thanx, this did give me a better understanding of essbase studio, thank you. It did not help so much as getting the structure and data from the repository into essbase. For that from what I understand I can import models from EIS (where I loaded the TBC) one. In doing this I get an error saying that it cannot find any models (which I know are there because I can look at them in EIS. Unfortunately, looking over other posts, I installed Studio on a 64 bit server, which may be the issue I am facing (I hope)
    I am going to try and reinstall studio on a 32 bit platform and try the import again.

  • How to save data and load data from an arrayList ??

    i got a run time problem .....when i try to save my data to a file and load a data from a file....i got some kind of error like that
    Please enter your CD`s title : ivan
    Please enter your CD`s Artist/GroupName : diw
    Please enter your CD`s year of release : wid
    InputMismatchException error occurred (the next token does not match the Integer regular expression, or is out of range) java.util.InputMismatchException
    Invaild value....Please enter the value between 1000 & 9999
    Please enter your CD`s MusicGenre(e.g.: Jazz, Blues, Funk, Classical, Rock, etc...) : w
    Please enter your CD`s comment : w
    Do you have another Cd ? (Y/N) : n
    Saving to file
    java.io.EOFException
         at java.io.ObjectInputStream$BlockDataInputStream.peekByte(Unknown Source)
         at java.io.ObjectInputStream.readObject0(Unknown Source)
         at java.io.ObjectInputStream.readObject(Unknown Source)
         at Demo.loadDate(Demo.java:49)
         at Demo.readDataFromConsole(Demo.java:103)
         at Demo.main(Demo.java:173)
    Exit code: 0
    import java.util.ArrayList;
    import java.io.*;
    public class Demo{
         readOperation theRo = new readOperation();
         errorCheckingOperation theEco = new errorCheckingOperation();
         ArrayList<MusicCd> MusicCdList;
         public Demo()
         private void heading()
              System.out.println("\tTesting read data from console, save to file, reopen that file\t");
         private void saveDate()
              MusicCdList = new ArrayList<MusicCd>( ); 
              try
                   File f = new File("jessica.txt");
                   FileOutputStream fos = new FileOutputStream(f);
                   ObjectOutputStream oos = new ObjectOutputStream(fos);
                   for( MusicCd s : MusicCdList)
                   oos.writeObject(s);
                   oos.close();
              catch (IOException ioe)
                   ioe.printStackTrace();
         private void loadDate()
              MusicCdList = new ArrayList<MusicCd>( );  
              try
                   File g = new File("jessica.txt");
                   FileInputStream fis = new FileInputStream(g);
                   ObjectInputStream ois = new ObjectInputStream(fis);
                   ArrayList<String> stuff = (ArrayList<String>)ois.readObject();
                   for( String s : stuff ) System.out.println(s);
                   ois.close();
              } catch (Exception ioe)
                   ioe.printStackTrace();
         private void readDataFromConsole()
         //private void insertCd()
           ArrayList<MusicCd> MusicCdList = new ArrayList<MusicCd>( ); 
            readOperation theRo = new readOperation();
            errorCheckingOperation theEco = new errorCheckingOperation();
            MusicCd theCd;
            String muiseCdsTitle;
            String muiseCdsArtistOrGroupName;
            int muiseCdsYearOfRelease;
            int validMuiseCdsYearOfRelease;
            String muiseCdsMusicGenre;
            String muiseCdsAComment;
              while(true)
                    String continueInsertCd = "Y";
                   do
                        muiseCdsTitle = theRo.readString("Please enter your CD`s title : ");
                        muiseCdsArtistOrGroupName = theRo.readString("Please enter your CD`s Artist/GroupName : ");
                        muiseCdsYearOfRelease = theRo.readInt("Please enter your CD`s year of release : ");
                        validMuiseCdsYearOfRelease = theEco.errorCheckingInteger(muiseCdsYearOfRelease, 1000, 9999);
                        muiseCdsMusicGenre = theRo.readString("Please enter your CD`s MusicGenre(e.g.: Jazz, Blues, Funk, Classical, Rock, etc...) : ");
                        muiseCdsAComment  = theRo.readString("Please enter your CD`s comment : ");
                        MusicCdList.add(new MusicCd(muiseCdsTitle, muiseCdsArtistOrGroupName, validMuiseCdsYearOfRelease ,
                        muiseCdsMusicGenre, muiseCdsAComment));
                        MusicCdList.trimToSize();
                        //saveToFile(MusicCdList);
                        continueInsertCd = theRo.readString("Do you have another Cd ? (Y/N) : ");
                   }while(continueInsertCd.equals("Y") || continueInsertCd.equals("y") );
                   if(continueInsertCd.equals("N") || continueInsertCd.equals("n"));
                                        System.out.println("Saving to file ");
                                                    //MusicCdList.add(new MusicCd(muiseCdsTitle, muiseCdsYearOfRelease));     
                                                    saveDate();
                                        loadDate();
                                  break;
         public static void main(String[] args)
              Demo one = new Demo();
              one.readDataFromConsole();
              how should i fix it if i want to reach the save to a file and load from a file purpose??
    thx all
    for much more understand of this program
    import java.io.Serializable;
    public class MusicCd implements Serializable
         private String musicCdsTitle;
         private String artistOrGroupName;
            private int yearOfRelease;
         private String musicGenre;
         private String aComment;
         public MusicCd()
              musicCdsTitle = "";
              artistOrGroupName = "";
              yearOfRelease = 1000;
              musicGenre = "";
              aComment = "";
         public MusicCd(String newMusicCdsTitle, String newArtistOrGroupName, int newYearOfRelease,
         String newMusicGenre, String aNewComment)
              musicCdsTitle = newMusicCdsTitle;
              artistOrGroupName = newArtistOrGroupName;
              yearOfRelease = newYearOfRelease;
              musicGenre = newMusicGenre;
              aComment = aNewComment;
         public String getTitle()
              return musicCdsTitle;
         public String getArtistOrGroupName()
              return artistOrGroupName;
         public int getYearOfRelease()
              return yearOfRelease;
         public String getMusicGenre()
              return musicGenre;
         public String getAComment()
              return aComment;
         public void setTitle(String newMusicCdsTitle)
              musicCdsTitle = newMusicCdsTitle;
         public void setArtistOrGroupName(String newArtistOrGroupName)
              artistOrGroupName = newArtistOrGroupName;
         public void setYearOfRelease(int newYearOfRelease)
              yearOfRelease = newYearOfRelease;
         public void setMusicGenre(String newMusicGenre)
              musicGenre = newMusicGenre;
         public void setAComment(String aNewComment)
               aComment = aNewComment;
         public boolean equalsName(MusicCd otherCd)
              if(otherCd == null)
                   return false;
              else
                   return (musicCdsTitle.equals(otherCd.musicCdsTitle));
         public String toString()
              return("Title: " + musicCdsTitle + "\t"
              + "Artist/GroupName: " + artistOrGroupName + "\t"
              + "Year of release: " + yearOfRelease + "\t"
              + "Music Genre: " + musicGenre + "\t"
              + "Comment: " + aComment + "\t" );
    }import java.util.*;
    public class readOperation{
         public String readString(String userInstruction)
              String aString = null;
              try
         Scanner scan = new Scanner(System.in);
                   System.out.print(userInstruction);
                   aString = scan.nextLine();
              catch (NoSuchElementException e)
                   //if no line was found
                   System.out.println("\nNoSuchElementException error occurred (no line was found) " + e);
              catch (IllegalStateException e)
                   // if this scanner is closed
                   System.out.println("\nIllegalStateException error occurred (scanner is closed)" + e);
              return aString;
         public char readTheFirstChar(String userInstruction)
              char aChar = ' ';
              String strSelection = null;
              try
                   //char charSelection;
         Scanner scan = new Scanner(System.in);
                   System.out.print(userInstruction);
                   strSelection = scan.next();
                   aChar = strSelection.charAt(0);
              catch (NoSuchElementException e)
                   //if no line was found
                   System.out.println("\nNoSuchElementException error occurred (no line was found) " + e);
              catch (IllegalStateException e)
                   // if this scanner is closed
                   System.out.println("\nIllegalStateException error occurred (scanner is closed)" + e);
              return aChar;
         public int readInt(String userInstruction) {
              int aInt = 0;
              try {
                   Scanner scan = new Scanner(System.in);
                   System.out.print(userInstruction);
                   aInt = scan.nextInt();
              } catch (InputMismatchException e) {
                   System.out.println("\nInputMismatchException error occurred (the next token does not match the Integer regular expression, or is out of range) " + e);
              } catch (NoSuchElementException e) {
                   System.out.println("\nNoSuchElementException error occurred (input is exhausted)" + e);
              } catch (IllegalStateException e) {
                   System.out.println("\nIllegalStateException error occurred (scanner is closed)" + e);
              return aInt;
    import java.util.Scanner;
    import java.util.InputMismatchException;
    import java.util.NoSuchElementException;
    public class errorCheckingOperation
         public int errorCheckingInteger(int checkThing, int lowerBound, int upperBound)
               int aInt = checkThing;
               try
                    while((checkThing < lowerBound ) || (checkThing > upperBound) )
                         throw new Exception("Invaild value....Please enter the value between  " +  lowerBound + " & " +  upperBound );
               catch (Exception e)
                 String message = e.getMessage();
                 System.out.println(message);
               return aInt;
           public int errorCheckingSelectionValue(String userInstruction)
                int validSelectionValue = 0;
                try
                     int selectionValue;
                     Scanner scan = new Scanner(System.in);
                     System.out.print(userInstruction);
                     selectionValue = scan.nextInt();
                     validSelectionValue = errorCheckingInteger(selectionValue , 1, 5);
               catch (NoSuchElementException e)
                   //if no line was found
                   System.out.println("\nNoSuchElementException error occurred (no line was found) " + e);
              catch (IllegalStateException e)
                   // if this scanner is closed
                   System.out.println("\nIllegalStateException error occurred (scanner is closed)" + e);
              return validSelectionValue;
    }Message was edited by:
    Ivan1238
    Message was edited by:
    Ivan1238

    You should thoroughly check you code. It's full of problems.
    For example in saveDate():
    You create a new empty ArrayList and then want so save it's contents. I guess, the file size is always 0.
    For example in loadDate():
    Since you read from an empty file you get an EOFException. This is ok and you should catch and treat the exception properly.
    You try to read the ArrayList instead of single MusicCd objects, although in saveDate you saved the single MusicCD objects. You can only read from the file what to saved in it before.
    I suggest to write the size of the ArrayList as first object in the file. Then you know how much you can expect to read when loading from the file.
    private void saveDate()
              try
                   File f = new File("jessica.txt");
                   FileOutputStream fos = new FileOutputStream(f);
                   ObjectOutputStream oos = new ObjectOutputStream(fos);
                            oos.writeObject(new Integer(MusicCdList.size()));
                   for( MusicCd s : MusicCdList)
                   oos.writeObject(s);
                   oos.close();
              catch (IOException ioe)
                   ioe.printStackTrace();
         }

Maybe you are looking for

  • Ipod not seen on computer or iTunes, and has no icon while loading...

    my iPod Video 30GB has worked fine on my PC since I got it, and everytime I plugged it into my PC, the iPod screen displayed the message "Do not disconnect the USB cable". Just some few days ago, the message was not displayed at all, and the iPod was

  • File share with my friends computer across the internet.

    Hello, so my friend recently got a mac (changed from windows) and i was wondering can i set up file sharing with him? I have created an "Online HD" in my sharing folder, so how can he access it? thanks Aries

  • Deletion of accounts in BCS

    Dear experts, I would like to delete about 100 accounts in BCS (we don't use them anymore). I know how to do it account by account (T code ucwb > context menu : delete), but this process is very long for 100 accounts. Maybe does anyone know a hint to

  • Ipad video sharing graphic

    Has anyone had an issue when looking at the shared movies / videos on the ipad and the artwork doesn't match the movie? It's frustrating when there is only the thumbnail picture without the title text. Thanks

  • Select box problem (option selected)

    I have the following code: <td><p>Topic:</p> <% try Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); String sourceURL = "jdbc:odbc:my_Library"; Connection databaseConnection = DriverManager.getConnection(sourceURL); Statement statement = databaseConnec