glasspane

How to convert JGraph to a glass pane?

允我心安 提交于 2019-12-11 22:57:46
问题 I have a class : public class GraphEditorPane extends JGraph and I am using this "GraphEditorPane" as follows : public JScrollPane getGraphPaneScrollPane() { if (graphPaneScrollPane == null) { graphPaneScrollPane = new JScrollPane(); //graphPaneScrollPane.setViewportView(getGraphEditorPane()); graphPaneScrollPane.setViewportView(getGraphEditorPane()); } return graphPaneScrollPane; } public GraphEditorPane getGraphEditorPane() { graphEditorPane = new GraphEditorPane(); } I am using this

How is it possible to paint more than one rectangle on a glass pane?

时光总嘲笑我的痴心妄想 提交于 2019-12-10 22:05:38
问题 I am trying to paint a series of rectangles on the glass pane as described in here. the thing is that only the last element from my list is being displayed on the pane. Does anyone how to be able to paint more then one rectangle on the same pane? The following is the code being used: paint method in the pane's class , extending JComponent protected void paintComponent(Graphics g) { if (point != null) { int value = this.getGradient(); Color myColour = new Color(255, value, 0, 175); g.setColor

Swing: GlassPane prevents mouse pointer from changing

断了今生、忘了曾经 提交于 2019-12-10 10:15:17
问题 I have a JTabbedPane with some tabs and a lot of unused extra space next to the tabs. So I'm trying to use it and place some buttons there (like in Eclipse). I put the buttons on a GlassPane: JPanel glasspane = getPanelWithButtons(); // panel with FlowLayout.RIGHT frame.setGlassPane(glasspane); glasspane.setOpaque(false); glasspane.setVisible(true); This works, and I still can click through on the other elements of my gui (most search results I found are about how to prevent this). The only

placing a transparent JPanel on top of another JPanel not working

狂风中的少年 提交于 2019-12-10 02:15:45
问题 I am trying to place a JPanel on top of another JPanel which contains a JTextArea and a button and i want to the upper apnel to be transparent. I have tried it by making the setOpaque(false) of the upper panel. but it is not working. Can anyone help me to get through this? Thanks in advance! public class JpanelTest extends JPanel { public JpanelTest() { super(); onInit(); } private void onInit() { setLayout(new BorderLayout()); JPanel panel = new JPanel(); panel.setLayout(new BorderLayout());

glassPane is not blocking input

半城伤御伤魂 提交于 2019-12-08 22:14:22
问题 I've build a small GUI game in java and at some point I'm using a glassPane to temporarily block all mouseinput. I've used the glassPane before without any problems but this time it won't block the mouseinput. So I can still press a button that resides on the contentPane while the glassPane is enabled, I'm sure it's enabled because I can see the stuff I paint on it. Here is a short piece of runnable code that's shows the problem: import java.awt.Color; import java.awt.Dimension; import java

Swing: GlassPane prevents mouse pointer from changing

我怕爱的太早我们不能终老 提交于 2019-12-05 19:33:10
I have a JTabbedPane with some tabs and a lot of unused extra space next to the tabs. So I'm trying to use it and place some buttons there (like in Eclipse). I put the buttons on a GlassPane: JPanel glasspane = getPanelWithButtons(); // panel with FlowLayout.RIGHT frame.setGlassPane(glasspane); glasspane.setOpaque(false); glasspane.setVisible(true); This works, and I still can click through on the other elements of my gui (most search results I found are about how to prevent this). The only problem so far is that the mouse pointer doesn't change to that double-ended horizontal arrow when it

placing a transparent JPanel on top of another JPanel not working

南楼画角 提交于 2019-12-05 01:06:51
I am trying to place a JPanel on top of another JPanel which contains a JTextArea and a button and i want to the upper apnel to be transparent. I have tried it by making the setOpaque(false) of the upper panel. but it is not working. Can anyone help me to get through this? Thanks in advance! public class JpanelTest extends JPanel { public JpanelTest() { super(); onInit(); } private void onInit() { setLayout(new BorderLayout()); JPanel panel = new JPanel(); panel.setLayout(new BorderLayout()); panel.add(new JTextArea(100,100),BorderLayout.CENTER); panel.add(new JButton("submit"),BorderLayout

Java Glass pane

情到浓时终转凉″ 提交于 2019-12-03 14:15:41
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 example with glass pane which might help me. How to Create Translucent and Shaped Windows 来源: https:/

how to set the position of glasspane in JFrame?

我只是一个虾纸丫 提交于 2019-12-02 21:52:40
问题 I'm trying to create a menu slider from the left side of the frame. It need to be floating above the content, where i can access it always with a mouse listener(open the menu when the mouse is close to the left edge). Well, I set my GlassPane (My JPanel ) as setOpaue(false) and it was floating above the content. but the glasspane always positioned on the center, and I need to have a possibility to move it,slide it, but with no luck. the setBounds and setLocation does not worked for me. Can

JFrame Glasspane is also over JDialog but shouldn't

假如想象 提交于 2019-12-02 13:13:28
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 eventDispatched(AWTEvent event) { if (target instanceof JFrame) { e = SwingUtilities.convertMouseEvent( (