Solved

Problem opening new window with SWT browser in swing JFrame

Posted on 2013-02-04
1
1,096 Views
Last Modified: 2013-02-24
hello.
i am using SWT browser widget in swing Jframe application.
like this


      display = new Display();
             Shell shell = SWT_AWT.new_Shell(display, canvas);
             shell.setLayout(new FillLayout());
         browser = new Browser(shell, SWT.NONE);
         boolean rc = browser.setUrl("http://www.yahoo.com");
             shell.setSize(canvas.getWidth(), canvas.getHeight());
             shell.pack();
             while (!shell.isDisposed()) {
              if (!display.readAndDispatch()) {
               display.sleep();
              }
             }



I have a problem when clicking on links that would open in a new window.
(target="blank")
my app ignored click, react nothing.

Instead of opening those pages in my app,
my system default browser(IE) opens those URL.

Im thinking about using "browser.addOpenWindowListener".
but i dont know how to solve it.

https://bugs.eclipse.org/bugs/show_bug.cgi?id=57068#c2
he seems having same problem...but his solution doesnot work for mine.

any help would appreciated.
0
Comment
Question by:HFunakawa
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 36

Accepted Solution

by:
mccarl earned 500 total points
ID: 38859003
This link, http://www.java2s.com/Code/Java/SWT-JFace-Eclipse/SWTBrowserExample.htm contains an example of using the addOpenWindowListener. You should be able to use this information to implement your own solution.

Let me know if you require further help!
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question