jbrowser
jbrowser copied to clipboard
Url not loaded in JFrame
I have used following code to load webpage in frame....
import java.awt.Canvas;
import java.awt.Dimension;
import java.awt.Toolkit;
import javax.swing.JFrame;
import ru.atomation.jbrowser.impl.JBrowserBuilder;
import ru.atomation.jbrowser.impl.JBrowserCanvas;
import ru.atomation.jbrowser.impl.JBrowserComponent;
import ru.atomation.jbrowser.impl.JComponentFactory;
import ru.atomation.jbrowser.interfaces.BrowserManager;
public class testbrowser {
public static void main(String[] args) {
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize((int) (screenSize.getWidth() * 0.75f),
(int) (screenSize.getHeight() * 0.75f));
frame.setLocationRelativeTo(null);
BrowserManager browserManager =
new JBrowserBuilder().buildBrowserManager();
JComponentFactory<Canvas> canvasFactory = browserManager.getComponentFactory(JBrowserCanvas.class);
JBrowserComponent<?> browser = canvasFactory.createBrowser();
frame.getContentPane().add(browser.getComponent());
frame.setVisible(true);
browser.setUrl("https://www.google.co.in/");
}
}
But this code is not working. Could not see anything inside frame.
Please help.
Thanks,
Jalpa
Original issue reported on code.google.com by [email protected]
on 6 Apr 2013 at 6:44
Can you paste console output of your program
Original comment by [email protected]
on 9 Apr 2013 at 1:08
- Added labels: ****
- Removed labels: ****
Here i am sending the screenshot of the console.
Original comment by [email protected]
on 9 Apr 2013 at 6:33
- Added labels: ****
- Removed labels: ****
Attachments:
I mean output of eclipse console
Original comment by [email protected]
on 9 Apr 2013 at 1:47
- Added labels: ****
- Removed labels: ****
Here I am sending output of console. But no exception is written there.
Original comment by [email protected]
on 10 Apr 2013 at 5:03
- Added labels: ****
- Removed labels: ****
Attachments:
Maybe you did not set maven profile. So you run programm without xulrunner.
Please try this snippet
http://code.google.com/p/jbrowser/source/browse/src/main/java/ru/atomation/jbrow
ser/snippets/XulrunnerPathSnippet.java?repo=snippets. You can download and
unpack xullrunner.
xulrunner archive:
http://code.google.com/p/jbrowser/downloads/detail?name=xulrunner-linux-1.9.jar&
can=2&q=
Original comment by [email protected]
on 11 Apr 2013 at 11:40
- Added labels: ****
- Removed labels: ****
I cannot understand what path have to put in place of "Specify your folder".
I have tried this,
new JBrowserBuilder().setXulRunnerPath(new
File("C:\\Users\\user\\Documents\\NetBeansProjects\\TaxAssist\\src")).buildBrows
erManager();
and I get same output as before.
Please help.
-Jalpa
Original comment by [email protected]
on 11 Apr 2013 at 12:11
- Added labels: ****
- Removed labels: ****
I cannot understand what path have to put in place of "Specify your folder".
I have tried this,
new JBrowserBuilder().setXulRunnerPath(new
File("C:\\Users\\user\\Documents\\NetBeansProjects\\TaxAssist\\src")).buildBrows
erManager();
and I get same output as before.
Please help.
-Jalpa
Original comment by [email protected]
on 11 Apr 2013 at 12:12
- Added labels: ****
- Removed labels: ****
* Download xulrunner-1.9.jar for you os from
http://code.google.com/p/jbrowser/downloads/list
* Unpack it (jar is archive).
* Find file xulrunner.tar.lzma and unpack it too.
For exmaple i unpack it into /home/caiiiycuk/jbrowser. Directory structure:
/home/caiiiycuk/jbrowser
/home/caiiiycuk/jbrowser/xulrunner
/home/caiiiycuk/jbrowser/xulrunner/xulrunner
* Set path pointing to root /home/caiiiycuk/jbrowser
If you do it right console output will be:
11.04.2013 21:26:55 ru.atomation.jbrowser.impl.JBrowserManager initialize
INFO: Using xul runner dir: /home/caiiiycuk/jbrowser/xulrunner/xulrunner
Without any error.
Original comment by [email protected]
on 11 Apr 2013 at 2:30
- Added labels: ****
- Removed labels: ****