Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[albireo-dev] Mac interaction problems

I am trying to embed a JPanel into SWT. While it works great on Windows, on
a Mac (10.5, Intel 32 bit, Java 1.5), there is no interaction with the
JPanel - it seems that the mouse events are not being passed to it from the
SwingControl.
Below are the relevant portions of the ViewPart class where I am embedding
the Swing display.
Any ideas why this isnt working on a Mac?
Thanks,
-john

    public void createPartControl(final Composite parent)
    {
        setTitleToolTip(getPartName());
        
        this.swingControl = new SwingControl(parent, SWT.NONE)
        {
            protected JComponent createSwingComponent()
            {
                panel = new JPanel();
                panel.setLayout(new BorderLayout());
                display = initializeDisplay();
                panel.add(display);
                
                ToolTipManager.sharedInstance().setInitialDelay(0);
                
                return panel;
            }

            public Composite getLayoutAncestor()
            {
                return parent;
            }  
            
            protected void afterComponentCreatedSWTThread()
            {
                SwingUtilities.invokeLater(new Runnable()
              {
                  public void run()
                  {
                      refreshData();
                  }
              });
            }
        };
    }    

    public void setFocus()
    {
        this.swingControl.setFocus();
    }



Back to the top