-1

Still having some issues with my code. No errors this time, its just not functioning properly!

here's the code: http://pastebin.com/nm633L1v

What's not working (I think):

fileWriter
jTable

3rd Party Libraries:

OpenCSV

filechooser.FileFilter :

just going to remove this from my code. I do not think it is necessary any more.

fileWriter :

This may be a side effect of jTable not displaying the contents of the CSV file for editing, but it doesn't seem to save or update the file when the program calls on it.

jTable :

This was throwing all the errors earlier, and may be the REAL McFly for all my issues. Not displaying the input CSV file, or saving the contents of the Table if I do stick random junk in the columns.

I know that it is a bunch of different code issues, but it is the one problem for me right now before I move on or pass off the project to another person, so any help here would be greatly appreciated!

ccreason
  • 189
  • 1
  • 7
  • 2
    Please restrict your code sample to a relevant portion. The ideal sample is [short, self-contained and compilable](http://sscce.org/). Reading through an entire source code is time-consuming, and will net you less answers. – David B Aug 20 '12 at 16:23
  • 1
    ...and often, in the process of reducing your own code (cutting out the "irrelevant" bits) you often end up triangulating where the problem is, and solving your own question. It's happened to me many times. – Andrzej Doyle Aug 20 '12 at 16:26
  • 1
    Voted to close as "overly broad". I think there are three questions here. As @AndrzejDoyle says, the activity of synthesizing it into those three questions will probably lead you to the answer to one or more. – slim Aug 20 '12 at 16:31
  • Agree, you need to put in some effort to try to first isolate the problems -- this means testing components of your program in isolation. – Hovercraft Full Of Eels Aug 20 '12 at 16:37
  • The reason I put them all in the same question is because of how they are all tied together in this project I am working on. As to the bit about shortening the sourcecode, I am not really sure how to do that and leave the problematic areas more-or-less intact, thanks to the haphazard way Netbeans throws its premade code in. Also, I am rather new at all of this coding business :( – ccreason Aug 20 '12 at 16:44
  • 1
    Euhm, to split of the file chooser problem in a separate question should be easy (and can include an SSCCE). And for your other 2 questions: if you first investigate the issues a bit further yourself, you can probably isolate the problematic part and ask a more concrete question then "what is wrong in these xxx lines of code" (where xxx is way too large) – Robin Aug 20 '12 at 16:50
  • @ccreason: realize that many of us have firewalls that don't allow us to see your pastebin code. But regardless, it's not fair to ask volunteers to go through more code than can be posted in the forum. You're asking effort from us; you should at least show that you've put in some effort to try to split things up. This would be greatly appreciated. Please read the [sscce](http://sscce.org) link for starters. – Hovercraft Full Of Eels Aug 20 '12 at 17:07
  • Alright, sorry about that! I'll try to make an sscce. – ccreason Aug 20 '12 at 18:07

1 Answers1

2

I am not going to go through all of your code. I just gave your FileFilter a quick look.Note that you can use a FileNameExtensionFilter instead of implementing your own.

Although I must admit that your implementation looks correct to me. Unfortunately the code where you set the filter on the file chooser is not shown.

Robin
  • 36,233
  • 5
  • 47
  • 99