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

Similar Messages

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

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

  • How to call JSP page from applet?

    I have some page1.jsp from which I call applet.
    User works with this applet but some information does not in date inside applet.
    So user click on some component at applet (some button etc.) and now I would like to do this:
    1) open new window;
    2) call page2.jsp at this new window.
    The reason is that page2.jsp will read some data from database and then displays it in HTML inside page2.jsp itself. It is not necessary to pass these date back to applet for displaying them inside of applet.
    So user then can have 2 windows: page1.jsp with applet and page2.jsp with some details information.
    But I DO NOT know how to call page2.jsp from applet, and do ti in a new window. Is it possible and how?
    Thanks
    Mirek

    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class MainMenu extends JApplet implements ActionListener
         private JMenuBar mbar;
         private JMenu Master,Leave,Report,Logout;
         private JMenuItem UserMaster,DeptMaster,DesignationMaster,LeaveAvailable,LeaveApply,Generate;
         private JPanel jp;
         public void init()
              mbar=new JMenuBar();
              Master=new JMenu("Master");
              Leave=new JMenu("Leave");
         Report=new JMenu("Report");
              Logout=new JMenu("Logout");
              UserMaster=new JMenuItem("UserMaster");
              UserMaster.setMnemonic('U');
              DeptMaster=new JMenuItem("DeptMaster");
              DeptMaster.setMnemonic('D');
              DesignationMaster=new JMenuItem("DesignationMaster");
              DesignationMaster.setMnemonic('D');
              LeaveAvailable=new JMenuItem("LeaveAvailable");
              LeaveAvailable.setMnemonic('L');
              LeaveApply=new JMenuItem("LeaveApply");
              LeaveApply.setMnemonic('L');
              Generate=new JMenuItem("Generate");
              Generate.setMnemonic('G');
              Master.add(UserMaster);
              Master.add(DeptMaster);
              Master.add(DesignationMaster);
              mbar.add(Master);
              Leave.add(LeaveAvailable);
              Leave.add(LeaveApply);
              mbar.add(Leave);
              Report.add(Generate);
              mbar.add(Report);
              mbar.add(Logout);
              UserMaster.addActionListener(this);
              DeptMaster.addActionListener(this);
              DesignationMaster.addActionListener(this);
              LeaveAvailable.addActionListener(this);
              LeaveApply.addActionListener(this);
              Generate.addActionListener(this);
              Logout.addActionListener(this);
              mbar.setVisible(true);
              Container con=getContentPane();
              con.add(mbar,BorderLayout.NORTH);
         public void actionPerformed(ActionEvent ae){
              if(ae.getSource()==UserMaster)
              }

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

  • Open discoverer worksheet  from javacript with the help of URL

    i want open my report from javacript with the help of URl to open the report with wbk(workbookid) and the paramenter for that report...
    http://server/discoverer/viewer?cn=connid&event=openWorksheet&wsk=worksheet1
    this url above opens the worksheet
    but if the worksheet have parmeter to be passed if i giv like this
    http://server/discoverer/viewer?cn=connid&event=openWorksheet&wsk=worksheet1&qp_12=101015
    _12 is parameter name and 101015 is the value.
    pls help me to sort out the problem

    i want open my report from javacript with the help of URl to open the report with wbk(workbookid) and the paramenter for that report...
    http://server/discoverer/viewer?cn=connid&event=openWorksheet&wsk=worksheet1
    this url above opens the worksheet
    but if the worksheet have parmeter to be passed if i giv like this
    http://server/discoverer/viewer?cn=connid&event=openWorksheet&wsk=worksheet1&qp_12=101015
    _12 is parameter name and 101015 is the value.
    pls help me to sort out the problem

  • 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 enable private mode from commandline, with an URL. I am a software dev and I wish to have my application open links in Firefox. Using ShellExecute(), i c

    How to enable private mode from commandline, with an URL.
    I am a software dev and I wish to have my application open links in Firefox.
    Using ShellExecute(), i can do with with commandlines like:
    firefox.exe http://support.mozilla.org
    But I also want the option to open the link in private mode.
    I am able to start firefox in private mode by doing this:
    firefox.exe -private
    However, if I add a link to the command line
    firefox.exe -private http://support.mozilla.org
    I get strange results.
    If firefox is not running, it launches 2 copies of the application.
    One that opens in private mode and the other opens in normal mode and goes to the URL specified.
    If firefox is already running, it just opens the URL in a new tab.
    No private mode instance is launched.
    Am I using the command-line syntax incorrectly?

    It will never work if Firefox is already running as Firefox will use the already opened Firefox instance.<br />
    In that case only using a separate profile will work.
    You can try to specify the -url switch as well.
    *firefox.exe -private -url http://support.mozilla<i></i>.org
    You can also look at the -new-tab switch.
    *firefox.exe -private -new-tab http://support.mozilla<i></i>.org
    *https://developer.mozilla.org/en/Command_Line_Options

  • How draw image into frame in applet

    How draw image into frame in applet.Please give my simple example code.

    http://search.java.sun.com/search/java/index.jsp?qt=%2Bdraw+%2Bimage+%2Bpanel+%2Bhow&nh=10&qp=&rf=1&since=&country=&language=&charset=&variant=&col=javaforums

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

  • Could any one help how to open the application without port number in servl

    Could any one help how to open the application without port number in servlets or jsp?

    Well, configure the application server/web container to listen to the default http port of 80, rather than 8080.
    I couldnt get where to specify 80 instead of 8080 so that it opens without numbers

  • Open html file from Applet

    Hi,
    I need to open html file from applet, the html file is placed in my local system, it is not open. the code is below, please can u tell where i did wrong.
    import java.applet.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.net.*;
    <applet code="Resource.class" width="400" height="400"></applet>
    public class Resource extends Applet implements ActionListener
    Button b = null;
    public void init(){
    b= new Button("Click");
    add(b);
    b.addActionListener(this);
    public void actionPerformed(ActionEvent ae){
    try
    URL adress = new URL(getDocumentBase(), "html_code.htm");
    getAppletContext().showDocument(adress, "_blank");
    System.out.println("Execut inside"+adress);
    }catch(MalformedURLException e){
    System.out.println("Eror in Display");
    }

    Don't cross post
    http://forum.java.sun.com/thread.jspa?threadID=633500

  • HT4113 hi, i have trouble with my daughter hers ipod she forgot passcode lock please help how to open she cant remmy her ipod passcode password please help?

    hi please help how to open my daugthers ipod she forgot her password all day...she cant remmy can u help to fix my daugthers ipod passcode lock how to open her password she been tried still disabled very upset how to open her passcode lock thankyou

    If you cannot remember the passcode, you will need to Restore your device...
    Connect to iTunes on the computer you usually Sync with and Restore...
    http://support.apple.com/kb/HT1414
    If necessary Place the Device into Recovery mode...
    http://support.apple.com/kb/HT1808

  • I'm trying to open a PDF from Safari with iBooks, but when I choose "Open with ..." in Safari, only Pages and Dropbox show as options.  I'm running iOS 7.1.2 and iBooks 3.2.  Thanks for any ideas!

    On my iPad, I'm trying to open a PDF from Safari with iBooks, but when I choose "Open with ..." in Safari, only Pages and Dropbox show as options.  I'm running iOS 7.1.2 and iBooks 3.2.  I have rebooted the iPad and that did not help, and reinstalled iBooks, which also changed nothing.  Thanks for any ideas!

    Yup, it was uploaded to our school Wiki as a PDF, and Pages did open it.  I was then able to move it to iBooks, but I'd rather avoid the extra steps.

Maybe you are looking for

  • How to connect and use Stor.E TV with Apple Mac

    Hi, I just bought the Stor.E tv but I use Apple mac. Is there a program that I can download or just some way I can connect my Stor.E to my computer? Right now it's locked. Thank you :)

  • Logical XOR operator in T-SQL (SQL Server 2000)

    Hi all.... I was wondering why SQL Server 2000 lacks a logical XOR operator. Do you have a ready to use function that implements it? How can I program one by myself? I know that A XOR B is equivalent to NOT A * B + A * NOT B. So I tried to create thi

  • Can I use the same Oracle Repository for the new FDM App

    Hi All, I have to uninstall FDM and install and re-configure FDM again and then restore FDM Apps present previously. For this, Can I resue the same Oracle Repository for restoring the FDM app on newly installed instance. As far as I know, I need to t

  • How does one recover from Downloader:OSX/Flashback.C?

    Hi All, I am pretty sure I dowloaded and installed it on one or more of my machines... It seems that a re-install of Lion is the only way to bring back Lion's XProtectUpdater functions... Is there a thread for fixing this dumb mistake? Cheers, Adam

  • My app get unloads automatically SDK4.6

    I have developed application where I can drag and drop image. I am facing once issue. The issue is when I drop image on component flex application get automatically unloads. I recently updated my Flex Builder 4.0 to 4.6 (installed new). I am unable t