Haven't posted in a while...was busy doing other things. One thing I forgot to mention last time - I created a user manual - going to add different icons later.
Another thing I have to do is create a colour scheme of the buttons and different components. Which, I still haven't exactly thought about yet. That's my problem though, Harry Potter never exactly has a colour scheme, and I feel like the dark colours would represent Voldemort while the light colours would represent Harry. But when Ryk says he wants a colour scheme..hmm...
I could create an ImageIcon for the continue button, though! Like just using the house crests or house banners for the button. I think I'm going to do that.
But then comes the problem for the colour of the text. +Vivian suggested green..that's a good idea. I think I'll make the text green (like Harry's eyes)....BOOK Harry - not MOVIE Harry!
I also updated Beedle the Bard! :D
Monday, 28 October 2013
Friday, 18 October 2013
Oh my fail!
I've only just realized that I should have set all the variables in my Category Method to private! I won't show I know a thing without doing that. So sigh, yeah, I'm changing stuff..now. Anyways, it will help study for the test, hopefully. Still confused about linked lists though.
Wednesday, 16 October 2013
BLOODY AWESOME! :O
RYK JUST DID HIS THING AGAIN!
THAT THING!
YOU KNOW THAT THING...WHERE YOU SPEND LIKE...MORE THAN AN HOUR TRYING TO FIX CODE?
AND THEN YOU MESSAGE HIM...
…
…
…
…
…
…
OR EMAIL HIM?
…
…
…
…
…
…
…
…
…
…
And he's just like, "Your brace bracket is in the wrong place"
…
…
Or "You've got a semicolon there."
…
…
…
…
HOW?????????????
THAT THING!
YOU KNOW THAT THING...WHERE YOU SPEND LIKE...MORE THAN AN HOUR TRYING TO FIX CODE?
AND THEN YOU MESSAGE HIM...
…
…
…
…
…
…
OR EMAIL HIM?
…
…
…
…
…
…
…
…
…
…
And he's just like, "Your brace bracket is in the wrong place"
…
…
Or "You've got a semicolon there."
…
…
…
…
HOW?????????????
Hurray!
So I'm done programming the way that Ryk showed me to do it using the one category class..
But then for high scores, I don't have a clue how to program that..:3
I asked him, and he said that I had to learn sorting which is either unit 3 or unit 4 and now I'm just so confused O_O Cause there are so many different types of sorting and now I'm just kind of like, "O_O"
Anyways, to prevent the user from going below 0, I'm going to have a boolean inside each of the if statements (if it becomes zero). The default value will be false (because the default value is never zero). And it will be set to true in each if statement. At the beginning of the if statement:
if (isZero == true)
{
Display a JOptionPane asking the user whether they would like to continue or not.
if (they want to continue)
{
restart the score variable.
restart the isZero variable.
call the initialize method.
}
else
{
thank the user for playing.
System.exit(0);
}
}
But then for high scores, I don't have a clue how to program that..:3
I asked him, and he said that I had to learn sorting which is either unit 3 or unit 4 and now I'm just so confused O_O Cause there are so many different types of sorting and now I'm just kind of like, "O_O"
Anyways, to prevent the user from going below 0, I'm going to have a boolean inside each of the if statements (if it becomes zero). The default value will be false (because the default value is never zero). And it will be set to true in each if statement. At the beginning of the if statement:
if (isZero == true)
{
Display a JOptionPane asking the user whether they would like to continue or not.
if (they want to continue)
{
restart the score variable.
restart the isZero variable.
call the initialize method.
}
else
{
thank the user for playing.
System.exit(0);
}
}
Sunday, 13 October 2013
Text File
Okay, so here's to starting the "new" program. It should look the exact same (I haven't had time to update Beedle the Bard just yet) - but anyways, I think I posted about it earlier, but the questions won't be hardcoded into the program anymore. They will be something like this:
Category
Question1
Answer1
answered1
Fact1
Question2
...etc.
So it will all be read in from the file - and all I have to do is check whether something is equal (or contains) whatever the answer1 is. It will all be done using 1 class: category.
CHARACTER
7 knut: 0
17 knut: 1
47 knut: 2
77 knut: 3
97 knut: 4
297 knut: 5
777 knut: 6
STORY
7 knut: 7
17 knut: 8
47 knut: 9
77 knut: 10
97 knut: 11
297 knut: 12
777 knut: 13
BEEDLE
7 knut: 14
17 knut: 15
47 knut: 16
77 knut: 17
97 knut: 18
297 knut: 19
777 knut: 20
QUOTE
7 knut: 21
17 knut: 22
47 knut: 23
77 knut: 24
97 knut: 25
297 knut: 26
777 knut: 27
HOUSES
7 knut: 28
17 knut: 29
47 knut: 30
77 knut: 31
97 knut: 32
297 knut: 33
777 knut: 34
SPELLS
7 knut: 35
17 knut: 36
47 knut: 37
77 knut: 38
97 knut: 39
297 knut: 40
777 knut: 41
CAST
7 knut: 42
17 knut: 43
47 knut: 44
77 knut: 45
97 knut: 46
297 knut: 47
777 knut: 48
Category
Question1
Answer1
answered1
Fact1
Question2
...etc.
So it will all be read in from the file - and all I have to do is check whether something is equal (or contains) whatever the answer1 is. It will all be done using 1 class: category.
CHARACTER
7 knut: 0
17 knut: 1
47 knut: 2
77 knut: 3
97 knut: 4
297 knut: 5
777 knut: 6
STORY
7 knut: 7
17 knut: 8
47 knut: 9
77 knut: 10
97 knut: 11
297 knut: 12
777 knut: 13
BEEDLE
7 knut: 14
17 knut: 15
47 knut: 16
77 knut: 17
97 knut: 18
297 knut: 19
777 knut: 20
QUOTE
7 knut: 21
17 knut: 22
47 knut: 23
77 knut: 24
97 knut: 25
297 knut: 26
777 knut: 27
HOUSES
7 knut: 28
17 knut: 29
47 knut: 30
77 knut: 31
97 knut: 32
297 knut: 33
777 knut: 34
SPELLS
7 knut: 35
17 knut: 36
47 knut: 37
77 knut: 38
97 knut: 39
297 knut: 40
777 knut: 41
CAST
7 knut: 42
17 knut: 43
47 knut: 44
77 knut: 45
97 knut: 46
297 knut: 47
777 knut: 48
Thursday, 10 October 2013
Falallalalalalalalaaaaaa.
Whatever I've programmed should look the same, it's just that whatever is inside the program will change..a lot.
Sunday, 6 October 2013
This isn't working very well...
It's almost..blinding! And worse, the Beedle the Bard numbers didn't even show. I've used I don't even know how many setSize methods, and neither of them are working. I don't want to re-screenshot them again, but it almost looks like I have to - at least just the Beedle the Bard one.
The original pictures looked good! That was if their heads weren't all chopped off...
There's another thing to ask Ryk!
Holy cow :o
I thought one row would take a lot longer! But I'm already done the second row of questions (17 knuts). I am debating whether I should go on programming the third row of questions, or start designing the buttons for the titles at least.
Ah well, I think I'm going to go designing the buttons now :P
Okay, I finished one out of 56 buttons :P
Ah well, I think I'm going to go designing the buttons now :P
Okay, I finished one out of 56 buttons :P
I'll have to think a lot more about the other ones. XD Spells and those ones seem harder to make...
Done 8 questions
So I've finished 8 questions so far. I think I'll finish the second row of questions by the end of the day cause I still have to study for the data quiz and all. Anyways, so the whole 'private' and 'public' is not working. I'm not sure why. According to the D2L website, protected can be accessed from any file in that package - and they are all in the jeopardy package. So that's one thing I'll have to ask Ryk - along with how to get the score to update at the top of the program instead of constantly just reading '0'. Cause the value has clearly changed..it's just that I'm not sure how to update it. Unless I have to re-add it. That's semi-pointless, though.
Anyways, sigh. Back to programming ;)
Characters: Main characters in a collage
Storyline: ?
Beedle the Bard: Deathly Hallows Symbol
Quotes: The textbook in DADA in 3rd year (The one that Snape asked them to turn to page 394 with).
Houses: 4 main house ghosts (like Nearly Headless Nick), house crests.
Spells: Different wands (ie: horse tail or phoenix, etc), "Wingardium Leviosa"
Actors of the Cast: All the young actors when they tried out.
For the values, I'll just use the same picture and put a different number on it (ie: 7, 17, etc).
I think I'm going to try to make a splash screen this time, considering I'm (almost) done the second row of the questions - tomorrow, I should be done the third row, and I'll just do a row a day. <-- It's not even like it's due this month, I'm not sure why I'm rushing it, but it's fun to program it. After it's done, I'll have quite a bit of time to make it look good, and everything. Not to mention adding a menu bar for instructions, versions, etc.
Anyways, sigh. Back to programming ;)
Characters: Main characters in a collage
Storyline: ?
Beedle the Bard: Deathly Hallows Symbol
Quotes: The textbook in DADA in 3rd year (The one that Snape asked them to turn to page 394 with).
Houses: 4 main house ghosts (like Nearly Headless Nick), house crests.
Spells: Different wands (ie: horse tail or phoenix, etc), "Wingardium Leviosa"
Actors of the Cast: All the young actors when they tried out.
For the values, I'll just use the same picture and put a different number on it (ie: 7, 17, etc).
I think I'm going to try to make a splash screen this time, considering I'm (almost) done the second row of the questions - tomorrow, I should be done the third row, and I'll just do a row a day. <-- It's not even like it's due this month, I'm not sure why I'm rushing it, but it's fun to program it. After it's done, I'll have quite a bit of time to make it look good, and everything. Not to mention adding a menu bar for instructions, versions, etc.
Saturday, 5 October 2013
DONE ONE QUESTION!
So this is the table in the beginning. Yes, yes, I know. It looks so bland. BUT DON'T WORRY! It'll be colourful some time :)
So when you press one of the buttons (the one that I completed is Character 7 knut question), this little frame pops up. Yes, I know. Same thing. Boring, right? Don't worry! It's going to be totally fandom coloured later on!! :) I just have to think of a colour scheme and those things. I'm thinking I might make the buttons icons instead of just saying the numbers that they are worth. But that's for another day. Trying to get the programming done first.
So, if you happen to answer the question correctly (trust me, it isn't too hard) if you choose the easiest ones, the JOptionPane pops up congratulating you. I think I'll add a personalized icon like a wand or something in that section. I'll think about it.
If you answer the question right, the JOptionPane pops up right in the middle of the screen. Hard to miss.
Then, after you have answered it, the button becomes indented meaning that you can no longer answer the same question. I mean, you can't cheat! :o
JOptionPane
I have been thinking about the JOptionPane and I've realized that it is just not worth it. I don't want my Jeopardy to be like the Monopoly where everything popped up in a JOptionPane.
So within the mouseClicked method, I'm going to bring up a brand new frame that includes the question in Harry Potter font. Although if Ryk isn't marking it on this computer, he won't see it. Well, I'll organize it later.
There is also one more thing I have to find out - is if I want the program to constantly update the score, how do I do it. Cause in the original window, I'm trying to get the score to be displayed at the top, and have it update every time a question is answered.
So within the mouseClicked method, I'm going to bring up a brand new frame that includes the question in Harry Potter font. Although if Ryk isn't marking it on this computer, he won't see it. Well, I'll organize it later.
There is also one more thing I have to find out - is if I want the program to constantly update the score, how do I do it. Cause in the original window, I'm trying to get the score to be displayed at the top, and have it update every time a question is answered.
I've also ran into another problem, which is..I create a new frame and a brand new asking questions frame in the mouseListener method. Because there is a button there, I have to add that component to the mouseListener and it doesn't seem to be working. Anyways, i just cut it and paste it to a private variable up in the class, and it worked. However, there is one more problem: when I use the variable whichQuestion, the program isn't changing the value even though I told it to in a certain method. I'm thinking that, if it is declared in the class, it will just keep redeclaring itself, so it also has to go up to the class definitions (and calling it private).
Friday, 4 October 2013
Closing the JOptionPane
I've run into another problem, which is..if the user expands one of the options, a JOptionPane pops up asking them a question. For example, the easiest one says "Name one of the people in the Golden Trio." Because it is in a JOptionPane, they have the option of either closing it or pressing 'Cancel.' The program, takes this as a "null" value for the string. So it has nullPointerException every time it does something like that.
Another thing I can do is create a new frame asking them the question and then have them enter it in a JTextField, and pop up a JOptionPane of that JTextField is empty.
Another thing I can do is create a new frame asking them the question and then have them enter it in a JTextField, and pop up a JOptionPane of that JTextField is empty.
Holy moly fail
Haha, it took me so long to find out that when I pasted the JButton array up at the top of the class (I had made it a global array) - I think I'll make it private cause the other classes have absolutely no use for it. Anyways, I copied it up the top rather than cut it then pasting it, so I was failingly editing a copy.
Button Error
Not sure what's up with the project, but after declaring the JButton, using an if statement, I found that the value of the button was still equal to null. In the program, this is pretty much what I'm doing
for (int i = 0 ; i <array.length; i++)
{
array[i] = new JButton();
}
for (int i = 0; i<array.length; i++)
{
array[i].setText(""); //setting to whatever the value should be right here. In certain instances, we need the button to say "Character" while in others, we need the button to say "7" or the rest of the numbers.
} //end of for loop.
But even with the array[i] = newJButton();, it looks as if it did not create a new JButton. It just...I'm not even sure. It just seems to have set it to null rather than anything else.
Almost at the end of the method, I wrote "array[i].addMouseListener(this)" and according to a tracing statement in this section, the whatClicked variable worked. But the program had absolutely no idea what array[i] was talking about because it was apparently set to null.
That's a good point, actually. I should check whether the Java APIs say that buttons supports "setText()". But I mean, if it wasn't supported, NetBeans would not have offered it on their list. And it does. It says that it is supported by inheritance from the Java.Abstract Button class.
I don't even. Okay, well, I'll figure it out eventually. In the meantime, I think I'll write some pseudocode (but I really highly dislike pseudocode)..maybe a user manual. Or something like that. I have an idea of how the program is going to work anyways, so..
Well, this is what the rubric says: Includes some other form of external documentation (manual, flowchart, project management, problems & solutions report, pseudo-code, etc)
But saying that, I've just finished the flowchart (as in just deleting the parts that I do not need as it isn't in the console window), problems and solutions, and the blog. That should be enough....I think I'll just put up the problems and solutions right now.
for (int i = 0 ; i <array.length; i++)
{
array[i] = new JButton();
}
for (int i = 0; i<array.length; i++)
{
array[i].setText(""); //setting to whatever the value should be right here. In certain instances, we need the button to say "Character" while in others, we need the button to say "7" or the rest of the numbers.
} //end of for loop.
But even with the array[i] = newJButton();, it looks as if it did not create a new JButton. It just...I'm not even sure. It just seems to have set it to null rather than anything else.
Almost at the end of the method, I wrote "array[i].addMouseListener(this)" and according to a tracing statement in this section, the whatClicked variable worked. But the program had absolutely no idea what array[i] was talking about because it was apparently set to null.
That's a good point, actually. I should check whether the Java APIs say that buttons supports "setText()". But I mean, if it wasn't supported, NetBeans would not have offered it on their list. And it does. It says that it is supported by inheritance from the Java.Abstract Button class.
I don't even. Okay, well, I'll figure it out eventually. In the meantime, I think I'll write some pseudocode (but I really highly dislike pseudocode)..maybe a user manual. Or something like that. I have an idea of how the program is going to work anyways, so..
Well, this is what the rubric says: Includes some other form of external documentation (manual, flowchart, project management, problems & solutions report, pseudo-code, etc)
But saying that, I've just finished the flowchart (as in just deleting the parts that I do not need as it isn't in the console window), problems and solutions, and the blog. That should be enough....I think I'll just put up the problems and solutions right now.
Thursday, 3 October 2013
JButton & GridLayout Array
I've just realized how...purple the blog is. AH WELL. CONTINUING ON.
button[0] = Character
button[1] =7 knut question
button[2] = 17 knut question
button[3] = 47 knut question
button[4] = 77 knut question
button[5] = 97 knut question
button[6] = 297 knut question
button[7] = 777 knut question
button[8] = Story Line
button[9] = 7 knut question
button[10] = 17 knut question
button[11] = 47 knut question
button[12] = 77 knut question
button[13] = 97 knut question
button[14] = 297 knut question
button[15] = 777 knut question
button[16] = Tales of Beedle the Bard
button[17] = 7 knut question
button[18] = 17 knut question
button[19] = 47 knut question
button[20] = 77 knut question
button[21] = 97 knut question
button[22]= 297 knut question
button[23]= 777 knut question
button[24] = Quotes
button[25]= 7 knut question
button[26] = 17 knut question
button[27]= 47 knut question
button[28] = 77 knut question
button[29] = 97 knut question
button[30] = 297 knut question
button[31] = 777 knut question
button[32] = Houses
button[33] = 7 knut question
button[34] = 17 knut question
button[35] = 47 knut question
button[36]= 77 knut question
button[37] = 97 knut question
button[38] = 297 knut question
button[39] = 777 knut question
button[40] = Spells
button[41] = 7 knut question
button[42] = 17 knut question
button[43] = 47 knut question
button[44] = 77 knut question
button[45] = 97 knut question
button[46] = 297 knut question
button[47] = 777 knut question
button[48] = Actors of the Cast
button[49] = 7 knut question
button[50] = 17 knut question
button[51] = 47 knut question
button[52] = 77 knut question
button[53] = 97 knut question
button[54] = 297 knut question
button[55] = 777 knut question
So using this, I know that I'll have to make an array of 55 elements.
OOKAAY. THAT FAILED. BADLY. It just turned into a board of nonsense.
I have a feeling I have to create a 2-D array and give it coordinates like so:
button[0] = Character
button[1] =7 knut question
button[2] = 17 knut question
button[3] = 47 knut question
button[4] = 77 knut question
button[5] = 97 knut question
button[6] = 297 knut question
button[7] = 777 knut question
button[8] = Story Line
button[9] = 7 knut question
button[10] = 17 knut question
button[11] = 47 knut question
button[12] = 77 knut question
button[13] = 97 knut question
button[14] = 297 knut question
button[15] = 777 knut question
button[16] = Tales of Beedle the Bard
button[17] = 7 knut question
button[18] = 17 knut question
button[19] = 47 knut question
button[20] = 77 knut question
button[21] = 97 knut question
button[22]= 297 knut question
button[23]= 777 knut question
button[24] = Quotes
button[25]= 7 knut question
button[26] = 17 knut question
button[27]= 47 knut question
button[28] = 77 knut question
button[29] = 97 knut question
button[30] = 297 knut question
button[31] = 777 knut question
button[32] = Houses
button[33] = 7 knut question
button[34] = 17 knut question
button[35] = 47 knut question
button[36]= 77 knut question
button[37] = 97 knut question
button[38] = 297 knut question
button[39] = 777 knut question
button[40] = Spells
button[41] = 7 knut question
button[42] = 17 knut question
button[43] = 47 knut question
button[44] = 77 knut question
button[45] = 97 knut question
button[46] = 297 knut question
button[47] = 777 knut question
button[48] = Actors of the Cast
button[49] = 7 knut question
button[50] = 17 knut question
button[51] = 47 knut question
button[52] = 77 knut question
button[53] = 97 knut question
button[54] = 297 knut question
button[55] = 777 knut question
So using this, I know that I'll have to make an array of 55 elements.
OOKAAY. THAT FAILED. BADLY. It just turned into a board of nonsense.
I have a feeling I have to create a 2-D array and give it coordinates like so:
So I was finally able to create the game board and it looks like this:
Haha, I know. It doesn't look that good yet. But it's slowly getting better! I'm going to make it colourful and Harry Potter themed! :)
The very beginning
Sigh...a quiz just brought my mark down 1% >_< I .. kind of understand what I got wrong. But only kind of O_O
Anyways, out with it.
Planning to program a Fandom Jeopardy - did it in the console window two years ago. Going to rewrite it in a GUI this year. Going to use the same questions and the same answers, but using JTextFields, JGridLayouts and JButtons. Hopefully it'll look a lot better. Sigh.
Anyways, out with it.
Planning to program a Fandom Jeopardy - did it in the console window two years ago. Going to rewrite it in a GUI this year. Going to use the same questions and the same answers, but using JTextFields, JGridLayouts and JButtons. Hopefully it'll look a lot better. Sigh.
Subscribe to:
Comments (Atom)










