You are not logged in.

marbel1990

Beginner

  • "marbel1990" started this thread

Posts: 9

Date of registration: Feb 14th 2009

  • Send private message

1

Tuesday, September 15th 2009, 9:09pm

Security Meldung

Hallo,

Habe ein Problem...

Ich habe ein Applet und 1 Form. Auf dieser Form , ich nenne sie Form1 liegt ein Richtextbox Objekt.
In Jabaco local auf dem PC funktioniert es wunderbar, im Web als signiertes Applet leider nicht :( erhalte folgende Meldung:

Source code

1
java.lang.IllegalAccessError: tried to access field Applet1.benutzername from class channelfenster


Weiß jemand abhilfe? wie gesagt... local funktionierts wunderbar!

Ausschnitt (aufruf im Applet):

Source code

1
2
'Code steht im Applet, nicht in einer form
form1.richtextbox1.text = "test"




Gruß

Marbel

This post has been edited 1 times, last edit by "marbel1990" (Sep 18th 2009, 12:11am)


marbel1990

Beginner

  • "marbel1990" started this thread

Posts: 9

Date of registration: Feb 14th 2009

  • Send private message

2

Friday, September 18th 2009, 12:10am

Hallo,

Niemand eine Idee? :(

PS:
Sorry für Doppelposting

OlimilO

Intermediate

  • "OlimilO" is male

Posts: 277

Date of registration: Jan 18th 2009

Location: Germany

Occupation: software engineer

  • Send private message

3

Friday, September 18th 2009, 10:00am

Hallo,


lad doch mal dein Projekt hoch, vielleicht kann man sich das anschauen...



soviel ich weiß heißt das Standardformular in einem SDI-Projekt Form1 in einem Applet-Projekt Applet1

hast du das Applet-fenster umbenannt? wo steht die von dir gepostete Codezeile

innerhal des Formulars/Appletfensters? dann verwende bitte Me anstatt Form1 oder Applet1



OlimilO

Manuel

Administrator

  • "Manuel" is male

Posts: 256

Date of registration: Jul 16th 2008

Location: Erlangen, Germany

Occupation: Software Developer

Hobbies: Jabaco, game theory, text-mining

  • Send private message

4

Saturday, September 19th 2009, 12:58am

Quoted

java.lang.IllegalAccessError: tried to access field Applet1.benutzername from class channelfenster
Das gefällt dem Sicherheitsmanager wohl nicht. Versuche doch einfach eine öffentliche Methode / ein öffentliches Property innerhalb von Applet1 zu definieren.

Jabaco Source

1
2
3
Public Property Get Benutzername() As String
Benutzername = myBenutzername
End Property

marbel1990

Beginner

  • "marbel1990" started this thread

Posts: 9

Date of registration: Feb 14th 2009

  • Send private message

5

Saturday, September 19th 2009, 4:54pm

Hallo,

Danke für die bisherigen antworten!

@ manuel:

Jabaco Source

1
Public Property Get Benutzername() As String Benutzername = myBenutzername End Property


Wie steuer ich diese Methode an, wenn beispielsweise auf FOrm1 eine Textbox namens "Text1" ist und ich über daten, die im Applet sind (z.b. form1.text1.text = "test") an Form1 übergeben möchte?



PS, Code:
http://www.file-upload.net/download-1898678/code.rar.html

OlimilO

Intermediate

  • "OlimilO" is male

Posts: 277

Date of registration: Jan 18th 2009

Location: Germany

Occupation: software engineer

  • Send private message

6

Saturday, September 19th 2009, 5:36pm

habs mir jetzt angesehen und hab auch wieder was dabei gelernt ;)

Code in Form1:

Jabaco Source

1
2
3
Public Property Let Text1Text(aText As String)
   Me.Text1.Text = aText
End Property


Code im Applet:

Jabaco Source

1
2
3
4
5
6
7
8
9
Dim channelfenster As Form1
Public Sub Applet_Initialize()
   channelfenster = New Form1   
   channelfenster.Show()
End Sub
Public Sub Command1_Click()
   'hier ein Punkt weniger ;)
   channelfenster.Text1Text = "test"
End Sub


p.s: wenn das Form sichtbar sein soll dann Show erst bei Applet_Activate aufrufen:

Jabaco Source

1
2
3
Public Sub Applet_Activate()
   channelfenster.Show()
End Sub




OlimilO

Rate this thread
WoltLab Burning Board