Showing posts with label JFrame. Show all posts
Showing posts with label JFrame. Show all posts

Sunday, 30 October 2011

Java: MultiThreading Example 2: A Shared Queue

In response to one of the comments: Yes. I was either going to go to html after we were done with making a simple game or 2, or to python. Python really should have been done first, its a much nicer language, but...I didn't! So there.

Back to another Java example, until this whole multithreading thing is understood properly, I looked at the dumbass book again, but I found something that looked plausible: A shared queue. I mentioned this when going over potential difficulties you may encounter without synchronizing, so this seems like a great way to learn how to make something thread-safe. On top of that, there'll be flipping between threads, unlike the clock program!

Friday, 28 October 2011

Java: Text Clock Complete!

Oh god, the pain. I did far too many squats from a huge period of not doing anything, and to add to it, I didn't stretch properly. My legs are in so much pain right now :( You'll also notice that I changed the layout again! Black background is easier on my eyes, I assume it's not a problem for anyone else, either? Let me know if it is.
And Bersercules! Not to worry, for I am a man of my word, I will at least ATTEMPT to make the Texas Hold 'Em game!

Most of the space in these screenies is going to be taken up by comments, because, honestly, I did not understand half of what I was doing at the time. They were largely for my own benefit, but I assume you could learn from them too! As teachers go, I'm terrible, given how little I know of the subject before attempting to teach :D

Continuing with our text clock for now, though, we've just got the frame to go!

Thursday, 27 October 2011

Java: Multithread Clock (Cont)

Pfft, overslept. I am not good with that, and reading DWei's blog on his sleeping troubles made me more acutely aware of my own :-(

Anyway, the problem I was mentioning yesterday was in the region of "I need to make my own JFrame for this to work, but the GUI builder is a pile of dicks, and won't let me customize JFrame code.
Unfortunately, I've not found a way around this, so its probably a good thing I manually did the GUI stuff that one time, right? :D