Sunday, 16 February 2014

Ok....

Okay, well good news first:

I do know what I am doing and what I am supposed to do..

3 classes, one that extends JPanel; the other that extends and implements the Table stuff.

And so when I got to create the panel for the table, I should have the "new ClassNameForPanel()" inside the brackets along with the = new JPanel thing.

But for the table itself, I should go through the Panel then table because then I can send the array rather than have it being created - which would work for the "reusing" bit.

Adding Rows: To add rows, I think I'm going to do it in a JOptionPane asking each individual question when it pops up. 

Deleting Rows: I have to allow the user to select a certain row or something that they want to delete, and then have to go through the array and copy everything but that row, and then make the original array equal to the new one. 

Describing Array of Objects

So this is another thing that we need for the documentation and after accomplishing so much with what I did so far (LOL), I'll do this documentation bit.

RYK: ALL DOCUMENTATION/PARAGRAPHS REQUIRED FOR ASSIGNMENT IS IN YELLOW.

Arrays of Objects are very helpful when programming. Because an object is at the very top of the hierarchy, it can use methods from anything below it; string, double, float, integer, and more. This makes it a lot easier to compare objects because they will be of the same type. It is the same thing for a Comparable object, but I cannot use this type of Object to create a JTable, so my main focus will the Array of Objects. I created an array of objects so that all previous entries could be shown on a table where the user can choose to delete, add, or view entries. The array of objects makes this a lot easier because I can search or sort things much easier. In JTables, they have to be in a 2D array, so instead of an array of different object inside, I used just an array of objects to store all the information. It is very useful because it is easy to interact with and easy to see. 

Frame?


So the JFrame is showing up, from the original class. But I don't really know what is wrong..

*TWO HOURS LATER* 

HOLY MY CORNELIUSING FUDGE I JUST OH MY AHH! 




HOLY WHAT? It totally worked! OH MY AHHH! 

I'm so confused

I'm actually so confused, I'm not sure what is going on.

Okay, so everything that changes the array has to go into the other class. I get that.

But then..

UGH.

So I just had to make everything a class field (meaning static) in order for the bloody thing to work, but I don't know what to do next..at all O.o

Like...if I have to make the showGooey thing static, I can't because the JPanel would have to be static, and I can't make a static class ugh this is so unbelievably confusing.

Small Steps?


LOL, if you would like to call it small...I've created a table using that class. I'm not sure if it is going to help. I sure hope it is, cause I can't see the class hierarchy on this.

I'm in the process of moving the readFile and writeFile to the other class..I think the table thing is just creating an instance of all that data, so I believe it makes sense. But I'm not entirely sure. :/ 

I guess I'll find out soon...

But the process is kind of making sense now. I'm creating an array in a different class, and editing that array only in that class. So when I declare the JTable, if I use that one, the entire thing will be edited as well. If the user adds any other information, it will be handled inside the secondary class, not the primary. But DANG, that's confusing. 

Saturday, 15 February 2014

Confusing

Okay, yeah, now THIS is getting confusing. In JTables, you have to create and update the array within the class, you cannot outside of it, so I'm going to have to create everything that has to do with the table inside the MyTable method.

Which means anything to do with methods, and then I can call it from the original class.

Dang, that's confusing - but there are always confusing things here and there, aren't there? :(

Until tomorrow then..not going to finish anything in this state of mind.

HOLY!

Wow. That's amazing. I'm already done converting everything into a 2 dimensional array! I thought it would take a lot longer, but pop and it's done + 2 minutes or so for solving a Rubiks Cube! Good chance to get started on programming the JTable then :)