I’ll walk you through some JOptionPane examples here, starting with a simple example and then increasing the level of difficulty as I go on.
Summary: How to make a Java JFrame transparent (translucent) on Mac OS X.
A lot of people complain about a lot of things in regards to Java on Apple's Mac OS X platform, and okay, occasionally I'm one of them, but a very cool thing you can do on OS X is to create translucent (transparent) frames and windows with Java.
In this tutorial I look at how to create a splash screen in a Java application. At the end of the discussion I'll share all of the Java classes that are needed to implement your own Java splash screen.
Initializing our Java splash screen
Initializing the splash screen should be simple. We need to get an image to display on our Java splash screen, construct the splash screen, and then display it. Here's what a "splash screen initialization" method might look like:
My Java splash screen source code
Next up we'll dig into our Java SplashScreen class to see how I've actually implemented the desired behavior.
With custom icon
It’s important to note that you can also customize the icon that is displayed when using a
showMessageDialog. In the following example, I specify that I want to display my own PNG image as an icon on the dialog by creating an
ImageIcon as an additional argument to the
The running program
JSheet effect is very nice, it works as advertised. My only problem with it currently is that it does something to distort the image when the
JSheet is displayed. You can see this problem in the image shown below, where the coffee cup image that sits on top of the caution image does not look very good:
I'm always looking for ways to make my Java Swing applications on Mac OS X look more and more like native Mac applications, and when a co-worker mentioned the name Quaqua, I decided to take a look at that library/framework one more time. I had looked at it before, but this time, looking at it with a new mindset, I noticed it offers a
Earlier today I wrote a blog entry about how to create a transparent/translucent JFrame on a Mac OS X system, and then I thought, "Wouldn't it be cool if you could dynamically control the transparency level of the frame?" I did a little bit of research to make sure this can be done, and sure enough, it can.