Skip to content
Haixing Hu edited this page Sep 18, 2014 · 4 revisions

This is the BurredPanel widget comes from the OPAL project. It can be use to put focus on a particular element by blurring the other content of the window.

Usage

Screen Shot of the DarkPanel Widget

The usage is very simple :

  • Create a BlurredPanel.
  • Change the radius value of the BlurredPanel.
  • Open the panel with the method show().
  • Close the panel with the method hide().

Here is the code snippet:

final BurredPanel p = new BurredPanel(shell);

...

final Button ok = new Button(shell, SWT.PUSH);
ok.setText("Ok");
...
ok.addSelectionListener(new SelectionListener() {

   @Override
   public void widgetSelected(final SelectionEvent e) {

      p.show();
      Dialog.isConfirmed("Confirmation", 
      	"Are you sure you want to save this form ?");
      p.hide();
	}

    @Override
    public void widgetDefaultSelected(final SelectionEvent e) {
    	....
    }
});

Example

An example is located in the source repository:

src/test/java/com/github/haixing_hu/swt/window/BurredPanelExample.java
Clone this wiki locally