glasspane

create an transparent rectangle over blurred background in jframe

半腔热情 提交于 2019-11-28 01:46:11
I am having problem in creating an transparent rectangle over blurred background. I am trying to do this task on glasspane . Here is my code snippet. void createBlur() { alpha = 1.0f; JRootPane root = SwingUtilities.getRootPane(jf); blurBuffer = GraphicsUtilities.createCompatibleImage(jf.getWidth(), jf.getHeight()); Graphics2D g2d = blurBuffer.createGraphics(); root.paint(g2d); g2d.dispose(); backBuffer = blurBuffer; blurBuffer = GraphicsUtilities.createThumbnailFast(blurBuffer, jf.getWidth() / 2); blurBuffer = new GaussianBlurFilter(5).filter(blurBuffer, null); } where, backBuffer and

Secure Desktop Mode effect for java application

三世轮回 提交于 2019-11-27 09:36:24
Does anyone now how to achieve a "Secure-Desktop Mode" (effect) such as one gets from the Windows Vista/7 UAC consent-blocks? I assume it is some function which will remove pixels here-and-there (and possibly graying them) and then finally drawing that to screen... I would like to apply it to my application to keep the user from doing anything until the another user connects to the system (but that is besides the point) I would really appreciate the advise. Kind regards A EDIT: i was really only looking for this graphicsFX.setColor(new Color(0, 0, 0, 0.8f)); graphicsFX.fillRect(0, 0, 800, 600)

Calculator application including keyboard input in java swing

♀尐吖头ヾ 提交于 2019-11-26 22:05:57
问题 I have a calculator application in java swing, which is working properly with mouse click input. Now I want it to read input using keyboard button stroke. I had heard about the glass pane in java tutorial, but i need to know any other simple method to meet the requirement. 回答1: KeyPadPanel is an example that uses Action and Key Bindings for numeric entry. 来源: https://stackoverflow.com/questions/10099686/calculator-application-including-keyboard-input-in-java-swing

create an transparent rectangle over blurred background in jframe

十年热恋 提交于 2019-11-26 22:02:23
问题 I am having problem in creating an transparent rectangle over blurred background. I am trying to do this task on glasspane . Here is my code snippet. void createBlur() { alpha = 1.0f; JRootPane root = SwingUtilities.getRootPane(jf); blurBuffer = GraphicsUtilities.createCompatibleImage(jf.getWidth(), jf.getHeight()); Graphics2D g2d = blurBuffer.createGraphics(); root.paint(g2d); g2d.dispose(); backBuffer = blurBuffer; blurBuffer = GraphicsUtilities.createThumbnailFast(blurBuffer, jf.getWidth()

Secure Desktop Mode effect for java application

旧巷老猫 提交于 2019-11-26 14:47:18
问题 Does anyone now how to achieve a "Secure-Desktop Mode" (effect) such as one gets from the Windows Vista/7 UAC consent-blocks? I assume it is some function which will remove pixels here-and-there (and possibly graying them) and then finally drawing that to screen... I would like to apply it to my application to keep the user from doing anything until the another user connects to the system (but that is besides the point) I would really appreciate the advise. Kind regards A EDIT: i was really

Layering multiple GlassPane's in a Root Container

落爺英雄遲暮 提交于 2019-11-26 05:51:11
问题 Is it possible to add multiple GlassPane s for a single JFrame , or do I have to use the uncomfortable LayeredPane with the Opacity attribute. I have attached some code that shows what I want to do (provided by @camickr). import java.awt.*; import java.awt.event.*; import java.util.*; import javax.swing.*; import javax.swing.border.*; public class MultiplayGlassPane { private static final long serialVersionUID = 1L; private JFrame frame = new JFrame(\"frameTitle\"); private JPanel fPanel =

Placing component on Glass Pane

早过忘川 提交于 2019-11-25 22:34:56
问题 I have a subclass of JLabel that forms a component of my GUI. I have implemented the ability to drag and drop the component from one container to another, but without any visual effects. I want to have this JLabel follow the cursor during the drag of the item from one container to another. I figured that I could just create a glass pane and draw it on there. However, even after I add the component to the glass pane, set the component visible, and set the glass pane visible, and set the glass