Hi,
it is possible to use a java swing webbrowser within Jabaco.
A very simple browser (without any intelligence ...) based on the RichTextBox control:
Unlike VB6, Jabaco does not yet support ActiveX objects like Microsoft's Internet Explorer.
Happy experimenting!
A1880
it is possible to use a java swing webbrowser within Jabaco.
A very simple browser (without any intelligence ...) based on the RichTextBox control:
|
|
Jabaco Source |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
Option Explicit Public Sub Command1_Click() Dim kit As javax#swing#text#html#HTMLEditorKit Dim doc As javax#swing#text#html#HTMLDocument Dim url As java#net#URL RichTextBox1.Parent.setContentType "text/html" kit = Cast(RichTextBox1.Parent.getEditorKitForContentType("text/html"), HTMLEditorKit) doc = Cast(kit.createDefaultDocument(), HTMLDocument) url = New URL(Text1.Text) RichTextBox1.Parent.read(url.openStream(), doc) End Sub Public Sub Form_Load() Text1.Text = "http://www.jabaco.org" Me.Width = Screen.Width Me.Height = Screen.Height Me.Left = 0 Me.Top = 0 Command1_Click End Sub Public Sub Form_Resize() Const xGap = 10 Const yGap = 10 Command1.Left = xGap Text1.Left = Command1.Left + Command1.Width + xGap Text1.Width = Me.Width - xGap - Text1.Left Text1.Top = yGap Command1.Top = yGap RichTextBox1.Width = Me.Width - 2*xGap RichTextBox1.Left= xGap RichTextBox1.Top = Command1.Top + Command1.Height+yGap RichTextBox1.Height = Me.Height - 1 * yGap - RichTextBox1.Top End Sub |
Unlike VB6, Jabaco does not yet support ActiveX objects like Microsoft's Internet Explorer.
Happy experimenting!
A1880
Wow thats a nice example
To prevent editing, we can also set the locked property to "True"
Scripts dont always work. maybe thats a limitation of the richtextbox.
We can also add the protocol: some people forget it.
In command1_click, we might add
we add it so no errors occur
P.S. I havent tested it yet
:p :p
To prevent editing, we can also set the locked property to "True"
Scripts dont always work. maybe thats a limitation of the richtextbox.
We can also add the protocol: some people forget it.
In command1_click, we might add
|
|
Jabaco Source |
1 2 3 4 5 6 |
If Left$(Text1.Text,7)<>"http://" OR Left$(Text1.Text,7)<>"HTTP://" Then 'add "HTTP://" Dim Add As String Add=Text1.Text Text1.Text="http://" + Add End If |
we add it so no errors occur
P.S. I havent tested it yet
:p :p
This post has been edited 2 times, last edit by "klctal" (Sep 24th 2009, 2:21pm)
Hi, A1880
very interesting that is possible to use WebBrowser functionalities!
Please, could you provide more documentation
(and examples) on how to retreive the source code of a page
and navigating between links?
If it would be possible, I could start migrating some applications
of mine on Jabaco.
More: I unserstand
and
but in not friendly with Java. Could it be a limitation for using Jabaco?
very interesting that is possible to use WebBrowser functionalities!
Please, could you provide more documentation
(and examples) on how to retreive the source code of a page
and navigating between links?
If it would be possible, I could start migrating some applications
of mine on Jabaco.
More: I unserstand
|
|
Source code |
1 |
Dim kit As javax#swing#text#html#HTMLEditorKit |
and
|
|
Source code |
1 |
kit = Cast(RichTextBox1.Parent.getEditorKitForContentType("text/html"), HTMLEditorKit)
|
but in not friendly with Java. Could it be a limitation for using Jabaco?
Hi,
sorry, I don't have more documentation at hand.
Honestly, it is a far way from my little demo to a decent web browser plug-in.
Apart from following links and handling events, a major challenge is to deal with Javascript and cascading style sheets.
In case you really want a browser window, you should go for some more complete open source java browser project.
Java and Swing knowledge helps if you plan advanced things in Jabaco.
That's the same with VB6. You have to know the Win32 API to shine with your VB6 applications.
But Jabaco offers a lot of advanced feature without diving into Java.
Examples include: proper object orientation including inheritance, multi-threading, platform independence, ...
Success!
A1880
sorry, I don't have more documentation at hand.
Honestly, it is a far way from my little demo to a decent web browser plug-in.
Apart from following links and handling events, a major challenge is to deal with Javascript and cascading style sheets.
In case you really want a browser window, you should go for some more complete open source java browser project.
Java and Swing knowledge helps if you plan advanced things in Jabaco.
That's the same with VB6. You have to know the Win32 API to shine with your VB6 applications.
But Jabaco offers a lot of advanced feature without diving into Java.
Examples include: proper object orientation including inheritance, multi-threading, platform independence, ...
Success!
A1880
https://jdic.dev.java.net/
The JDesktop Integration Components does have a Browser control that could be useful for Jabaco. In fact JDIC has a lot of stuff that we could find useful. For example they also hav a tray icon class and code for launching applications pending on desktop configuration.
The JDesktop Integration Components does have a Browser control that could be useful for Jabaco. In fact JDIC has a lot of stuff that we could find useful. For example they also hav a tray icon class and code for launching applications pending on desktop configuration.
Hi Faldegast,
the link you posted is very interesting, probably
a good point with starting WebBrowser functionalities integration
in Jabaco. Unfortunately, I have no experience (and no time to learn)
with Java. If anyone (A1880 ? :-]) find a way
to integrate a very simple and raw webbrowser component
in Jabaco IDE, it will be really appreciated not only by me!
In first step is not really important for the goal, display pages
correctly (javascript engine, css handling, etc),
just a simple methods to navigate beetween links
and getting source page html code.
I'm still watching at the previous posted example, on how to expand it
but due to my ignorance in java, it seems too hard going ahead.
Thanks in advance for any contribute!
Regards,
Andrea
the link you posted is very interesting, probably
a good point with starting WebBrowser functionalities integration
in Jabaco. Unfortunately, I have no experience (and no time to learn)
with Java. If anyone (A1880 ? :-]) find a way
to integrate a very simple and raw webbrowser component
in Jabaco IDE, it will be really appreciated not only by me!
In first step is not really important for the goal, display pages
correctly (javascript engine, css handling, etc),
just a simple methods to navigate beetween links
and getting source page html code.
I'm still watching at the previous posted example, on how to expand it
but due to my ignorance in java, it seems too hard going ahead.
Thanks in advance for any contribute!
Regards,
Andrea
That's a reference to "javax.swing.text.html.HTMLDocument", a class of Java Swing.
Swing is the Java graphics system used by the Jabaco framework to display forms, buttons, user controls in general, ...
The Jabaco syntax uses "#" instead of "." as path separator for Java class hierarchies.
If you ask Google for javax.swing.text.html.HTMLDocument it will return 24.800 hits.
Happy reading!
A1880
Swing is the Java graphics system used by the Jabaco framework to display forms, buttons, user controls in general, ...
The Jabaco syntax uses "#" instead of "." as path separator for Java class hierarchies.
If you ask Google for javax.swing.text.html.HTMLDocument it will return 24.800 hits.
Happy reading!
A1880
Could you explain a bit what you are trying to achieve?
I don't understand your question.
As far as I know there is no simple way to integrate a full webbrowser component in Jabaco applications.
In VB6 or VB.Net one could use Internet Explorer as ActiveX control, but this is not so easy in Jabaco.
It might be possible to use frameworks like Jacob (Java COM Bridge) to integrate IE.
Another option was mentioned above: Use a Java framework which implements a browser and is Swing compliant.
Again, this won't be easy and I don't have a tutorial on how to do that. Sorry!
Happy digging
A1880
I don't understand your question.
As far as I know there is no simple way to integrate a full webbrowser component in Jabaco applications.
In VB6 or VB.Net one could use Internet Explorer as ActiveX control, but this is not so easy in Jabaco.
It might be possible to use frameworks like Jacob (Java COM Bridge) to integrate IE.
Another option was mentioned above: Use a Java framework which implements a browser and is Swing compliant.
Again, this won't be easy and I don't have a tutorial on how to do that. Sorry!
Happy digging
A1880
