You are not logged in.

swissmade

Beginner

  • "swissmade" is male
  • "swissmade" started this thread

Posts: 46

Date of registration: Aug 4th 2011

Location: The Netherlands

Occupation: Old Fasion Programmer

Hobbies: Play Music with my Bass

  • Send private message

1

Friday, August 12th 2011, 4:54pm

[SOLVED] Set Parameters for Java Applet

Hi all,
Can antibody help with this to translate to Jabaco.
I like to use this in the application.
one week of searching and I don't get it yet.

<applet code="com.somecode" archive="test.jar" width="320" height="240">
<param name="url" value="URL-IP/>
<param name="profile" value="Test"/>
<param name="accessories" value="ZoomIn,ZoomOut,Pan,Home"/>
<applet/>
I think I have to use something like setParameters :S

Any help will be welcome,
Best regards,
Swissmade

This post has been edited 2 times, last edit by "swissmade" (Sep 7th 2011, 1:33pm)


theuserbl

Intermediate

Posts: 436

Date of registration: Dec 20th 2008

  • Send private message

2

Saturday, August 13th 2011, 3:36am

RE: Set Parameters for Java Applet

Hi all,
Can antibody help with this to translate to Jabaco.
Currently I am again on Linux, so currently I can only help you in Java. But if you want, I can translate it later to Jabaco.

Quoted

I think I have to use something like setParameters :S
Sounds right, but there don't exists a setParameters()-method.

Quoted

<applet code="com.somecode" archive="test.jar" width="320" height="240">
<param name="url" value="URL-IP/>
<param name="profile" value="Test"/>
<param name="accessories" value="ZoomIn,ZoomOut,Pan,Home"/>
<applet/>

Here the integration in an Java-application:

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
import javax.swing.*;

public class StartIt extends JFrame {

  public StartIt() {
    super("Show Applet in a Window");
    mySomecode c = new mySomecode();
    JPanel p = new JPanel();
    p.setLayout(null);
    c.setBounds(50,50,320,240);   // placing the applet with its size 320x240 in the window at the position 50,50
    c.init();
    c.start();
    p.add(c);
    add(p);
  }

  public static void main(String[] args) {
    StartIt f = new StartIt();
    f.setSize(500,400);
    f.setVisible(true);
    f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  }

  public class mySomecode extends com.somecode {
    public String getParameter(String name) {
      if (name.equals("url")) {
        return "URL-IP";
      } else if (name.equals("profile")) {
        return ("Test");
      } else if (name.equals("accessories")) {
        return ("ZoomIn,ZoomOut,Pan,Home");
      }
      return "";
    }
  }
}



Greatings
theuserbl

swissmade

Beginner

  • "swissmade" is male
  • "swissmade" started this thread

Posts: 46

Date of registration: Aug 4th 2011

Location: The Netherlands

Occupation: Old Fasion Programmer

Hobbies: Play Music with my Bass

  • Send private message

3

Saturday, August 13th 2011, 10:42am

Set Parameters for Java Applet

HI theuserbl,
The Source looks great many thanks for this.
But now the translation to Jabaco.
I will try even I don't really understand the structure :cursing: of Java. I never can remember the functions there so many.

Many thanks for help :thumbsup: ,

Swissmade

swissmade

Beginner

  • "swissmade" is male
  • "swissmade" started this thread

Posts: 46

Date of registration: Aug 4th 2011

Location: The Netherlands

Occupation: Old Fasion Programmer

Hobbies: Play Music with my Bass

  • Send private message

4

Saturday, August 13th 2011, 1:38pm

RE: Set Parameters for Java Applet

HI theuserbl,
The Source looks great many thanks for this.
But now the translation to Jabaco.
I will try even I don't really understand the structure :cursing: of Java. I never can remember the functions there so many.

Many thanks for help :thumbsup: ,

Swissmade
Not happy to say that I don't get this working. :cursing:

theuserbl

Intermediate

Posts: 436

Date of registration: Dec 20th 2008

  • Send private message

5

Saturday, August 13th 2011, 3:12pm

RE: RE: Set Parameters for Java Applet

Not happy to say that I don't get this working. :cursing:


Ok, here the easy way:

1. Download AppletInJabaco.zip
This program integrates the clock example of the Java JDK. The example is in the zip-file, too.
2. Load "AppletInJabaco.jba" in Jabaco.
3. press "F1" and adding the directory in which Clock.class can be found.
4. Start the Jabaco program
Now the Clock-Applet should be running in an Jabaco-Form
5. Press again "F1, deleting the directory which "Clock.class" have and adding your Jar test.jar.
6. Modifiing Class1 in the Jabaco-IDE.
7. Now run the Program again.

If there comes an Exception as written text in the Form, then it is really a problem, because then it can be possible, that your Applet ask where to find the html-file...

Greatings
theuserbl
theuserbl has attached the following file:

swissmade

Beginner

  • "swissmade" is male
  • "swissmade" started this thread

Posts: 46

Date of registration: Aug 4th 2011

Location: The Netherlands

Occupation: Old Fasion Programmer

Hobbies: Play Music with my Bass

  • Send private message

6

Saturday, August 13th 2011, 4:31pm

RE: RE: RE: Set Parameters for Java Applet

Not happy to say that I don't get this working. :cursing:


Ok, here the easy way:

1. Download AppletInJabaco.zip
This program integrates the clock example of the Java JDK. The example is in the zip-file, too.
2. Load "AppletInJabaco.jba" in Jabaco.
3. press "F1" and adding the directory in which Clock.class can be found.
4. Start the Jabaco program
Now the Clock-Applet should be running in an Jabaco-Form
5. Press again "F1, deleting the directory which "Clock.class" have and adding your Jar test.jar.
6. Modifiing Class1 in the Jabaco-IDE.
7. Now run the Program again.

If there comes an Exception as written text in the Form, then it is really a problem, because then it can be possible, that your Applet ask where to find the html-file...

Greatings
theuserbl
Very Nice Clock is working.
I try to get the rest.
The Applet is Cambozola for IP-Cam Mjpeg stream so we have no text I hope.
This is a jar file where all the classes are in.
Keep you inform.
Many thanks again. :thumbsup:

This post has been edited 2 times, last edit by "swissmade" (Aug 13th 2011, 4:52pm)


swissmade

Beginner

  • "swissmade" is male
  • "swissmade" started this thread

Posts: 46

Date of registration: Aug 4th 2011

Location: The Netherlands

Occupation: Old Fasion Programmer

Hobbies: Play Music with my Bass

  • Send private message

7

Sunday, August 14th 2011, 7:25am

RE: RE: RE: RE: Set Parameters for Java Applet

Not happy to say that I don't get this working. :cursing:


Ok, here the easy way:

1. Download AppletInJabaco.zip
This program integrates the clock example of the Java JDK. The example is in the zip-file, too.
2. Load "AppletInJabaco.jba" in Jabaco.
3. press "F1" and adding the directory in which Clock.class can be found.
4. Start the Jabaco program
Now the Clock-Applet should be running in an Jabaco-Form
5. Press again "F1, deleting the directory which "Clock.class" have and adding your Jar test.jar.
6. Modifiing Class1 in the Jabaco-IDE.
7. Now run the Program again.

If there comes an Exception as written text in the Form, then it is really a problem, because then it can be possible, that your Applet ask where to find the html-file...

Greatings
theuserbl
Very Nice Clock is working.
I try to get the rest.
The Applet is Cambozola for IP-Cam Mjpeg stream so we have no text I hope.
This is a jar file where all the classes are in.
Keep you inform.
Many thanks again. :thumbsup:
Have done like you told.
Change the reference to the jar file.
Set in class1 the superclass prop. to the starting class in this case viewer.class.
Set also the parameters in this case only the URL.
Its not working. The problem may be that the viewer class has his own main.
I get a error java.lang.NullPointerException at java.applet.Applet.getDocumentBase(Unknown Source) ?(
I'm a little stuck here. Maybe its not working at all. :S
Maybe still some ideas here.
Many thanks for help. :thumbup:
Swissmade

swissmade

Beginner

  • "swissmade" is male
  • "swissmade" started this thread

Posts: 46

Date of registration: Aug 4th 2011

Location: The Netherlands

Occupation: Old Fasion Programmer

Hobbies: Play Music with my Bass

  • Send private message

8

Tuesday, August 16th 2011, 3:45pm

Maybe still some ideas here.
I have a problem with getDocumentBase.
See error
at java.applet.Applet.getDocumentBase(Unknown Source)
at com.charliemouse.cambozola.Viewer.init(Viewer.java:131)
at Usercontrol1.Usercontrol_Initialize(Usercontrol1.jsrc:5)
at VB.Usercontrol.fireLoaded(Usercontrol.jsrc)
at VB.LoadAdapter.run(LoadAdapter.jsrc)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)

Somebody any idea how to get this.

Thanks

This post has been edited 1 times, last edit by "swissmade" (Aug 28th 2011, 8:37am)


swissmade

Beginner

  • "swissmade" is male
  • "swissmade" started this thread

Posts: 46

Date of registration: Aug 4th 2011

Location: The Netherlands

Occupation: Old Fasion Programmer

Hobbies: Play Music with my Bass

  • Send private message

9

Wednesday, September 7th 2011, 1:32pm

[SOLVED] Set Parameters for Java Applet

Have it running like a charm.

Strip down the Java source from the applet.

Cheers

Swissmade 8)

Rate this thread
WoltLab Burning Board