[NEWBIE] How to open a frame from an Applet?

Hi, I'm trying to open a JFrame from an Applet. Basically, I would like that, once the user selects an option from a JMenu, a Frame would be shown with a text box where user could type some content.
I built both the Applet and the Frame, and singularly they work. When I execute the main method from the JFrame, the window appears, but when I execute something like the following from the applet:
MyFrame mf = new MyFrame();
mf.setVisible(true);nothing is shown. I'm sure that I don't know something, but I just started with applets.
Thanks for any help,
Marco

If MyFrame is a subclass of JFrame, then it should not
make any difference.
What do you need the JFrame for? Can this be done
using another "screen" by using a CardLayout?From a menu, when the user selects 'Start game' I need a text box coming out so that the user can insert a word. This word should then evaluate an instance member of the Applet.
Marco

Similar Messages

  • Help! How to Open a Frame from applet with

    Hey all. I need help =).
    I want:
    1. Have 1 class extends applet with running thread (this far no prob)
    2. Open a new frame from the applet (no prob)
    3. Start a new thread which is operating "inside" the new Frame/class
    4. Draw a simple Rect in the new Frame with the new thread to test that the graphics work.
    Plz help,
    ~Trobsky

    �rr..... i cant draw on the Frame =(.
    Heres the code:

    public class Fonster extends java.applet.Applet {
         Frame myFrame;
         Fri friFonster=new Fri();
         public void init() {
              myFrame=new Frame();
              myFrame.resize(300,300);
              myFrame.show();
              myFrame.add(friFonster);
              friFonster.init();
              friFonster.start();
         public void paint(Graphics g)
              g.drawRect(10,10,100,100);
    public class Fri extends java.applet.Applet {
         public void init(){
              repaint();
         public void paint(Graphics g)
              g.drawRect(10,10,200,200);

  • Opening a frame from an applet

    Hi,
    I want to open a frame in my applet. If I'm using swing, JApplet opening a JFrame, is it possible to keep the frame open if the user browses away from the page that holds the applet?
    Are there any tricks? I've tried opening it in a new Thread, but it still goes away when the the browser's page changes.
    Could I call getParent() from the applet until I get an instance of Frame (which would be the browser) and set my JFrames' parent? Or does that only work with the old Netscape and old AWT Frames?
    I basically want to know if I can keep my JFrame open until the browser is closed. Any ideas or suggestions would be greatly appreciated.
    thank you very much

    Do you want to open a jsp application in a frame when you click on the applet?If so, there is a programme in http://www.globalleafs.com -Java-Java Applets 's download section. Check it out.

  • How to open "All Tabs" from previously shown pages history?

    Hi,
    How to open "All Tabs" from previously shown pages history. I am not asking about "Reopen from last session". I am asking about how to open all tabs from previous webpage links from a past date from history, currently its allowing me to select each page link manually by clicking it.
    Thank you!

    Select the first item you wish to open, scroll down to the last, Shift-click that one & all those between should be selected too. Double-click on them & they should all start to open... or you can copy & then drag/paste into a new or existing bookmarks folder.

  • How to open web pages from japplet??

    Hi
    Does anybody know how to open web pages from java japplet??
    Any help is apreciated!
    zick

    the getAppletContext() method of the Applet class will get you an AppletContext, with which you can call the ShowDocument(URL url) or ShowDocument(URL url, String target) method...
    check it out at http://java.sun.com/j2se/1.4/docs/api/java/applet/AppletContext.html
    have a good one :)
    Jay

  • How to open a pdf from pdf target with page no using javascript

    Hi
    How to open a pdf from pdf target with page no using javascript
    Thanks in Advance.

    Hello,
    <p>Web.show_document calling .htm files saved on disk.....</p>
    Francois

  • How to open a RPD, from a linux folder? OBIEE 11g

    Hi,
    How to open a RPD, from a linux folder? Is there a tool, or any command line command to open the RPD?
    Thanks for your time and help.

    Hi,
    You cannot open an rpd on a Linux manchine.
    You have to install the client (Admin tool) on windows and open the rpd remotely in online mode
    Thanks
    Deva

  • TS4256 How to open .RAF files from Fuji camera?

    How to open .RAF files from Fuji camera in Aperture 3?

    Only these Fuji cameras are currently supported: http://www.apple.com/aperture/specs/raw.html
    Fujifilm
    FinePix S2 Pro
    FinePix S3 Pro
    FinePix S5 Pro
    FinePix X100**
    X-Pro1***
    X-A1***
    X-E1***
    X-E2***
    X-M1***
    X-T1***
    X20***
    X100S***
    If you have a different camera, use the software that came with your camera to develope the RAW files and convert them to a different lossless format, that Aperture recognizes.

  • Opening frames from an applet

    Me and a friend are making an applet, and would like it to open a new frame at some point.
    It works perfectly* on his WIN 2k IE 5.0 but somehow it does not on my WIN 2k IE 6.0
    Is it no longer legal to open new windows from an applet?
    Thanks.
    *Except for the warning. Btw, is that warning removable?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    If the window doesnt show up, you might have an exception thrown somewhere. I assume you are using a Java Plug-In since you are using IE6.0. You can bring up the java console, if you open the Java Plug-In icon in the Control Panel and enable "Show Java Console". Restart your browser and try again and see if you are getting a stacktrace in the java console.You can also see what version of java you are using in the control panel, or change it in the Java Plug-In options (Advanced tab) if you have more than one installation installed.

  • Opening a browser from an applet

    I got a problem, I want to open a browser from my applet, but I just found one way:
    getAppletContext().showDocument(new URL(
    "http://www.java.sun.com"), "_blank");
    but the problem is: with this, the default browser with defaul settings is opened, and that's what I don't want...
    how can I open the browser with some settings (for example size, or no-url-bar, etc)
    thx for help

    hi,
    try this code:
    public void showDocument(java.net.URL url, String targetWindow)
    when targetWindow can be:
    "_blank" Display the document in a new, nameless window.
    "windowName" Display the document in a window named windowName. This window is created if necessary.
    "_self" Display the document in the window and frame that contain the applet.
    "_parent" Display the document in the applet's window but in the parent frame of the applet's frame. If the applet frame has no parent frame, this acts the same as "_self".
    "_top" Display the document in the applet's window but in the top-level frame. If the applet's frame is the top-level frame, this acts the same as "_self".

  • Opening a socket from an applet

    I tried to open a socket from an applet to a server on a remote computer and I've got a refusal message.
    When I try it on a server in the local machine, it works.
    What could be the problem ?
    P.S. : when I open the socket from an application in the Java environment, to the same remote server it works ok.

    this is part of the security system built into java and Applets
    unless you sign an Applet it cannot do many "dangerous" things, like..
    access the loacl file system
    connect to any server except the server that it came from

  • How to create a frame in a applet?

    Dear All,
    How to create a frame in a applet?
    Thanks in advance
    Kityy

    You can't add a Frame/JFrame to an Applet/JApplet.
    An Applet/JApplet has its origins in the class Panel/JPanel.
    So, if you make your Applet to an application you
    can easily do that by putting your Applet "above" a Frame.
    Maybe you can archieve your goals with some Panels?!

  • How to export still frame from Quicktime movie?

    Hello folks
    I often need to use a still frame from a quicktime movie as an image file to work with in PhotoShop for windows.
    If I export a frame via the export command and choose "Movie to picture" I end up with a .pct file, that Photoshop will not open.
    I can open the .pct file with the Quicktime PictureViewer and then export it from that app as i.e. a JPEG-file, but I would like to avoid that extra step and just export a usable file straight from QT.
    Anybody know how that can be done?
    Best regards
    Kris

    Same problem here - no matter whether I choose Photo - JPEG or PNG format as the "compressor", QT 7 Pro wants to save with a .pct extension, and changing it to .jpg or .png extension fails to open.
    The two workarounds I've found are:
    1. Save it in Photo - JPEG or PNG format with a .pct extension, open with Photoshop CS4 or below, save to desired format.
    One may be able to accomplish the same using Preview instead of Photoshop, but on my Snow Leopard machine I get the error "The PICT file format is not supported in 64-bit mode. Try selecting "Open in 32 Bit Mode" in the Finder's info window for Preview." and I don't feel like bothering to do this.
    2. Use Grab to take a screenshot, copy into Preview, crop as necessary and save to desired format.
    Which is easier depends on whether you feel like having to do precision cropping or not. Totally agree with above commenters - whither PICT, Apple?
    Message was edited by: Daniel Toman

  • Opening and closing a frame from an applet security problem

    can I open a frame or a window from an applet and close the frame by using
    System.exit(0) for the frame or will it throw a security problem.

    I am using system.exit(0) to exit the JVM.
    dispose()
    Releases all of the native screen resources used by this Window, its subcomponents, and all of its owned children. That is, the resources for these Components will be destroyed, any memory they consume will be returned to the OS, and they will be marked as undisplayable.
    If this frame have to be close and open again don't use dispose.
    there is no check whether a frame is active? what you can do is set the the new frame to null (frame = null) and also when you dispose it, this will let you know if the frame is active or not.
    Noah

  • How to open Crystal Report from the SAP GUI ?

    Hi experts,
        We have developed some reports for our ECC 6.0 system by using Crystal Report 2008 and SAP integration kit , these reports are published to BO edge 3.1 server.  To view the report, our user have to open IE and login Infoview first.
       For convenience, we want to open Crystal report from SAPGUI directly without login BOE, How can we do it? 
    Thanks.

    Hi
    please take a look here
    Crystal Reports
    Regards,
    STratos

Maybe you are looking for

  • VBA Code works initially but not when I reopen the spreadsheet

    I found this great code to let users add a name to a table.  It asks the user if they want to add the item, they say yes and then it adds it to the list and sorts it alphabetically.  It is great until I close and reopen the spreadsheet.  Then, I only

  • Why can't I open a DITA topic file?

    FrameMaker 11 DITA 1.2 Yes, this is a repeat of an earlier query but I'm hoping the new title will help. I'm really stumped and this seems like it should be simple. When I originally set up my EDDs early this year, I did not want anyone using the gen

  • Import & export from oracle 9i

    Can anyone tell me how to import and export database schema from oracle 9i. any help will be appreciated

  • Synched tv series from itunes

    I purchased a TV series from iTunes and synched to iPad 2... where do I find them on iPad? don't see TV shows as an option on iPad like I do on iPhone

  • What can't I do with OS X 10.5 server (that I can do with normal OS X 10.5)

    I was intending to install OS 10.5 on a Mac Mini at home to run a mail server, caldav server, wiki and a web server. I could add all of these using open source solutions and packages such as MailServe for Leopard:http://cutedgesystems.com/software/Ma