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

Reviewed-by: trebari, psadhukhan
  • Loading branch information
Alexander Zuev committed Jan 18, 2021
1 parent cd25bf2 commit bb0821eb6a92afb11afd853e8520d5e8337d5cf6
Showing 1 changed file with 8 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;
@@ -95,13 +90,15 @@ public void run() {
}
});

robot.delay(1000);
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 bb0821e

Please sign in to comment.