Ideally, we'd move the JButton over a little to the left. This would require that we go back and alter the code. Another option is to set the com.apple.mrj.application.growbox.intrudes property like this:
Now a border is added to the bottom of the JFrame so that the grow box can't sit on top of any components contained in the JFrame. In this case, this change accomplishes what we want.

Figure 9. A non-intrusive grow box

Mac Os Java Version

There are, however cases when it doesn't look very good. You'll see this awkwardness highlighted if you've got a differently colored JPanel inside of your JFrame. Again, without altering the code in the original application this is our only alternative.
While we're on the subject of grow boxes, you need to decide what you want to happen when a user grabs the grow box and drags it. One option is for an outline of the JFrame to appear that shows the dimensions of the resized window like this:

Figure 10. A proxy view of the resized JFrame

You may prefer, instead, to have the actual window resize as the grow box is repositioned. This may mean some intermediate awkward views of the application as the redrawing struggles to keep up. This live resizing is the default behavior for Java applications on the Windows platform and for many native Mac OS X applications. It is not the default behavior for Java applications on Mac OS X, but you can set it like this.
Another subtle adjustment is to the size of the tabs. It is hard to do cross platform GUI design if you try to set the size and location of components precisely. One obstruction is that the font size is different on different platforms. Apple allows you to choose between using big and small tabs. The default is for big tabs and which one you choose is merely a matter of judgement. You specify small tabs like this:
The first image below shows the larger tabs and the second image shows the effect of choosing small tabs.

Figure 11. The default tab size

Figure 12. The smaller tab size

Summary

By setting a few runtime properties, your Java application will feel more like a native Mac application without any code modifications. This means that, in many cases, you can apply these properties to Java applications to which you don't have access to the code to customize them for the Mac. In the next article we'll dig a little deeper and modify the code to refine the user experience.
In this post you will learn how to set the default JAVA_HOME in OS X when you have more than one JDK installed in your computer. First you need to run /usr/libexec/java_home -V command to get the list of installed JDK. The command will print out something like the following depending on the available JDK in your computer.
On my machine I have the following version of Java.
From the list above pick which version you want to be the default JDK. For example I will choose the 1.8.0_121 version to be my default JDK. To set it run the command below.
If the major version of the available JDK is unique you can just use the major version, like:
After setting the JAVA_HOME and you run the java -version command you will see that JDK 1.8 is the new default JDK in your computer.
The change above will only active in the current running shell. If you close or terminate the shell, next time you open the shell you will need to set it again. To make this change permanent you need to set it in your shell init file. For example if you are using bash then you can set the command in the .bash_profile. Add the following lines at the end of the file.
To activate this configuration right away your can run source .bash_profile. This command reads and executes the .bash_profile in the current shell.