The following Java source code shows how to determine the screen size (dimensions) of the Android device your application is running on:
A quick note today on Android screen sizes and screen densities. According to the Supporting Multiple Screens document on the Android website, Android screens are broken down into a set of four generalized sizes: small, normal, large, and xlarge. Their sizes in “dp” units are:
Java image FAQ: Can you show me how to create a screen capture in Java?
I don't have any Java screen capture code to share at the moment, but if you don't mind a JRuby screen capture example (which you can easily convert to Java), this JRuby screenshot (screen capture) source code example should help point you in the right direction:
JFrame color FAQ: How do I set the JFrame background color?
In general, to set the JFrame background color, just call the JFrame setBackground method, like this:
Note that there are many more things you can do with the Java Color class, including:
I've been getting back into the Java/Swing world during the last few days, and I thought I'd share some example code here. In my current application, one of the things I just worked on was setting the initial JFrame size to a value I liked.
In an earlier tutorial, I shared some code on how to maximize a JFrame, but every once in a while you'll run into a situation where you want to fill an entire screen with a JFrame, but not call a method to actually maximize it. This is rare, but I just ran into this situation, so I thought I'd share the source code here.
In the example below I'm showing how you can change a bunch of LaTeX document length parameters. The values don't really make any sense -- I've just thrown some numbers in there. I just want to remember how to do this for the next time I need to create a LaTeX PDF document.
(For what I'm trying to achieve today my goal was to get rid of all the margins on the left side of the page. Then I decided to throw in a few other values.)
I found some of these LaTeX examples on pp. 84-89 of The LaTeX Companion.