Java in Browser

  • Thread starter Dirk Bruere at NeoPax
  • Start date
D

Dirk Bruere at NeoPax

John said:
Dirk Bruere at NeoPax said:
Owen said:
On 2009-03-03 21:33:25 -0500, Dirk Bruere at NeoPax
<[email protected]> said:

Mark Space wrote:
Dirk Bruere at NeoPax wrote:

Well, at present I am coloring in icons. Any bets that the
artistic "look and feel" arguments will take more time, effort
and cash than writing all the code?
Stay away from making any JFrame or JFrame forms (in the GUI
builder). Use JPanel directly or via the GUI builder (JPanel is
usually about two entries below JFrame when you bring up the
list).
Why?
Because JApplet will replace JFrame when you're building an applet.
You can add JPanels to JApplets the same way you can add them to
JFrames, but you can't add JFrames to JApplets.

(Applets can open JFrames, but they don't look great due to the
browser security crud stuck to the window decorations on most
systems.)
[...]
So I do everything inside a JPanel, which is contained within a JFrame?

JFrame is one of a small number of top-level containers; JApplet is
another:

<http://java.sun.com/docs/books/tutorial/uiswing/components/toplevel.html>

One top-level container may not contain another, although the same
content may be placed in either:

<http://sites.google.com/site/drjohnbmatthews/subway>
<http://mindprod.com/jgloss/applet.html>

I've rewritten the app as a JPanel.
I assume it's fairly easy now to add it to any top level container?

--
Dirk

http://www.transcendence.me.uk/ - Transcendence UK
http://www.theconsensus.org/ - A UK political party
http://www.onetribe.me.uk/wordpress/?cat=5 - Our podcasts on weird stuff
 
D

Dirk Bruere at NeoPax

D

Dirk Bruere at NeoPax

Dirk said:
It seems various industries are converging on that solution.
Which makes sense as everyone who uses a computer knows how to use a
browser. Makes it all seem friendly:) And Java is the perfect cross
platform solution. I did initially consider using C#, but porting that
to various machines would be a nightmare. Plus, we want to use Linux at
some point, and the way to make it me-friendly is the browser/Java
combination. With a bit of luck I won't have to know much about Linux at
all...

Having said that, there is a real need for a standard Java app to be
able to run in a browser tab, rather than independently. Any ideas?

--
Dirk

http://www.transcendence.me.uk/ - Transcendence UK
http://www.theconsensus.org/ - A UK political party
http://www.onetribe.me.uk/wordpress/?cat=5 - Our podcasts on weird stuff
 
J

John B. Matthews

[...]
I've rewritten the app as a JPanel.
I assume it's fairly easy now to add it to any top level container?

Yes, but only one top-level container at a time, as the subway example
shows. An application invokes main(), which adds the content to a
JFrame; in contrast, an applet invokes init(), which adds the content to
a JApplet.
 
D

Dirk Bruere at NeoPax

John said:
[...]
I've rewritten the app as a JPanel.
I assume it's fairly easy now to add it to any top level container?

Yes, but only one top-level container at a time, as the subway example
shows. An application invokes main(), which adds the content to a
JFrame; in contrast, an applet invokes init(), which adds the content to
a JApplet.

So writing all the stuff as JPanels is the way to go for producing code
that can be put into a number of application types. I think I might have
Sunday evening off...

--
Dirk

http://www.transcendence.me.uk/ - Transcendence UK
http://www.theconsensus.org/ - A UK political party
http://www.onetribe.me.uk/wordpress/?cat=5 - Our podcasts on weird stuff
 
A

Arne Vajhøj

Dirk said:
Having said that, there is a real need for a standard Java app to be
able to run in a browser tab, rather than independently. Any ideas?

That is what a Java applet does.

The security implications are given via your requirements - a browser
is a tool to surf the untrusted internet.

Arne
 
L

Lew

Dirk said:
Yes, I read it and the answer is that it's too complex for a user. By
user I mean someone who has difficulty understanding a TV remote control.

But not too complex for someone who intends to write software. That is a
skill that requires a minimum level of technical savvy.

If you cannot understand the tutorial there is very little likelihood that
answers here in clj.programmer will be of any use to you. Note the
"programmer" in the group name.
 
L

Lew

Dirk said:
Having said that, there is a real need for a standard Java app to be
able to run in a browser tab, rather than independently. Any ideas?

There is a solution that Sun provided for that "real" need: applets.
 
D

Dirk Bruere at NeoPax

Lew said:
But not too complex for someone who intends to write software. That is
a skill that requires a minimum level of technical savvy.

If you cannot understand the tutorial there is very little likelihood
that answers here in clj.programmer will be of any use to you. Note the
"programmer" in the group name.

So somebody clicks on our link because they want to use our program...
and what? They get a whole load of crap about policies etc? It's just
not on for the average user.

--
Dirk

http://www.transcendence.me.uk/ - Transcendence UK
http://www.theconsensus.org/ - A UK political party
http://www.onetribe.me.uk/wordpress/?cat=5 - Our podcasts on weird stuff
 
D

Dirk Bruere at NeoPax

Arne said:
That is what a Java applet does.

No. I want an app with all the access bells and whistles
The security implications are given via your requirements - a browser
is a tool to surf the untrusted internet.

Yet there is nothing in principle to bar a browser running a Java app in
a tab, just like an applet, is there? Apart, that is, from the fact that
nobody has implemented that feature.

--
Dirk

http://www.transcendence.me.uk/ - Transcendence UK
http://www.theconsensus.org/ - A UK political party
http://www.onetribe.me.uk/wordpress/?cat=5 - Our podcasts on weird stuff
 
D

Dirk Bruere at NeoPax

Lew said:
There is a solution that Sun provided for that "real" need: applets.

Not simple enough.
I want someone to be able to download an app into c:\progs either
manually or via an installer and then point their browser at it and run
it in a tab with no restrictions. And no security policy hassles for
them either. AIUI it can't be done.

--
Dirk

http://www.transcendence.me.uk/ - Transcendence UK
http://www.theconsensus.org/ - A UK political party
http://www.onetribe.me.uk/wordpress/?cat=5 - Our podcasts on weird stuff
 
A

Arne Vajhøj

Dirk said:
No. I want an app with all the access bells and whistles


Yet there is nothing in principle to bar a browser running a Java app in
a tab, just like an applet, is there? Apart, that is, from the fact that
nobody has implemented that feature.

An applet provides just that - a Java app running within the browser.

And if your browser supports tabs, then it can run in a tab.

But a browser is an application specifically developed to access
information on the internet.

Content on the internet can not be trusted.

So browsers and associated technologies and that includes
Java applets, Flash and JavaScript has certain security features.

For very good reasons.

If you want a browser and a Java plugin with no security, then
I guess you can get the source for Mozilla and OpenJDK and rip
out all security features.

But there will not be much interest in the result. The risk of
the user using that browser to surf the internet and a black
hat writing an applet that just wipes out the entire hard disk
is too big.

(it would actually be much worse if the applet installed a
trojan instead of just wiping out everything, but that is
besides the point)

Arne
 
A

Arne Vajhøj

Dirk said:
So somebody clicks on our link because they want to use our program...
and what? They get a whole load of crap about policies etc? It's just
not on for the average user.

There are 3 possible way of handling this:
A) always allow any internet content to do anything to their PC
B) reject any attempt to do anything to their PC
C) ask

A would create a huge security risks for the users.

B would prevent you from doing what you want.

C is your best choice.

Arne
 
A

Arne Vajhøj

Dirk said:
Not simple enough.
I want someone to be able to download an app into c:\progs either
manually or via an installer and then point their browser at it and run
it in a tab with no restrictions. And no security policy hassles for
them either. AIUI it can't be done.

Not unless you disable all security.

Arne
 
D

Dirk Bruere at NeoPax

Arne said:
There are 3 possible way of handling this:
A) always allow any internet content to do anything to their PC
B) reject any attempt to do anything to their PC
C) ask

A would create a huge security risks for the users.

B would prevent you from doing what you want.

C is your best choice.

Arne

What I want is something as simple as dowloading a .exe file, have the
installer say "do you want to run this yadda yadda" and zap - all done.
Next thing they know is that it opens in their browser tab and controls
the universe.

--
Dirk

http://www.transcendence.me.uk/ - Transcendence UK
http://www.theconsensus.org/ - A UK political party
http://www.onetribe.me.uk/wordpress/?cat=5 - Our podcasts on weird stuff
 
D

Dirk Bruere at NeoPax

Arne said:
Not unless you disable all security.

Security on a normally installed .exe, or Java desktop app is
non-existent. I just want it to run in a tab without the
extreme-non-technical user being hassled. We're talking users who have
never heard of Usenet and who can't really get their heads around spam
filters or what desktop shortcuts do.

--
Dirk

http://www.transcendence.me.uk/ - Transcendence UK
http://www.theconsensus.org/ - A UK political party
http://www.onetribe.me.uk/wordpress/?cat=5 - Our podcasts on weird stuff
 
D

Dirk Bruere at NeoPax

Arne said:
An applet provides just that - a Java app running within the browser.

And if your browser supports tabs, then it can run in a tab.

But a browser is an application specifically developed to access
information on the internet.

That is changing.
Content on the internet can not be trusted.

So browsers and associated technologies and that includes
Java applets, Flash and JavaScript has certain security features.

For very good reasons.

I quite understand that.
If you want a browser and a Java plugin with no security, then
I guess you can get the source for Mozilla and OpenJDK and rip
out all security features.

Actually, that may be a good idea.
We could repackage it as our own "browser" with limited ability to
access external sites.
But there will not be much interest in the result. The risk of
the user using that browser to surf the internet and a black
hat writing an applet that just wipes out the entire hard disk
is too big.

Not if most of the Net browsing features are disabled.
For example, if they are only allowed to browse within the LAN or our
own website. Of course, you might argue there are ways they could get
around that restriction, but bear in mind the kind of people our target
users typically are - technological illiterates. And if they somehow did
it and fucked up - that's their warranty voided.
(it would actually be much worse if the applet installed a
trojan instead of just wiping out everything, but that is
besides the point)

Arne

--
Dirk

http://www.transcendence.me.uk/ - Transcendence UK
http://www.theconsensus.org/ - A UK political party
http://www.onetribe.me.uk/wordpress/?cat=5 - Our podcasts on weird stuff
 
A

Arne Vajhøj

Dirk said:
What I want is something as simple as dowloading a .exe file, have the
installer say "do you want to run this yadda yadda" and zap - all done.
Next thing they know is that it opens in their browser tab and controls
the universe.

The standard Java plugin does not provide such a capability.

Arne
 
A

Arne Vajhøj

Dirk said:
Security on a normally installed .exe, or Java desktop app is
non-existent.

True. But that is different from a browse environment.
I just want it to run in a tab without the
extreme-non-technical user being hassled. We're talking users who have
never heard of Usenet and who can't really get their heads around spam
filters or what desktop shortcuts do.

If this is a high controlled intranet environment with same OS, same
browser, same Java etc., then you may be able to:
- sign you applet
- find the policy file used by the standard browser and Java
- have the PC admins push out a change to that policy file that
gives code signed by you more access
- the users will not be asked for you applets but will be asked
for other applets

I have never tried it, but my understanding is that it should be
possible.

Arne
 
A

Arne Vajhøj

Dirk said:
That is changing.

Browsers are being used extensively for traditional intranet GUI
usage, but all common browsers have still been developed for
internet.
I quite understand that.


Actually, that may be a good idea.
We could repackage it as our own "browser" with limited ability to
access external sites.


Not if most of the Net browsing features are disabled.
For example, if they are only allowed to browse within the LAN or our
own website.

That would help a lot.

Arne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Official Java Classes 10
Java in Java 10
Can an Applet beep? 4
Change character in string 105
Webcam in browser 11
File over network timeout 3
Free keyboard applet 5
Substring 53

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top