Brad Fitzpatrick (brad) wrote,
Brad Fitzpatrick
brad

ah yeah

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.
Subscribe
  • Post a new comment

    Error

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 3 comments