?
Solved

Problem opening new window with SWT browser in swing JFrame

Posted on 2013-02-04
1
Medium Priority
?
1,116 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 2000 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Suggested Courses

777 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