Log in

No account? Create an account
ah yeah - brad's life — LiveJournal [entries|archive|friends|userinfo]
Brad Fitzpatrick

[ website | bradfitz.com ]
[ userinfo | livejournal userinfo ]
[ archive | journal archive ]

ah yeah [Apr. 2nd, 2001|11:26 pm]
Brad Fitzpatrick
I'd just like to make known that Java the language is really damn cool. Hell, Swing is pretty cool too, but not perfect. Anyway, about the coolness of Java. Check out the initGameList() function in Server.java. Loading a class by name, then invoking a static method on it. Sooooo neat.

Um, anybody want to write me a LayoutManager which only manages one component (it can throw an exception if more than 1 exists) and sizes the component as large as it can get (while still respecting the component's getMaximumSize), but maintaining an aspect ratio as given in the to-be ProportionalLayout's constructor? I want to be able to resize NBGS' GameWindow, but not have boards look funny when stretched out rectangularly. Or, I can just fix the size of the GameBoard classes, and I likely will on some games, but most games should permit resizing. Currently I have the beginning of tic-tac-toe going, but it looks dumb because it stretches in the wrong way.

I might also be able to solve this problem using a simple FlowLayout and having the component listen to resize events and change how it responds to getPreferredSize and such over time. But that's kinda hacky and ugly.

[User Picture]From: whitaker
2001-04-02 11:53 pm (UTC)
I always wanted to learn it... just never got around to it. I bought a book back in the day, I don't think it's even Java2. Oh well... heh.
(Reply) (Thread)
[User Picture]From: quentin
2001-04-03 07:33 am (UTC)


When did u learn java?... hmm i must say u learn it veri fast =D
(Reply) (Thread)
[User Picture]From: bradfitz
2001-04-03 07:49 pm (UTC)

Re: wow

I learned it right when it came out a long time ago but then I didn't use it for awhile..... relearning it now, and all the new cool stuff.
(Reply) (Parent) (Thread)