You are not logged in.

Dear visitor, welcome to Jabaco - Community. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

dolcevita

Beginner

  • "dolcevita" is male
  • "dolcevita" started this thread

Posts: 12

Date of registration: Sep 21st 2009

Location: Firenze, Italy

Occupation: Software Developer

Hobbies: Sport, Music (I play the piano)

  • Send private message

1

Monday, September 21st 2009, 5:49pm

WebBrowser

is here in Jabaco the possibility to use VB6 WebBrowser control
or anything similar?

A1880

Intermediate

  • "A1880" is male

Posts: 500

Date of registration: Jan 1st 2009

Location: Hanover, Germany

Occupation: Software Engineer

Hobbies: Hilbert Curves

  • Send private message

2

Monday, September 21st 2009, 7:37pm

Hi,
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

klctal

Trainee

  • "klctal" is male

Posts: 70

Date of registration: Jul 13th 2009

Location: Shanghai

Hobbies: Developing software

  • Send private message

3

Tuesday, September 22nd 2009, 10:36am

Wow thats a nice example :thumbup:
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
:D

This post has been edited 2 times, last edit by "klctal" (Sep 24th 2009, 2:21pm)


dolcevita

Beginner

  • "dolcevita" is male
  • "dolcevita" started this thread

Posts: 12

Date of registration: Sep 21st 2009

Location: Firenze, Italy

Occupation: Software Developer

Hobbies: Sport, Music (I play the piano)

  • Send private message

4

Friday, September 25th 2009, 11:48am

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

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?

A1880

Intermediate

  • "A1880" is male

Posts: 500

Date of registration: Jan 1st 2009

Location: Hanover, Germany

Occupation: Software Engineer

Hobbies: Hilbert Curves

  • Send private message

5

Friday, September 25th 2009, 1:22pm

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

Faldegast

Beginner

Posts: 25

Date of registration: Oct 6th 2009

  • Send private message

6

Tuesday, October 6th 2009, 5:47pm

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.

dolcevita

Beginner

  • "dolcevita" is male
  • "dolcevita" started this thread

Posts: 12

Date of registration: Sep 21st 2009

Location: Firenze, Italy

Occupation: Software Developer

Hobbies: Sport, Music (I play the piano)

  • Send private message

7

Monday, October 12th 2009, 11:45am

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

  • "santiago.barreiro" is male

Posts: 14

Date of registration: Jan 29th 2010

Location: Guayaquil, Ecuador

Occupation: Manager of a software company

Hobbies: Music player

  • Send private message

8

Sunday, January 31st 2010, 11:09pm

Hello 1880, again me...

What is the "javax#swing#text#html#HTMLDocument" in the
following dim statement?

Dim doc As javax#swing#text#html#HTMLDocument

Where do I get information in regard to this type?

Regards


Santiago

A1880

Intermediate

  • "A1880" is male

Posts: 500

Date of registration: Jan 1st 2009

Location: Hanover, Germany

Occupation: Software Engineer

Hobbies: Hilbert Curves

  • Send private message

9

Monday, February 1st 2010, 9:05am

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

  • "santiago.barreiro" is male

Posts: 14

Date of registration: Jan 29th 2010

Location: Guayaquil, Ecuador

Occupation: Manager of a software company

Hobbies: Music player

  • Send private message

10

Monday, February 1st 2010, 5:28pm

Thanks! I will do some search on that.... regards

Posts: 1

Date of registration: Apr 10th 2011

  • Send private message

11

Sunday, April 10th 2011, 6:07pm


I am not running code webbrowser. You can put a tutorial made ​​up of pictures? Or if someone help me? My messenger address is: florin.csharp @ yahoo.com. thanks!!!! :D




A1880

Intermediate

  • "A1880" is male

Posts: 500

Date of registration: Jan 1st 2009

Location: Hanover, Germany

Occupation: Software Engineer

Hobbies: Hilbert Curves

  • Send private message

12

Sunday, April 10th 2011, 10:27pm

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

Rate this thread
WoltLab Burning Board