Splitpane under a glass pane

I have a lot of components under a transparent glass pane.
I dispatch mouse events captured by the topmost glasspane
to underling components converting coordinates with
SwingUtilities methods.
Everything works fine except a splitpane. When a try to
resize one of the components it contains, nothing happens.
validate(), repaint() methods invoked on the split at event
dispatching time are completely unusefull.
The glasspane gets MouseListener and MouseMotionListener
events.
Whats the trik to get the split working?
Thanks.

Thanks for the response. The application I am writing has a split pane down the middle, with a glasspane on each side already over what are called View containers. However, a View in either of those containers may contain another splitpane.
I was hoping for a simpler framework style solution such that the developers of a View would not be required to implement their own glasspane functionality and have to tie into the active View management.
My current recourse is to utilize the KeyboardFocusManager to attempt to accomplish what I was trying to do with the GlassPane: set the active view based on selection in any portion of the View (component or empty Panel area). Got the first half working pretty easily, I expect the second have to be quite more challenging.
Thanks again.

Similar Messages

  • Why glass pane requires setLightWeightPopupEnabled(false)?

    In the code below, the glass pane is a JPanel which everybody knows is a Swing lightweight component. Then why JComboBox requires setLightWeightPopupEnabled(false) for its proper functioning? What on earth does the method, in the first place? Why glass pane? What oddity in the hell does the glass pane have that other Swing component doesn't, never?
    import javax.swing.*;
    import java.awt.*;
    public class GlassPaneOddity{
      public static void main(String[] args){
        JFrame frame = new JFrame();
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        JPanel gp = new JPanel(new BorderLayout());
        frame.setGlassPane(gp);
        JComboBox cb
          = new JComboBox(new String[]{"alpha", "beta", "gamma", "delta"});
        cb.setLightWeightPopupEnabled(false); // why this line is so critical?
        gp.add(cb, BorderLayout.NORTH);
        frame.setSize(300, 300);
        frame.setVisible(true);
        gp.setVisible(true);
    }

    This is a quite interesting subject:
    The JRootPane has basically 2 components (although its layout is managing a few more):
    - the glasspane
    - the layered pane
    The z-order of components inside containers (so also for JRootPane) is defined to be:
    - index 0 is highest
    - index 1 is lower but higher than 2 etc...
    The glasspane is added always on index 0 (meaning highest)
    The layered pane is added after (meaning lower)
    Inside the layered pane are added:
    - the content pane
    - the menubar
    And the layout of the rootpane (RootLayout) takes care of the positioning of the glasspane, layered pane, content pane and the menubar.
    The layered pane has a layer for content (containing contentpane and menubar) but also for popups. The popups are shown on top of the content pane, but always under the glasspane.
    As far as I can see this seems to be in line with the explanation under the rootpane tutorial. And in line with Michael's observation.
    Hope it helps,
    Marcel

  • AWT Canvas vs. Swing "glass pane"

    Hello again world.
    The book I've been reading led me down the Swing path but I thought I would go back and take a closer look at the AWT package.
    Is an AWT Canvas analogous to a Swing JRootPane's glass pane?
    Thank you one and all.
    Ciao for now.

    No, not really.
    1) A Canvas is specifically for drawing. There's really no other purpose for it to exist. It's not a container, like Panel. Although, you can use AWT Panel in place of a Canvas, there'd be nothing wrong with that.
    A glasspane has a purpose in a JFrame or other top-level Swing container. It's there to be shown, but often transparently, on top of all other components in that top-level container. You can make the glasspane be any class, yes, but generally it's going to be a JPanel or subclass, and you could paint on it if you override the paintComponent method, or add mouse listeners to intercept mouse events (when it's visible).
    That you can draw on a Canvas or a glasspane component is irrelevant. One can can subclass JButton or JTree or AWT List or any other AWT or Swing component and override the paint or paintComponent method and do custom painting on it. The ability to paint on components is universal. But you wouldn't use a JButton or AWT Button for a glasspane.
    2) You don't want to use Canvas as a glass pane (or any AWT component) if you want the pane to be transparent. AWT components cannot be transparent, so if the component is visible, it'll block out anything under it. It's the whole issue of AWT's heavyweight components vs Swing's lightweight components.

  • How to delete an item under the 'glasses' icon in reading list?

    I cannot delete a webpage under the 'glasses' icon in the reading list of the Safari browser. It just says ' show unread' but does not delete it. There is no 'Edit' button in the reading list under the 'glasses' icon. There is no way I can delete that webpage. I erased the iphone but it did not work. The webpage is still in the reading list under the 'glasses' icon. What can i do? I want to delete it.

    Hey virginiefromfr,
    I found this on deleting items from your reading list:
    Delete something from your reading list:
    Swipe left on the item in your reading list.
    via: iPhone Reading list
    http://help.apple.com/iphone/7/#/iph1a4721132
    Take care,
    Delgadoh

  • Different glass pane behaviour in Mac and Windows

    I have an application with a glass pane containing a panel that is set non-opaque. On this panel I do amouse drag and draw a transparent rectangle when the mouse is released. On the main frame below there is a picture. This works fine on a Mac, I end up with a transparent rectangle on top of the bottom frame. However, when I run the same program on a Windows machine, as soon as the mouse is released, the rectangle is drawn and the glass pane layer gets opaque, hiding the picture below.
    Any solutions?

    >
    I'd suggest you to post some code. ...>Some code is good, but an SSCCE is better. ;-)

  • Glass pane  how to use it?

    please i am new to Java i wanted toknow more about the glass pane component why cant it be use as the content pane .

    google is your friend
    http://java.sun.com/docs/books/tutorial/uiswing/components/rootpane.html#glasspane

  • Odd crack in aluminum case under 27" glass?

    Hello!
    So I bought a brand new i3 27" iMac last night at Bestbuy here in Columbus. After getting it home, unboxing, and setting it up I noticed two cracks in the aluminum case right beneath the glass (not under the glass, below it on the case). One on each side. Being on both sides it led me to believe that it was suppose to be there. But then I thought, hey, this is an apple product, if they needed a bigger ledge there for the glass they would have put it in! This thing is too beautiful for that to have been a design. Once I saw the cracks, I inspected it further and found a clump of dead pixels in the bottom left of the screen.
    Now I'm obviously taking this back and getting an exchange for the pixels, but I'd like to know if this is or is not an issue with the case as well. And if so, I couldn't find anyone else with this problem here or elsewhere online, so I thought I'd share.
    Notice the red line. It's identical on both sides. I was under the impression that the entire case was milled out of one solid piece of aluminum. It's a very thin crack, but it's just about as long as the red line is, on both sides.
    http://www.sourcenews.com/images/imac.jpg
    Thanks,
    Chad
    Message was edited by: Maharajamd

    I wanted to give everyone an update before they do what I did.
    I went into Bestbuy to exchange my iMac. Both of their displays had those cracks. We opened up their entire stock of 27" i3 iMacs. They all had it. I ended up going to the closest Apple Store and found out that the front piece with the logo on it is in fact a seperate piece. Those aren't cracks, they are seams. Often the fit is so perfect is doesn't look like a seam.
    Anyways, thought I'd share. Lol

  • Glass Pane( preventUserInput when user clicks on Search button in af:query)

    Hi,
    We are using glass pane implementation on a search screen.
    When I click on Search button in af:query component (having selectInputDate (Date Picker) components)., glass pane is firing correctly,
    but second time when I am trying to select date using Date Picker (and Change the Month), glass pane is fired (entering into handleBusyState function) and calendar popup is not opening.
    I folled the below article for implementation.
    url: http://www.oracle.com/technetwork/developer-tools/adf/learnmore/27-long-running-queries-169166.pdf used for glassPane implementation.
    Can any one help me for this issue.

    Hi am using the following code (javascript) -- Jdev(11.1.1.3)
    function preventUserInput(evt){   
    var eventSource = evt.getSource();
    var popup1 = eventSource.findComponent("showGlassPanePopup");
    if (popup1 != null){
    AdfPage.PAGE.addBusyStateListener(popup1,handleBusyState);
    evt.preventUserInput();
    //JavaScript call back handler
    function handleBusyState(evt){ 
    var popup = AdfPage.PAGE.findComponentByAbsoluteId('r3:0:r1:0:showGlassPanePopup');
    if(popup!=null){
    if (evt.isBusy()){
    popup.show();
    } else if (popup.isPopupVisible()) {
    popup.hide();
    AdfPage.PAGE.removeBusyStateListener(popup, handleBusyState);
    ... End of Code..
    This line .. (popup.isPopupVisible()) removes the Popup , if popup is visible...
    If u want the view am using..
    SELECT EMPNO , DEPTNO , HIREDATE FROM EMPLOYEE (sample Application i have created), created a view criteria for this..
    ( (EMPNO = :empNum ) AND (DEPTNO = :deptNum ) AND (TO_CHAR( TO_TIMESTAMP(HIREDATE), 'yyyy-mm-dd hh24:mi:ss.ff') = :hireDts ) ) (View Criteria)
    .. <af:clientListener method="enforcePreventUserInput" type="query"/> (added for af:query)
    Popup Used: <af:popup id="showGlassPanePopup" contentDelivery="immediate">
    <af:dialog id="d2" type="none" closeIconVisible="false">
    <af:panelGroupLayout id="panelGroupLayout1" layout="vertical">
    <af:outputText value="Processing......Please Wait.." id="ot97"/>
    </af:panelGroupLayout>
    </af:dialog>
    </af:popup>
    1. When i click search for first time.. it is showing like -- Processing .. Please Wait'
    2. When i click select Date picker it is show -- Processing .. Please Wait'
    and show a calender popup window.. If we change the month ... it will again show like -- Processing .. Please Wait'
    and it will not open calender window.
    Please Help me on this..Am facing trouble due to this.
    Thanks in Advance.
    Edited by: user10115793 on Nov 15, 2011 12:58 AM

  • Mark under screen glass on MacBook Pro Retina

    On my 15" MacBook Pro Retina (Early 2013), around the entire screen, under the glass, there is a smudge that extends the entire width of the area before the viewable portion of the display.  You can see an example in the picture below.
    Anyone know what caused this and whether or not this would be something covered under warranty?  My warranty expires in June and if it's covered, would like it fixed.

    Because you have glass in front of the screen, there is space between the two. That is most likely dust. But it can get baked onto the screen. Your warranty should cover this. My daughters Imac had the same problem and it was covered. You should get it in before your warranty expires.

  • What does it cost and how do I replace my shattered IPhone 5 screen and the touch sensor under the glass?

    What does it cost to replace my shattered IPhone 5 screen and the touch sensor under the glass?

    It is not clear to me how far along this implementation has gonein the US and worldwide, but this seems to describe where it is going:
    http://appleinsider.com/articles/13/06/03/apple-now-repairing-iphone-5-screens-i n-store-as-part-of-applecare-overhaul

  • Dust under a glass screen.

    I've got my IPad 8 months ago - screen in perfect condition. Just recently - few days ago a white spot (dust particle) appeared under the glass screen. Quite annoying on white background and visible when you switch off the screen. Is it possible to replace the unit under 1 year warranty ?

    Is it possible - yes. But only Apple can make the determination for sure. You would have to show it to an Apple Genius or contact Apple and send your iPad to them so that they can see the device.

  • How can I block the keyboard using the glass pane ?

    I have a problem with the GlassPaneDemo from the Java Tutorial in
    the
    uiswing/components/example-swing
    folder.
    When the glass pane is visible it blocks the mouse input but the
    keyboard input doesn't. For example if the glass pane is visible and
    you press the F10 key, the menu will be activated. So the keyboard is
    not at all blocked.
    Can this problem be fixed ? I mean, to really block the keyboard
    when the glass pane is visible.
    Here I wrote down the specification written in the
    Java Documentation at the setGlassPane method from the
    RootPaneContainer interface:
    The glassPane is always the first child of the rootPane and the
    rootPanes layout manager ensures that it's always as big as the
    rootPane. By default it's transparent and not visible. It can be
    used to temporarily grab all keyboard and mouse input by adding
    listeners and the making it visible. by default it's not visible.
    As it may be seen, one says that the keyboard input can be blocked.
    HOW ?
    In hope that I resolve the problem, I have made some changes such as,
    adding a key listener to the glass pane add listening to the keyboard events,
    but I failed to fix the problem.
    Faithfully yours,
    Sarmis

    Here is an example that I think will work for you.
    Note the consume() call on the event object. I think that is what you're after.
    import java.awt.event.*;
    import java.awt.*;
    import java.io.*;
    import javax.swing.*;
    public class Comparer extends JFrame implements ActionListener
        private GlassComponent myGlassPane;
        private JTextField myField;
        public Comparer()
            getContentPane().setLayout(new FlowLayout());
            getContentPane().add(myField = new JTextField(20));
            setGlassPane(myGlassPane = new GlassComponent());
            JButton theButton = new JButton("Glass");
            theButton.addActionListener(this);
            getContentPane().add(theButton);
            pack();
        public void actionPerformed(ActionEvent anEvent)
            myGlassPane.setVisible(true);       
        public static void main(String[] args)
            new Comparer().setVisible(true);       
    class GlassComponent extends JComponent implements AWTEventListener
        Window myParentWindow;
        public GlassComponent()
            super();
            this.setCursor( Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR) );
            setOpaque(false);
            addMouseListener( new MouseAdapter() {} );
        public void setVisible(boolean aVisibleBoolean)
            if(aVisibleBoolean)
                if(this.myParentWindow == null)
                    this.myParentWindow = SwingUtilities.windowForComponent(this);
                Toolkit.getDefaultToolkit().addAWTEventListener(this, AWTEvent.KEY_EVENT_MASK);
            else
                Toolkit.getDefaultToolkit().removeAWTEventListener(this);
            super.setVisible(aVisibleBoolean);
        public void eventDispatched(AWTEvent anEvent)
            if(anEvent instanceof KeyEvent && anEvent.getSource() instanceof Component)
                if(SwingUtilities.windowForComponent( (Component)anEvent.getSource()) == this.myParentWindow )
                    ((KeyEvent)anEvent).consume();
    } HTH,
    Fredrik

  • Resizing glass pane

    Disabling GUI controlls causing the loose of the controls beauty.
    However, sometimes it is neccessary, to display the control in
    a uneditable mode, especially when the input can not be consumed.
    The perfect idea to maintain the beauty of the GUI contorls and
    make them uneditable, is to put a glass infront of them, so you just
    look from pattern :).
    This is a greate idea provided through GlassPane in the Swing API.
    But, still there is a limitation, why?
    The glass pane should be as large as the JRootPane, which means
    that you have to cover the whole top-level container :(.
    Take this example:
    I have a TabbedPane that consists of multiple tabs and the tabbed pane is loacted in a JApplet. I need to move between the tabs while making the controls in side the tabbs uneditable. Here I was constrained by the
    Glass Pane since it covers the whole applet's area, and no more accessability to the tabbs.
    Some one said: redispatch the event to the TabbedPane, I said: Ok, but
    no method in the TabbedPane tells me which tab has the x,y point.
    I suggest to make the GlassPane resizable, and to provide a method in
    the TabbedPane which takes the x,y a returns the index of the selected
    tab.
    Please what do you think ? :-)

    I think it is not useful because you can create your own glasspane for any component you want !
    Look at this thread :
    http://forum.java.sun.com/thread.jsp?forum=57&thread=268566
    I hope this helps,
    Denis

  • Redrawing glass pane

    Hi, I have a program where I am storing information which takes up some time. I created a progressbar and put it in the glass pane and update it several times during this process. Below i posted a simplified example. In this example it works as it should and the progress bar gets redrawn every time I call pb.update().
    However the code I use in the application is complex and the progress bar does not get drawn onto the screen until the method finishes, which is too late. I have tried putting repaint() calls at the end of the update() method, but that does not work. Although the program enters the paint method, nothing gets drawn onto the screen. The only thing that helped was paintimmediately(), which painted the contentPane() on the screen, but did not paint the glassPane.
    My question is, how does java determine when to redraw the glass pane, since I don't have a repaint() call anywhere. Is there a way to force java to draw the glasspane on the screen? Or if you have any tips as to what could be the problem.
    import javax.swing.*;
    import java.awt.event.*;
    import java.util.*;
    public class Main extends JFrame {
       public Main() {
         setSize(200,50);
         setVisible(true);
         ProgressBar pb = new ProgressBar();
         setGlassPane(pb);
         pb.setVisible(true);
         Thread t = new Thread();
         try {
             t.sleep(1000);
             pb.update();
             t.sleep(1000);
             pb.update();
             t.sleep(1000);
             pb.update();
             t.sleep(1000);
             pb.update();
             t.sleep(300);
         } catch ( Exception e ) {}
         pb.setVisible(false);
        public static void main(String[] args) {
         JFrame.setDefaultLookAndFeelDecorated(true);
         Main app = new Main();
         app.addWindowListener(
            new WindowAdapter() {
               public void windowClosing( WindowEvent e )
              System.exit( 0 );
    public class ProgressBar extends JComponent {
    JProgressBar jProg;
    int cur;
        public ProgressBar () {
         init();
         cur = 0;
         setOpaque(false);
        public void init() {
            jProg = new javax.swing.JProgressBar(0,100);
         jProg.setValue(0);
         jProg.setStringPainted(true);
         jProg.setSize(200,30);
         add(jProg);
       public void update() {
         cur += 25;
         jProg.setValue(cur);
    }

    Read the Swing tutorial on [url http://java.sun.com/docs/books/tutorial/uiswing/components/progress.html]How to Use Progress Bars for a working example. You should also read the section from the tutorial on "How to Use Threads" since you are not using the Thread correctly in you simple demo.

  • Glass pane in popup

    I have a button on click i will load a popup window. I want to show a glass pane and splash screen in the popup. How can I do that on click of parent screen command button ?
    <af:commandImageLink text="#{row.ProjectName}" id="cil1"
    action="dialog:callEditProject"
    useWindow="true"
    windowEmbedStyle="inlineDocument"
    windowModalityType="applicationModal"
    windowHeight="500" windowWidth="900"
    launchListener="#{EditProjectLaunchBean.launchEditProject}"/>
    I am able to do a glasspane splash screen on the same window using the example
    http://www.oracle.com/technetwork/developer-tools/adf/learnmore/27-long-running-queries-169166.pdf
    Thanks
    Suneesh

    I got the same problem. Is there any solution yet??

Maybe you are looking for

  • The 3D Features doesn't work on my Photoshop CS6 extended.

    Hi, I am using Adobe CS6 extended. I can't use my 3d features on creating objects but it can work with creating 3d font text. When I select the object, the 3D Properties are unable to click on any function May I know what is the problem? Is there any

  • Time machine only mounts the drive to Finder. The Program doesn't open. What is missing here?

    Selecting <Time Machine> <enter time machine> on my Mac Air brings up a dialogue <connecting to backup disk>.  The disk  appears <mounted> on the desktop as a icon and shows as a connected drive in Finder.  It doesnt  open into the Time Machine inter

  • Replication error on windows 2012 DC

    Hi, I have added Windows 2012 R2 server (cadpdc1) to windows 2003 sp2 DC  (Primary DC) and promoted it as DC. After the promote I have ran dcdiag and it shows errors. Each of servers have three NICs connected to different networks. Please help me wit

  • Error while submitting a conc program through CONCSUB in shell script

    Hi All, I am working on 11.5.10.2. I have a shell script from which I am calling a concurrent program using CONCSUB utility as below CONCSUB $p_login $p_resp_appl_short_name "$p_resp_name" $p_user_name CONCURRENT $p_conc_appl_short_name $p_conc_prog_

  • Error in Seeburger SFTP receiver in append mode.

    Hi, I am trying to do content conversion in Seeburger SFTP adapter at the receiver side and was successfully able to create the first CSV record. I am using append mode in receiver adapter. But when sent another record from sender; I got below error.