• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to display a website that ONLY open in IE by webview javafx  RSS feed

 
nguyen hung cuong
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all,
I want to render a website by webview in javafx, but my website ONLY support IE. How can i do that? If webview can not do that. Please give me other way? Thank you in advance

Note: My website contains this code:

 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am confused with your requirement. The JavaFX WebView IS the browser. So where does IE come into the picture? Perhaps if you could share the workflow, things would be clearer?
 
nguyen hung cuong
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maneesh Godbole wrote:I am confused with your requirement. The JavaFX WebView IS the browser. So where does IE come into the picture? Perhaps if you could share the workflow, things would be clearer?


My sample code quite easy, just loading the content of a website on JFXPanel. It works normally with almost of url. But it doesn't work in this case (blank when display URL_BSI)

Main.java
 


SwingBrowser.java



URL_BSI html

 
Paul Clapham
Sheriff
Posts: 22718
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maneesh Godbole wrote:I am confused with your requirement. The JavaFX WebView IS the browser. So where does IE come into the picture?


The posted code didn't answer your question at all, as far as I can see. So let me try again:

Am I right in assuming that you want the JavaFX WebView to be IE, or at least to pretend convincingly that it is IE?

(I could also ask what utility there is in having a web site which only responds to IE... especially since you seem to be the owner of that site.)
 
nguyen hung cuong
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul Clapham wrote:Am I right in assuming that you want the JavaFX WebView to be IE, or at least to pretend convincingly that it is IE?


Yes, that's exactly what i want.


Paul Clapham wrote:(I could also ask what utility there is in having a web site which only responds to IE... especially since you seem to be the owner of that site.)

All website in my company using IE and that website is not my own.
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
nguyen hung cuong wrote:
Paul Clapham wrote:Am I right in assuming that you want the JavaFX WebView to be IE, or at least to pretend convincingly that it is IE?


Yes, that's exactly what i want.

Ah ok! Now I understand. Thanks Paul!

From the API docs, it seems you can set the user agent
Have you tried that for IE impersonation?
 
nguyen hung cuong
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maneesh Godbole wrote:From the API docs, it seems you can set the user agent
Have you tried that for IE impersonation?


Yes but it did not work.



Is there any web engine in java like IE or any lib that i can embed IE on java application
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What happened when you say it did not work

Did you set a break point to see how the trident condition evaluated in

 
nguyen hung cuong
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maneesh Godbole wrote:What happened when you say it did not work

Did you set a break point to see how the trident condition evaluated in




I dont know how to debug in this case.
I added your recommended code but nothing appears in panel
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is not my recommended code. It is a snippet which you posted in your original post.

Which IDE are you using? If eclipse check out
http://www.vogella.com/tutorials/EclipseDebugging/article.html#setting-breakpoints
 
nguyen hung cuong
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maneesh Godbole wrote:It is not my recommended code. It is a snippet which you posted in your original post.

Which IDE are you using? If eclipse check out
http://www.vogella.com/tutorials/EclipseDebugging/article.html#setting-breakpoints


Sorry but i did not get you.
setUserAgent() just fake the UserAgent to pass over the condition:


You can see:

This is an IE-specific object, and it is used in goSession() function, so ONLY fake the user-agent doesnt work in this case.
I want the JavaFX WebView to be IE, if not, can you give me the other way

 
Tim Moores
Saloon Keeper
Posts: 3966
94
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The JavaFX browser engine is far from IE, so I think it's highly unlikely that you'll get this to work. I don't see how setting (or detecting) the UA would help with this.
 
nguyen hung cuong
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tim Moores wrote:The JavaFX browser engine is far from IE, so I think it's highly unlikely that you'll get this to work. I don't see how setting (or detecting) the UA would help with this.


Thank you. I am still stuck on this problem
 
Paul Clapham
Sheriff
Posts: 22718
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've been working in Swing and unlike JavaFX it doesn't have a built-in browser component. But people have written browser components for Swing, quite a technical challenge in my opinion. So I've been using the DJ Project and it works quite well for me. You can even load a page and call a Javascript function from Java code, and get the result of the function back.

However... I'm pretty sure that in its default form it doesn't act like IE. Although I might be wrong about that because I didn't care and didn't pay much attention. But I read the documentation and help files about how to use other browsers (like Firefox) and it does let you configure the code to use different browsers but the instructions are written by somebody with a very strong Unix accent and for a Windows user they are almost impenetrable.

But if you're out of other options, this or some other similar product might be made to work. Maybe it could even be made to work in JavaFX.
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is also the Lobo Browser which seems to have JavaFX support/compatibility
 
nguyen hung cuong
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul Clapham wrote:I've been working in Swing and unlike JavaFX it doesn't have a built-in browser component. But people have written browser components for Swing, quite a technical challenge in my opinion. So I've been using the DJ Project and it works quite well for me. You can even load a page and call a Javascript function from Java code, and get the result of the function back.

However... I'm pretty sure that in its default form it doesn't act like IE. Although I might be wrong about that because I didn't care and didn't pay much attention. But I read the documentation and help files about how to use other browsers (like Firefox) and it does let you configure the code to use different browsers but the instructions are written by somebody with a very strong Unix accent and for a Windows user they are almost impenetrable.

But if you're out of other options, this or some other similar product might be made to work. Maybe it could even be made to work in JavaFX.


Thank you. I am trying to to integrate the DJ native Swing into a NetBeans RCP Application. It's quite hard for me.
 
Paul Clapham
Sheriff
Posts: 22718
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It was hard for me too.
 
nguyen hung cuong
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul Clapham wrote:It was hard for me too.


Hello Paul Clapham,
1. Did you follow this guide?
https://dzone.com/articles/how-to-nb-djnative-swing
2. If you followed it, could you explain step 13 for me. I dont know how to do it at all.


 
Paul Clapham
Sheriff
Posts: 22718
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, fortunately I didn't do any of that stuff. That looks like way too much work. Since I'm only supporting Windows I just downloaded the Windows jar file and put that into the application's build path. Then after some mucking about with test programs I wrote this code:



That returns a web browser component (compatible with Swing) which starts with a particular local HTML file but you could use any URL. There's a bit more code necessary to start and end support for the DJ classes but it's not a big deal. I don't have any other code in my application

But that's for an ordinary Swing application targeted at only one environment. I have no idea what "Netbeans RCP" means and whether it needs all of that code in the document you linked to, though. Sorry about that.
 
Dave Tolls
Ranch Foreman
Posts: 3010
37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do these things allow you to use ActiveX objects (which is a what that <object> above in post looks like) in those FX/Swing "browsers"?
 
nguyen hung cuong
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul Clapham wrote:No, fortunately I didn't do any of that stuff. That looks like way too much work. Since I'm only supporting Windows I just downloaded the Windows jar file and put that into the application's build path. Then after some mucking about with test programs I wrote this code:



That returns a web browser component (compatible with Swing) which starts with a particular local HTML file but you could use any URL. There's a bit more code necessary to start and end support for the DJ classes but it's not a big deal. I don't have any other code in my application


I did as your suggestion. Unfortunately, JWebBrowser just work well on window 32 bit. In window 64bit, it did not work anymore in my case. My application need to work in cross platform.
 
nguyen hung cuong
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dave Tolls wrote:Do these things allow you to use ActiveX objects (which is a what that <object> above in post looks like) in those FX/Swing "browsers"?


I dont know how to use it
 
Tim Moores
Saloon Keeper
Posts: 3966
94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
nguyen hung cuong wrote: My application need to work in cross platform.

I've said this before, but since you're still trying to get this to work I thought I'd repeat it: I think you're highly unlikely to succeed with this. An IE-only site needs IE, and that simply doesn't exist on other platforms. Nor is it supported under Windows at this point.

A better approach would be to re-engineer the web site to use standards, and thus be usable from any client platform.
 
nguyen hung cuong
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tim Moores wrote:
nguyen hung cuong wrote: My application need to work in cross platform.

A better approach would be to re-engineer the web site to use standards, and thus be usable from any client platform.


Thank you, I will give my web developer this suggestion.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!