How to keep applet's JFrame alive as browser's closed or, goes to other URL

My applet has a JFrame that pops up when the applet is downloaded. Right now, if the browser goes to a different page or, if it is closed, the frame disappears.
I would like to know how to keep the frame alive.
Thanks.

These comments applies to using the Applet PlugIn.
One annoying thing about using the PlugIn is that every time you browse from your applet's page and return, it is destroyed and reinstantiated and then init'ed instead of just stop and start applied on the same applet object. One solution to maintaining state across multiple instances is to use static data. Here is an example that does this with a JFrame, since that is what the poster mentioned, although I usually just do this for the UI on the web page itself.
This doesn't keep the frame visible when off the web page, but that seems to go against basic applet behavior.
--Nax
public class Applet1 extends JApplet
{     private static JTextArea ui = new JTextArea();
     public void init()
     {     JFrame f = new JFrame("example");
          JScrollPane sp = new JScrollPane(ui);
          f.getContentPane().add(sp);
          f.setSize(200,200);
          f.setVisible(true);
}

Similar Messages

  • Opened FireFox and have a continuous annoying police siren!! HOW do I turn OFF??? when firefox closed, siren goes away

    Opened FireFox and have a continuous annoying police siren!! HOW do I turn OFF??? when firefox closed, siren goes away
    == This happened ==
    Every time Firefox opened
    == this morning when I opened FieFox (May 21)

    It's Pac-Man's 30th Birthday today, and Google's homepage is a playable Pac-Man game around the Google logo. My boyfriend had the same problem, then I went to Google and was like Hey, it's Pac-Man! And then the siren started. He plays fine on my laptop, but for some reason the music is stuck on his computer.
    All you have to do is disable the "Cool Previews" add on for firefox. Go to the "Tools" link at the top of the browser, go down to "Add Ons", go to the "Cool Previews", click "Disable". Then restart firefox and it should be fine!

  • How to keep the whole page open during browsing

    I am trying to work out how to keep the whole page open in Safari i.e. the top most line with the Apple logo, file, edit, view etc. whilst browsing.  What is the setting to achieve this ?  Since installing Yosemite my MBP 2011 with SSD is behaving oddly at times. Where is the "back" when in Support Communities or is going into the history tab the only way ?
    thanks

    When in the ASC pages, my method involves opening separate windows.
    So I can go back to the reference page from where I first visited a thread.
    Also, pages open faster at times into a new window instead of a tab. As
    my setup has a bit more display than necessary, a few extra windows are
    easier than a bunch of tabs in one frame that have no point of reference.
    Plus, if I wish to copy/paste or drag into another window, or access extra
    content for the sake of reference, I have that; & may use another browser.
    For some content, different browsers may be a preference. I'm used to more
    than two, and one of three becomes more dedicated to things like web mail.
    There may be some options in launchpad items, such as they are.
    Mission Control can access other hidden windows. There's a short
    cut for Full Screen that when used again, reverts to previous size.
    Not sure if this gets near your question, but thought I'd put it out here anyway.
    edited

  • How to invalidate a session explicitly when a browser is closed

    hi,
    i am keeping the information of a logged user when he logs succesfully in a session. the session time is maintained for half an hour.
    i am also storing his information in an application object.
    when a user logs out i am invalidating the session and his information is removed from the application object .
    when a person is logged and another person at other place stries to log in with the same username and password, i am making use of this application object to check whether the anyone is looged in with that user id or not. if the id aleady exists in the application object i will not allow the second person to log in and i will provide with a relavent mesasge " already logged in with this ID".
    But the problem is arising when a person loogs in and closes the browser (wth out looging in).
    in this case the session is not invalidated and his information remains in the session and application object.
    when he tries to loog in immediatly after closing the browser, the same checking is done for the duplicate log in and a message is displayed to him saying that " already logged in with this ID".
    he has to wait till the session expires (i,e till 30 min) and then log in
    As this creates problem, i want to invalidate the session the time when the browser is closed.
    i tried with the onUnLoad() methos in javascript, but that method is not only called when closing the browser but also when a link is clicked ot when refreshed the page.
    i am trying with Cookies but i am not gettin ga good approach as how to go forward with this problem.
    Any body who can solve this please....reply soon or mail me
    Its very Urgent................
    Thanks
    sowjanya

    2.Any business critical web site should not allow
    multiple users to
    work under same account at same time.Not true. My customer's web site is "business critical" and they explicitly wanted to be able to login multiple times with the same ID. At least in this scenario we completely circumvent your problem.
    The Javascript solution will never be 100%. What happens if their internet connection drops and doesn't come back? Suppose their OS crashes? What if their power goes out? What if IE crashes? What if JS is turned off? What if the user just walks away and leaves the browser open forever?
    You may be trying to get too much control, which on the web always leads to failure. Maybe a better alternative would be to warn the user that is logging in the second time that there is an outstanding login and that the previous user will be logged out if he proceeds. Then, keep a record of the event in case someone is messing with other accounts (although, since he obviously knows the username and password it is probably a user concern.)

  • How to keep the internet connection alive?

    Hi, I am a new Macbook user and everytime my computer goes to screen saver or sleep mode it keeps losing the internet connection. Is this normal? Is anyway to keep the internet alive even is the computer goes to "sleep mode"?
    I mean, it is quite a pain to keep signing in at messenger everytime I wake up my computer or come back from screen saver
    Thank you

    I do not know of a way. When your computer goes into sleep mode, it basically shuts itself down and stores everything in memory. Nothing is moving or working because the whole point of sleep mode is to conserve the battery. If it is really bothering you, go into System Preferences and change the amount of time it takes for the computer to go to sleep.

  • Can a thread created in an applet still run after the browser is closed?

    Dear all,
    I was able to make an applet's thread keep running even the web page changed to other page. Is it possible to make a thread spawned by an applet keep running even if the browser is close? I am using signed applet and JRE1.3.1_02. Thank for answer.
    [email protected]
    Arthur Pan

    No. A thread is part of a process and if the browser closes that process will (generally) be destroyed.

  • Keeping a connection cache alive between program executions (pool)?

    Hey all,
    I am using the Oracle Connection Cache to maintain a connection pool. I have a java application that simply retrieves a document from an Oracle 8.1.7 database during each execution. In order to avoid the overhead of establishing a connection every time this simpe application executes, I'd like to use a connection pool/cache. However, I am not sure how to keep this connection cache "alive" between executions of my program. Basically, I would like to keep a connection cache to the database for an infinite amount of time. Does anyone know how I would do that? This way, my Java application will never have to make a new physical connection to the database in order to retrieve a document. I would really appeciate any help as I have spent a lot of time searching/reading/testing.
    Thanks,
    Marcus

    An application server would be the easiest solution, at least from a high level. Application servers exist to provide services like connection pooling to Java applications-- they're very good at it.
    If we're talking about code that's already been designed and written and whose deployment would be adversely affected by going to an application server, converting the process to a deamon would probably be the easiest approach.
    If you were to go down this road, you'd first have to identify what precisely should trigger the application to run. Perhaps it's a GUI, perhaps it's the creation of a file in a certain directory, etc. Then, you'd need to have a thread that monitored that (or registered as a listner for the appropriate event if we're talking about a GUI) and "woke up" the application.
    Justin
    Distributed Database Consulting, Inc.
    www.ddbcinc.com

  • How to Keep Alive a specific HFM application

    My PRD landscape has 2-3 applications. Whenever any application loads for the first time in the memory, it takes quite some time before it is loaded. Once the application is loaded, the response times are pretty quick and acceptable.
    During specific parts of the day / month, a specific application becomes active. During this time, other applications may or may not be used, but one specific application is definitely used. I want to keep this application's cubes loaded in the RAM, so that response times are quick, whenever the user needs it - whether for the first time or otherwise.
    How to keep alive a specific application's cubes alive and loaded in RAM? I am not looking for general solution like setting the "FM Service" to Automatic (currently it is set Manual) - setting this to Automatic, will affect all applications. However, I am looking for a specific application at a specific period of time.
    I am ok with a custom solution if required. Let me know, what are my options.

    I think you are looking for an inappropriate solution to your problem. Most HFM applications take a few seconds to start up. If your application takes such a long time to start up you really need to examine the root cause. Start by removing the Sub NoInput and Sub Input routines in your rules to see if this is the reason the application takes so long to start.
    If the removal of those routines does not significantly change the startup time, look through the event logs for possible causes. It is possible you have a connection problem with the Oracle database for example, or you have an environment configuration problem where the HFM application servers have a very slow connection to the database server, or possibly the database server performs poorly.
    I strongly suggest you investigate these root casues first before trying to make HFM behave in a non-standard way. Certainly you can start the HFM Management Service, which will start all of your HFM applications and keep them all up and running. This approach does not allow the applications to shut down on their own though. Only use this if you have exchausted your investigations (as I suggsted above).
    --Chris                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How to keep HTML code in the applet source (.java) file itself?

    Hi,
    How to keep HTML code (APPLET tag) in the applet source (.java) file itself?
    Please give an example?
    thank you,

    R6i wrote:
    ...What I mean is without writing external HTML file, how to run an applet (during practice)?'Practice'? What does that mean? During development? If that is what you are referring to, add an applet tag at the top of YourApplet.java inside a Java comment area. Then AppletViewer (in recent SDKs) can then run it with just..
    prompt:javac YourApplet.java
    prompt:// the '.java' extension is not a mistake
    prompt:appletviewer YourApplet.javaIf you do not mean 'during development', then that brings us back to +"What advantages do you see that is bringing to the end user?".+

  • How to keep Allways JFrame on top of JApplet?

    I have Japplet runs on the client side. after pressing buton on the applet
    a jframe pops up. but if i click on the japplet it hides under japplet.
    Any ways to keep this jframe on the top ? if i use jframe.keep always on the top will thought security exception. I know applets have some security issue to access local OS resources or permission. just need to know any possibitly to achive this somehow?
    thnx

    I don't think this is possible. Others feel free to correct me. Perhaps try signing the applet or setting the permissions in the policy file.
    You can use a JInternalFrame to keep the frame within the JApplet.

  • How to keep socket alive

    Dear All Java Devotees....
    I was stucked upon the following socket programming challenge in my projects
    first of all I have one Server and one Client
    what I wanted initially was client registered to server
    when the client abruptly terminated, it wont have any effect at all to the server
    But in line with the Java Socket Programming Tutorial
    it seems that it cant be done so easily
    whenever I close down my client
    Server will catch java.net.SocketException: Connection reset
    so my question basically :
    Is it possible for the Server to keeps iterating in a loop
    while listening for a client to register
    but here is the catch, I dun want anything severe happen to the Server
    when somebody close down the Client abruptly
    If possible I would like the server to keep its normal program flow
    I mean sort of roll-back to the state before the exception occured
    My punchline is to "keep the server program flow"
    Any Idea/snippet will be greatly appreciated....
    best regards,
    Honggo

    Hi Joey
    sorry I've misled you
    I've managed to solve the problem though
    but now facing a new problem
    I will be grateful if u come across the same problem
    here is the scenario:
    1. client starts
    2. server stars
    3. client & server bound to socket
    4. client sending some information to server
    5. server stops
    I've followed your suggestion to use for loops and spawn a new thread for each accepted socket
    it's a very simple & helpful idea, but as I observer i hit some shortcomings. I wish you could enlighten me with snippet of code, perhaps :D
    after steps 5 which is when the server stops, client is unaware that server has already dead.
    i've tried every methods described in the API (e.g. isClosed, isConnected, etc) but client didnt catch exception when client is sending some infomation to the "deceased" server.
    So my question: How to detect whether or not the server is dead (in client).
    regards,
    Honggo

  • How to keep the digital audio ouptut alive?

    I'm connecting my MBP audio via the optical digital audio connection and the digital stream disconnects after a short time (30 seconds? I haven't timed it.) whenever there's no audio coming out of the MBP: the optical actually stops transmitting (the LED goes dead).
    When it disconnects, my audio system tells me there's no signal and whenever an audio event occurs, it wakes up and inevitably the top of the audio signal is missing, as there's not enough time for the receiver to "wake up" before the audio event happens. I've actually tested this on two systems and it does the same thing.
    So, is there any way to keep the digital output alive, even if silent? I'm running powered with settings on "Performance" so there's no power-related reason for the digital audio to turn off. I haven't been able to find any other system settings that could help. Thanks for any pointers.

    Hello,
    I out a page before the page which takes long to load with the following xhtml tag:
        <xhtmlb:protectDoubleSubmit active = "true"
                                    timer  = "2500"
                                    text   = "<img src='/sap/public/bc/ur/Design2002/themes/sap_tradeshow/common/loading/loading_ani.gif'>"
                                    title  = "De werklijst wordt geladen..." />
    But the page is not kept alive. What does the parameter timer? Must it be set to 0?
    With regards,
    Frank

  • Apple TV won't stay on file sharing, can anyone explain how to keep it connected ??

    Having problems keeping Applet TV connected for file sharing, Will disconnect in the middle of watching a movie. Can anyone help
    and tell me how to keep the two devises communicating??

    Is it just when streaming photos or using home-sharing in general? Check istumbler (netstumbler for windows) to check interference. Also check firewall and anti-virus (if applicable), restart router/make sure it's up to date.

  • How to keep homesharing active from iTunes on Lion OS?

    I have 4 Macs (w MBPs, 1 iMac, 1 Mac Mini) and 2 Apple TVs (latest). Only the Mac Mini is on Lion OS (10.7.4) since that is what it came with new. I use it to serve my media to the Apple TVs, but they can also get served from the other 3 Macs (all on Snow Leopard 10.6.8).  Only the Mac Mini on Lion drops homesharing when not in use - the other Macs on Snow Leopard keep homesharing alive. While it is actively streaming, the Mini does not drop the feed.  I have the Mac Mini set to never go to sleep or or to screen saver, so it should remain accessible via homesharing.  But if I don't use it for an hour or two, it drops out of homesharing - and it is the only Mac to do so.  I can get it back by quitting then restarting iTunes or by shutting down homesharing and restarting it while keeping iTunes open.  Of course, a restart of the mini would also bring back full functionality.  None of these are acceptable when you are sitting in another room trying to access media via Apple TV.  As a result of the above, I am assuming that the problem is isolated within Lion OS and how it supports iTunes.
    I have seen other discussions claiming Apple TV drops out, but my problem is definitely the Mac Mini on Lion since at the same time I can see it drops from the other Macs and not just from Apple TV - all homesharing devices lose sight of the Mini but keep seeing each other.
    I'd love to downgrade my Mini to Snow Leopard but apparently can't. I'd buy an older used Mini, but I need HDMI - so, I'm stuck until this is fixed. My other devices will definitely stay on Snow Leopard until I see this problem resolved by Apple.
    Any suggestions on how to keep homesharing alive with iTunes on Lion?

    Everything that is on your ipod should also be on your computer.  is it not?
    You can redownload some purchases:
    Downloading past purchases from the App Store, iBookstore, and ...

  • How to keep multiple function modules under one Web service

    Hi Experts,
    I have Three RFC function modules and i need to create one web service for these three RFC function modules. I know How to crearte a web service for one function module.
    please suggest me How to keep multiple function modules under one Web service.
    Thanks in advance
    Lakshminarayana

    Hi Lakshmi,
    The best way to do it is to assign all the three RFC Enabled FM's to one function group. Later on the top menu in Utilities you get an option to Create a Webservice from a Function Group.
    You can create one single Webservice using all the the 3 FM's.
    I hope this helps.
    Thanks,
    Manu

Maybe you are looking for