Java in Browser

  • Thread starter Dirk Bruere at NeoPax
  • Start date
L

Lew

Dirk said:
Is there any way of getting a Java app to execute in a browser window?
I would like to have the app running in a tab in order to make a
consistent i/f with other stuff that is browser displayed.

Make it an applet (extends JApplet). There's a tutorial on java.sun.com for that.
 
D

Dave Miller

Dirk said:
OK. Right now I'm just writing the outline as a standard app - I assume
I can modify it later? Using Netbeans.
It can be done, but you're better off doing it as an applet from the get go.
 
A

Arne Vajhøj

Dirk said:
OK. Right now I'm just writing the outline as a standard app - I assume
I can modify it later? Using Netbeans.

Depends on what you do in the code.

But a simple Swing GUI app is usually easy to change to
an applet (JApplet).

Arne
 
R

Roedy Green

M

Mark Space

Dirk said:
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).
 
O

Owen Jacobson


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.)

-o
 
D

Dirk Bruere at NeoPax

Owen said:
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.)

-o

So I do everything inside a JPanel, which is contained within a JFrame?

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

Dirk Bruere at NeoPax said:
Owen said:
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>
 
D

Dirk Bruere at NeoPax

Arne said:
Depends on what you do in the code.

But a simple Swing GUI app is usually easy to change to
an applet (JApplet).

Arne

What I need is for the applet to load locally and access the LAN from
the host machine. So a computer opens a browser which pulls up the
applet from the HDD and then uses it to send info out to the LAN. Is
that possible given applet limitations?

Either that, or load an applet from a machine on the LAN and then
somehow make it persistent so that it does not have to be downloaded again?

--
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 need is for the applet to load locally and access the LAN from
the host machine. So a computer opens a browser which pulls up the
applet from the HDD and then uses it to send info out to the LAN. Is
that possible given applet limitations?

Either that, or load an applet from a machine on the LAN and then
somehow make it persistent so that it does not have to be downloaded again?

The applet versus application should not be a problem.

Applet security sounds as a potential problem.

An unsigned applet can only access the host it is retrieved from.

You can of course sign it.

Why an applet and not an application ?

And maybe Java Web Start could be used for distribution and update.

Arne
 
D

Dirk Bruere at NeoPax

Arne said:
The applet versus application should not be a problem.

Applet security sounds as a potential problem.

An unsigned applet can only access the host it is retrieved from.

You can of course sign it.

Is that a complex business?
Why an applet and not an application ?

We want a browser to be our standard control interface, with each tab
becoming a particular control function.

--
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:
That depends on your definition of "complex".

True. Right now it looks too complex.
Why don't you read the documentation and find out?
<http://java.sun.com/docs/books/tutorial/security/toolsign/index.html>

The Java tutorials are relatively useful, and always a good place to start.

I do read odd bits and pieces, but I'm trying to learn as I produce
useable code. I don't have the luxury of being able to sit down for a
couple of weeks and learn Java by doing the exercises. That's why I'm
programming on a Saturday night at 22:40. So far I have made an app that
works well and impresses the right people:). Now I need to make it a
lot slicker.

That's why I ask questions in the hope I can shortcut to the right
answer without trawling through The Manual. Plus, being a newbie, I
quite often don't even know the right questions.

--
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:
Is that a complex business?

Doing the signing: no.

Getting the users to accept giving the code privs and ensure that
they do not give all code privs can be complex.
We want a browser to be our standard control interface, with each tab
becoming a particular control function.

OK. You are not the only one with that requirement.

Arne
 
D

Dirk Bruere at NeoPax

Arne said:
Doing the signing: no.

Getting the users to accept giving the code privs and ensure that
they do not give all code privs can be complex.


OK. You are not the only one with that requirement.

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...

--
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
 
L

Lew

That's why I ask questions in the hope I can shortcut to the right
answer without trawling through The Manual.

But the referenced link *is* a shortcut.

There really is no shortcut better than correct knowledge. RTFM.
 

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,582
Members
45,059
Latest member
cryptoseoagencies

Latest Threads

Top