How to “pin” a screen in Android 5 (Android screen pinning)

Android FAQ: How do I “pin” a screen in Android?

Pinning a screen in Android requires a setting change. Once you’ve made that change, you can “pin” a screen so it is always shown when you log into your Android device. Here’s how to do it.

Android screen pinning setting

To pin a screen in Android, you first have to go into your settings and make a change. So go to the Settings app, then tap Security. When you scroll down you’ll see a “Screen pinning” setting, as shown here:

iPhone 4 screen cleaning tips from Apple

iPhone 4 screen cleaning FAQ: How do I clean the front screen on my iPhone 4 (the iPhone 4 glass)? Also, what kind of iPhone 4 cleaning cloth can I use?

I just bought an iPhone 4 a few days ago, and the front glass screen and oleophobic coating is pretty awesome. I used it for a while without noticing any smudges on the glass. As soon as I got a little bit of a smudge on it this morning I began to wonder, how am I supposed to clean the iPhone 4 screen/glass?

Java - Getting the mouse cursor location (current mouse position)

Java mouse cursor location FAQ: How do I get the location of the mouse (mouse cursor) in Java?

I just ran into this problem in my Java Robot programming, and the short answer is, to get the current mouse cursor location/position, use the getPointerInfo method of the java.awt.MouseInfo class, like this:

Point p = MouseInfo.getPointerInfo().getLocation();

How to set the initial size of a Java JFrame

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.

How to center a JFrame on screen

I'm often asked, "How do I center a JFrame on screen?", or, "Is there a method to center a JFrame?"

I always center my initial JFrame on screen using the setLocationRelativeTo method, and pass it a null reference. As the Javadoc for setLocationRelativeTo method states:

How to tell a JFrame to fill the entire screen

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.

Java screen size - How to determine the screen/display size

Java screen size FAQ - "How do I determine the size of the screen (or display) in pixels? (i.e., the screen size, or screen resolution)

The following Java code demonstrates how to get the screen size, using the Java Toolkit class: