Hi, I am new to coderanch, obviously from my number of posts, eh? Quick intro: I am having trouble getting
java stuck in my head, and then as soon as it seems like I have it figured out, it doesn't work. I have to say I am very glad to find a site that tolerates noobs and has people willing to help! I do the same thing on another forum helping people with marine electronics installation and repair (I assume I shouldn't post links). I am currently working on an AAS networking degree and CCNA. This is my first time with java, and the last time I programmed was in C, and a lot of years ago.
And, off to the important stuff. I need help figuring out why my draw method is not working correctly. This is the skyline programming project out of the Lewis/Loftus Java book (with a couple instructor twists). We are only beginning, so we do not have anything much more complicated to work with than what you see. This project is pressing the point of creating objects, and then having the objects draw themselves on the panel. There is some extra stuff going on, like windows randomly generating their own colors, and a bunch of mutators that aren't being used right now.
I think I pretty much have it. All files compile, and the frame/panel comes up with the correct background color, and the windows all show up in their randomly generated colors. The problem is that I cannot seem to get the buildings to draw. Whether they draw at all or are just not visible, I am not sure. I have stared it at for hours, and tried re-doing things and playing with not using variables. I have looked around by google, but didn't find anything super helpful. The answers I usually find on google are more confusing than what caused me to look for help!
notes: the reason the ranges on the randoms are that way is so that it gives me a small buffer on the edges of the panel. Then, I tried to make the windows stay inside the buildings.
I think this method is where my problem lies:
I did look around and read posts on here, and tried to make sure I posted in the best way possible to get help. I tried to attach all three java files, but apparently I cannot do that. Please let me know if there is a better way I should post in the future. And remember, I am as noob as noob gets when it comes to java!
Thank you in advance, I do very much appreciate it!