Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
8258643: javax/swing/JComponent/7154030/bug7154030.java failed with "…
…Exception: Failed to hide opaque button"

Reviewed-by: psadhukhan
  • Loading branch information
Alexander Zuev committed Jan 5, 2021
1 parent a6c0881 commit fc3b45c068cf6393d16c254cf9080213f9d592ab
Showing 1 changed file with 7 additions and 11 deletions.
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -30,14 +30,9 @@
import javax.swing.JFrame;
import javax.swing.SwingUtilities;

import java.awt.AWTException;
import java.awt.AlphaComposite;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Insets;
import java.awt.Rectangle;
import java.awt.Robot;
import java.awt.Toolkit;
import java.awt.image.BufferedImage;
import javax.imageio.ImageIO;
import java.io.File;
@@ -98,10 +93,11 @@ public void run() {
robot.waitForIdle(1000);

Rectangle bounds = frame.getBounds();
locx = bounds.x;
locy = bounds.y;
frw = bounds.width;
frh = bounds.height;
Insets insets = frame.getInsets();
locx = bounds.x + insets.left;
locy = bounds.y + insets.top;
frw = bounds.width - insets.left - insets.right;
frh = bounds.height - insets.top - insets.bottom;

imageInit = robot.createScreenCapture(new Rectangle(locx, locy, frw, frh));

0 comments on commit fc3b45c

Please sign in to comment.