Java in Browser

Discussion in 'Java' started by Dirk Bruere at NeoPax, Mar 3, 2009.

  1. Dirk Bruere at NeoPax, Mar 3, 2009
    #1
    1. Advertising

  2. Dirk Bruere at NeoPax

    Lew Guest

    Dirk Bruere at NeoPax wrote:
    > 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.

    --
    Lew
     
    Lew, Mar 3, 2009
    #2
    1. Advertising

  3. Lew wrote:
    > Dirk Bruere at NeoPax wrote:
    >> 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.
    >


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

    --
    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
     
    Dirk Bruere at NeoPax, Mar 3, 2009
    #3
  4. Dirk Bruere at NeoPax

    Dave Miller Guest

    Dirk Bruere at NeoPax wrote:
    > Lew wrote:
    >> Dirk Bruere at NeoPax wrote:
    >>> 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.
    >>

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

    --
    Dave Miller
    Java Web Hosting
    http://www.cheap-jsp-hosting.com/
     
    Dave Miller, Mar 3, 2009
    #4
  5. Dave Miller wrote:
    > Dirk Bruere at NeoPax wrote:
    >> Lew wrote:
    >>> Dirk Bruere at NeoPax wrote:
    >>>> 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.
    >>>

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


    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?

    --
    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
     
    Dirk Bruere at NeoPax, Mar 3, 2009
    #5
  6. Dirk Bruere at NeoPax wrote:
    > Lew wrote:
    >> Dirk Bruere at NeoPax wrote:
    >>> 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.

    >
    > 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
     
    Arne Vajhøj, Mar 4, 2009
    #6
  7. Dirk Bruere at NeoPax

    Roedy Green Guest

    On Tue, 03 Mar 2009 14:41:11 +0000, Dirk Bruere at NeoPax
    <> wrote, quoted or indirectly quoted someone who
    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.


    see http://mindprod.com/jgloss/applet.html
    http://mindprod.com/jgloss/japplet.html
    --
    Roedy Green Canadian Mind Products
    http://mindprod.com

    "Learning is not compulsory... neither is survival."
    ~ Dr. W. (William) Edwards Deming (born: 1900-10-14 died: 1993-12-20 at age: 93))
     
    Roedy Green, Mar 4, 2009
    #7
  8. Dirk Bruere at NeoPax

    Mark Space Guest

    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).
     
    Mark Space, Mar 4, 2009
    #8
  9. 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?

    --
    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
     
    Dirk Bruere at NeoPax, Mar 4, 2009
    #9
  10. On 2009-03-03 21:33:25 -0500, Dirk Bruere at NeoPax
    <> 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.)

    -o
     
    Owen Jacobson, Mar 4, 2009
    #10
  11. Owen Jacobson wrote:
    > On 2009-03-03 21:33:25 -0500, Dirk Bruere at NeoPax
    > <> 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.)
    >
    > -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
     
    Dirk Bruere at NeoPax, Mar 7, 2009
    #11
  12. In article <>,
    Dirk Bruere at NeoPax <> wrote:

    > Owen Jacobson wrote:
    > > On 2009-03-03 21:33:25 -0500, Dirk Bruere at NeoPax
    > > <> 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>

    --
    John B. Matthews
    trashgod at gmail dot com
    <http://sites.google.com/site/drjohnbmatthews>
     
    John B. Matthews, Mar 7, 2009
    #12
  13. Arne Vajhøj wrote:
    > Dirk Bruere at NeoPax wrote:
    >> Lew wrote:
    >>> Dirk Bruere at NeoPax wrote:
    >>>> 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.

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


    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
     
    Dirk Bruere at NeoPax, Mar 7, 2009
    #13
  14. Dirk Bruere at NeoPax wrote:
    > Arne Vajhøj wrote:
    >> Dirk Bruere at NeoPax wrote:
    >>> Lew wrote:
    >>>> Dirk Bruere at NeoPax wrote:
    >>>>> 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.
    >>>
    >>> 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).

    >
    > 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
     
    Arne Vajhøj, Mar 7, 2009
    #14
  15. Arne Vajhøj wrote:
    > Dirk Bruere at NeoPax wrote:
    >> Arne Vajhøj wrote:
    >>> Dirk Bruere at NeoPax wrote:
    >>>> Lew wrote:
    >>>>> Dirk Bruere at NeoPax wrote:
    >>>>>> 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.
    >>>>
    >>>> 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).

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


    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
     
    Dirk Bruere at NeoPax, Mar 7, 2009
    #15
  16. Dirk Bruere at NeoPax

    Lew Guest

    Arne Vajhøj wrote:
    >> 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.


    Dirk Bruere at NeoPax wrote:
    > Is that a complex business?


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

    --
    Lew
     
    Lew, Mar 7, 2009
    #16
  17. Lew wrote:
    > Arne Vajhøj wrote:
    >>> 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.

    >
    > Dirk Bruere at NeoPax wrote:
    >> Is that a complex business?

    >
    > 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
     
    Dirk Bruere at NeoPax, Mar 7, 2009
    #17
  18. Dirk Bruere at NeoPax wrote:
    > Arne Vajhøj wrote:
    >> 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?


    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.

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


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

    Arne
     
    Arne Vajhøj, Mar 7, 2009
    #18
  19. Arne Vajhøj wrote:
    > Dirk Bruere at NeoPax wrote:
    >> Arne Vajhøj wrote:
    >>> 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?

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

    >
    > 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
     
    Dirk Bruere at NeoPax, Mar 7, 2009
    #19
  20. Dirk Bruere at NeoPax

    Lew Guest

    Lew wrote:
    >> <http://java.sun.com/docs/books/tutorial/security/toolsign/index.html>


    Dirk Bruere at NeoPax wrote:
    > 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.

    --
    Lew
     
    Lew, Mar 8, 2009
    #20
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Lauchlan M
    Replies:
    2
    Views:
    436
    John Saunders
    Aug 17, 2003
  2. DKM
    Replies:
    15
    Views:
    781
  3. xyZed
    Replies:
    9
    Views:
    640
    Big Bill
    May 12, 2004
  4. ai4u
    Replies:
    0
    Views:
    2,828
  5. Ulf Meinhardt
    Replies:
    0
    Views:
    735
    Ulf Meinhardt
    Nov 13, 2007
Loading...

Share This Page