glasspane

Wait cursor and disable java application

不想你离开。 提交于 2020-12-29 04:30:57
问题 I want to have the user press a button to kick off a background thread. While the thread is processing, I want two things to happen: 1) A WAIT_CURSOR should be displayed. 2) The application should not respond to mouse events. As per the setCursor documentation "This cursor image is displayed when the contains method for this component returns true for the current cursor location, and this Component is visible, displayable, and enabled. ". I want my application to be disabled while this

Wait cursor and disable java application

主宰稳场 提交于 2020-12-29 04:29:07
问题 I want to have the user press a button to kick off a background thread. While the thread is processing, I want two things to happen: 1) A WAIT_CURSOR should be displayed. 2) The application should not respond to mouse events. As per the setCursor documentation "This cursor image is displayed when the contains method for this component returns true for the current cursor location, and this Component is visible, displayable, and enabled. ". I want my application to be disabled while this

Introducing JLayeredPane to an existing JFrame

馋奶兔 提交于 2019-12-24 10:59:02
问题 I've been staring at Oracle's JLayeredPane tutorials but they are laid out in a manner that is confusing to me and doesn't get at what I am trying to do. I have an application that up to now has had no concept of layers. Everything is laid out in a single layer, inside a JFrame. I now want to introduce a component that appears sporadically, as needed, in a certain location, overlaying existing components that stay there normally. Do I have to modify my existing application JFrame so that all

“Whiteout” entire swing GUI except from one component

丶灬走出姿态 提交于 2019-12-24 09:12:57
问题 [This question is in relation to this question] Setting : I have this home-crafted "editable label" component which looks like a label, but when you click it, it turns into an editable field, allowing you to edit it. You can hit Esc to cancel, or Shift-Enter to OK your edits - or click the respective buttons beneath the editable field. The Challenge : When hitting edit, I want the entire UI to be "whited out", except for the edit-label's area, to clearly denote to the user where it is

JFrame Glasspane is also over JDialog but shouldn't

谁都会走 提交于 2019-12-20 06:28:27
问题 I have a JFrame (undecorated) with a Glasspane. This Frame opens a JDialog (also undecorated and has also a glassPane) and hides itself (setVisible(false)). The Glasspanes are set with .setGlassPane(). The Dialog is opened with the Frame as owner. The GlassPane extends a JPanel and implements AWTEventListener. I use it for resizing the Frames and Dialogs, so it knows it's parent (the Frame/Dialog) - this is called "target". The Events inside the GlassPane are handled like this: public void

Layout Manager and Positioning

别说谁变了你拦得住时间么 提交于 2019-12-19 18:58:27
问题 how to stick JLabel in GlassPane to rellative, floating coordinates from JProgressBar without using ComponentListener or another listener, is there built_in notifiers in Standard LayoutManagers that can notify about its internal state, and can be accesible for override, instead my attempt with ComponentListener and NullLayout . SSCCE about ComponentListener and with NullLayout import java.awt.Container; import java.awt.Dimension; import java.awt.FlowLayout; import java.awt.GridBagConstraints;

Layout Manager and Positioning

喜欢而已 提交于 2019-12-19 18:58:06
问题 how to stick JLabel in GlassPane to rellative, floating coordinates from JProgressBar without using ComponentListener or another listener, is there built_in notifiers in Standard LayoutManagers that can notify about its internal state, and can be accesible for override, instead my attempt with ComponentListener and NullLayout . SSCCE about ComponentListener and with NullLayout import java.awt.Container; import java.awt.Dimension; import java.awt.FlowLayout; import java.awt.GridBagConstraints;

Why is paintComponent() continuously and asynchronously being called without explicit repaint() call?

大憨熊 提交于 2019-12-13 16:42:30
问题 So this question has two parts, which I think may be related, and it's mostly abstract. Briefly, here's what I'm doing: I have a JFrame with a JPanel and some child JPanels each with 3 JButtons on it. I also created a JComponent called glassPanel for the JFrame (i.e. myJFrame.setGlassPane(glassPanel) ), that allows me to paint over the JPanels and buttons. (1) Essentially triggered by clicking all 3 buttons on a JPanel , glassPanel is set to Visible (which appears to then call paintComponent(

How to delegate mouse events to all underlying overlapped panes in JavaFX?

不想你离开。 提交于 2019-12-12 21:20:15
问题 I have some top decoration pane, which I want to process/preprocess mouse events, but which should not consume them, i.e. all overlapped panes should work as if they were not overlapped by decoration pane. How to do this? I failed with several tries. Below is a code with 3 panes. Green one is "decorating". The task is to make it transparent to mouse events. Yellow and blue panes are worker panes. They should work as if they were not overlapped by green pane. But green pane should receive

Java Glass pane

对着背影说爱祢 提交于 2019-12-12 08:05:02
问题 I have a problem. I want to ask you how can I implement GlassPane to paint on it. I mean, if I click mouse button, in mouseClicked event, my transparent glass pane should be created, because I want to see all my components behind glassPane and I can paint on it using mouseDragged event. When I release mouse button my glassPane disappears. I have another question too. When I will paint on glass pane all my components behind them will be refreshing and repainting? Maybe somebody have nice