Stevens Miller wrote:Well... we need to see how your ResultSet is defined. Might as well go ahead and post your whole program.
Paul Clapham wrote:
tom davies wrote:The problem i have with producing the table model is it gives me null pointer exceptions so i would rather i dealt with the issue before it got that far.
Then you're doing it wrong. It should be extremely simple to create a table model and then put all of the records from the ResultSet into it. If there are no records, that shouldn't be a problem.
Paul Mrozik wrote:Okay, wait, I think I missed something here. You need actual x values, y values, and z values. In that case, I'd recommend creating a totally separate object, something like:
You can then extract x and y to plot your plane.
Paul Mrozik wrote:That looks about right, though I'd probably do the reverse in terms of variable names:
So now you need to take it one step further, for a 3d array, which means you need to go a little deeper for the z and you'll need x and y to be constant.
Paul Mrozik wrote:
tom davies wrote:Yes im aware that they will be stored [x][y][z] but i am asking how do i access them and pull them from this array.
Say i want to do the x-y plane first, could someone explain how i would get the values i want from the 3d array? is it a case of keeping the y and z values the same an getting each x value, then increment y and z by one and get the next x values? I know the dimensions of the dataset if that helps as well.
I'm assuming you mean you want to iterate the array, as in go through each item. First, perhaps it would be easier for you to start off with a 2D array and then go from there. You're right about keeping one value constant, so you'd want
x y
arr[0][0]
arr[0][1]
arr[0][2]
So you're incrementing y, while keeping x constant. Hint: Use two for loops.
Manuel Petermann wrote:For starters yes.
Anyway, You wouldn't solve your initial problem that way.
If your databaseLog would simply extend SwingWorker you would end up creating exactly as many new workers as there are files.
That is a bad idea for your problem because as far as i know most filesystems cannot read more than one file at a single point in time anyways.
The fact that a SwingWorker is limited to 10 distinct threads is just a sidenote to that.
Ps:
Think about what you also might want to do in a separate thread.
Pps:
Oh You just need 1 thread/SwingWorker for that.