java - Should I be concerned using AWTUtilities.setWindowShape()? -
I am using the AWTUtilities
class in my code to create custom window sizes. As far as I know, there is no other way to do this. This is a requirement.
The javadoc generation gives me this error:
WARNING: com.sun.awt.AWTUtilities is Sun's proprietary API and can be removed in the future.
What does this mean? I can use it, but can it stop working with any release? Why put it in, then? More important, and here is the real question, if the sun takes it out, do they take it to another place to do it in another way? What is this warning?
I think I could only check the presence of the abutibus class before calling the code. But this is just unpleasant if I do not have to do this.
Do anyone have any experience with similar classes? Did they eventually be accepted into the API and the warning was removed or replaced with the second method of doing the same thing? Do I need to worry about it?
FYI, I have read it:
Oracle says:
Note: The com.sun.awt.AWTUtilities class is not part of the officially supported API and appears as an implementation description. The API is for limited access only outside the original platform. This update may change to a great extent between the release, and it can be removed or transferred to some other packages or sections. Class should be used through java reflection. Supported and public APIs will appear in the next big JDK release.
The JDK 7 is coming from long time, so it can be a while. Regardless of whether you should use it is risk management question which only your company can answer. If we are talking about an internal application where deployed JRE can be guaranteed, then you will not have any problems as you can guarantee a consistent JRE. If we are talking about deploying outsourced clients, then you need to support this plan.
A steady way to do this would be to create a shell according to SWT and then use the SWT_AWT bridge to get a frame to use in your application:
< Code> java.awt.frame frame = SWT_AWT.new_frame (shell);
If you are deploying only one platform (like Windows), then throwing a single SWT jar plus native library is to be done. If you are targeting multiple platforms then it becomes a pain.
So these are two options: dealing with AWTUtUtilities risk or using the SWT_AWT bridge.
Edit: / Strong>
Some time has passed and Java 7 is out there in this documenting on officially supported methods to complete it below Given the "How to implement a shape window" section, an example gives it a definite assumption that you can mandate Java 7
Comments
Post a Comment