Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8779669
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T19:51:11+00:00 2026-06-13T19:51:11+00:00

Due problems in showing JAVA 6 Splash screen i used following method to show

  • 0

Due problems in showing JAVA 6 Splash screen i used following method to show a splash window.

File splashImageFile = new File(Constants.PATH_IMAGE + "splash.png");
        final BufferedImage img = ImageIO.read(splashImageFile);
        final JWindow window = new JWindow() {
            private static final long serialVersionUID = -132452345234523523L;

            @Override
            public void paint(Graphics g) {
                Graphics2D g2 = (Graphics2D) g.create();
                g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
            RenderingHints.VALUE_ANTIALIAS_ON);
                Rectangle windowRect = getBounds();
                try {
                    Robot robot = new Robot(getGraphicsConfiguration().getDevice());                        
                    BufferedImage capture = robot.createScreenCapture(new Rectangle(windowRect.x, windowRect.y, windowRect.width, windowRect.height));
                    g2.drawImage(capture, null, 0, 0);
                } catch (IllegalArgumentException iae) {
                    System.out.println("Argumets mis matched.\n" + iae.getMessage());
                } catch(SecurityException se){
                    System.out.println("Security permission not supported\n" + se.getMessage());
                } catch (AWTException ex) {
                    System.out.println("Exception found when creating robot.\n" + ex.getMessage());
                }
                g2.drawImage(img, 0, 0, null);
                g2.setFont(new Font("TimesRoman", Font.BOLD, 15));
                g2.drawString("Loading...", 320, 260);
                g2.dispose();
            }
        };
        window.setAlwaysOnTop(true);
        window.setPreferredSize(new Dimension(img.getWidth(), img.getHeight()));
        window.pack();
        window.setLocationRelativeTo(null);
        window.setVisible(true);
        window.repaint();

The image is png transparent image as i need rounded cornered rectangle shape in my window. It works on Win 7 but in mac 10.8. Mac still shows rectangle shape background. It does not seems as background either actually. Can someone tell me what may cause to that. Following are the images for each platform.

On windows

windows

On mac

mac

Thanks in advance.

EDIT:

Answers are great but I’ve seen that AWTUtilities is not always getting system support. So in some some systems answered methods may fail. Isn’t there a solution much formal? I mean solution comes from the basic level?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T19:51:13+00:00Added an answer on June 13, 2026 at 7:51 pm

    To get an uniform solution, you should use Java7. Per pixel translucency was nearly an “experimental” feature in Java 6, and not thought to be something you could rely on (that’s why AWTUtilities was into the com.sun package, which is not part of Java public API).

    However, and although I haven’t got a Mac to test it, I’ve seen people reporting that setting the frame background to Color(0, 0, 0, 0) (last parameter is the alpha channel) worked for them in MacOS. I do not remember clearly if it worked in windows (I had to use it a couple of years ago), but I’ve just tested it in Linux and it doesn’t.

    In Java 7, translucent windows are fully supported and working flawlessly in Windows, MacOS and Linux. JFrame has the new setOpacity(Alpha) method (that works only with undecorated frames) and setColor(new Color(R, G, B, Alpha)) is also working (it’s equivalent, and again only working with undecorated frames).

    As you can see, you can’t rely on the private API AWTUtilities. In Java 6 you haven’t got any “formal solution” for this problem, only hacks, private APIs and uncertainty… I don’t know if it is an option, but you should think about switching to Java7 if you can.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am having problems downloading files possibly due to the file extensions not matching
I am new to dealing with Java and the course I'm taking is showing
I currently have the DatePicker in my project but there are problems due to
I'm having problems building a project under the Android NDK. Most likely its due
I'm running into problems implementing statuses for a model. This is probably due to
I was having problems while intersecting two geometries, getting a TopologyException probably due to
I've got a weird problem and it's most obviously due to my new status
I'm pulling my hair due to the following problem: I am following the example
Im showing the AirPrint options from a UIButton using the presentFromRect method, everything is
I have the following code to animate the showing/hiding of a div. $(.headerClosed, .headerOpen).live(click,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.