Using a main in an Applet

Hello, I have a question.
How do you use a mian in an Applet.
Eample, after an applet section is complete, I want it to go into Console use. Does anyone know how to combine the two? Thanks
Note: So far, I got the program to go into the Console but It stops working when it asks for user input. There are no "String args[]" and that is what I hypothesis is the error

import javax.swing.*;
public class MyApplet extends JApplet {
     public void init() {
          //init stuff here
     public void start() {
          //start stuff here
     public static void main(String[] args) {
          JFrame f = new JFrame();
          JApplet a = new MyApplet();
          f.getContentPane().add(a);
          f.setSize(600, 400);
          f.setVisible(true);
          f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          a.init();
          a.start();
}Excuse me, but is there a way to do this on Applet only instead of JApplet... I was told we need to use Applet only...

Similar Messages

  • Using main() function in APPLET

    Hi all,
    What will happen when main() included in APPLET?
    Can I use main() in a applet?
    Pls guide me
    Thanks in Advance,

    nothing, since applet calls the abstract methods init(), start() and stop().
    However you can call main() e.g. in start() which should work fine.
    good luck, lg Clemens

  • Always used 1 main account.  Started using individual user accounts. So how do I use software or applications with a lot of data like Quicken under my own user account?

    I recently upgraded our family's mac to OS X.  I thought this was the perfect time to create and use "user accounts".  We had always used 1 main account.  So how do I use software or applications with a lot of data like Quicken under my own user account?  I wanted to be able to manage my own itunes library, iphone apps, messages.  But I still really need to use the Stuff I have in Quicken essentials.  I don't want to have to restart all my work done in Quicken already.

    I haven't used Quicken in a while, but most applications store your files in your Documents folder. Is that where your Quicken data file is? What you do next depends on how many family members need to get at that data.
    If multiple family members need to use the Quicken data file, try moving it to the Documents folder in the Shared account. That is an account that all accounts can see. It's at the same level as the other accounts. In other words, Shared is one level up from your Home account, or Hard Drive/Users/Shared.
    If you're the only one allowed to see that Quicken data, move the Quicken data file from the old main account to your account, and don't leave a copy behind. You can use the Shared folder as a way station for the transfer since you won't be able to see both accounts' Documents folders at the same time (because you're not allowed to peek into other people's accounts). Or you can use another disk or server for the transfer, as long as you can get to it when logged into either account.

  • How to use Two main windows with in a page in script ?

    Hi any body explain me...
    How to use Two main windows with in a page in script ?
    with  header data in one main window,
    & Item data in other main window.

    HI..,
    u need to go for <b>SPLITTING THE MAIN WINDOW</b> !!!
    Main windows in page windows allow you to format text in multiple columns. Define an area in the page window, in which to position the main windows.
    Here is the procedure !!
    -->Create a page window and assign it to a page.
    Choose <b>Edit --> Main windows</b>.
    A dialog box appears.
    -->Enter values in the fields <b>Area width</b> and A<b>rea height</b> in accordance with the input guidelines for main windows.
    -->Enter values in the fields <b>Spacing</b> and Number in the <b>Horizontal group</b> if you want to use multiple columns. You can ignore the fields in the Vertical group.
    Determine how many columns and line areas are required for label printing. Then enter the corresponding values in the fields in the <b>Horizontal and Vertical groups</b>.
    -->The value in the field Left margin varies from main window to main window if multiple columns are used. The following applies:
    <b>
    Left margin of current column + Window width + Horizontal spacing = Left margin of next column</b>
    In label printing, the field Upper margin also varies from main window to main window:
    <b>
      Upper margin of current main window +  Window height + Vertical spacing = Upper margin of next main window</b>
    -->Enter a value in the field Start position.
    This is a counter. Enter a starting value which is equal to or greater than 1.
    -->The main windows are added to the list.
    -->Save your form.
    reward if it helps u...
    sai ramesh

  • Using a filechooser in an applet

    Is it possible to use a filechooser for an applet save button? If so how can you do it? So far I have only been able to use the filechooser object with JFrame and not JApplet.

    Hi,
    I'm a newbie, but I just had a similar problem and the solution was in the html code to display the applet. here's the code:
    <applet width=700 height=500 code="ImageExample.class"> </applet>
    make sure the height and width here are big enough for your imaage.
    HTH
    Paul

  • I am planning to buy mac mini 2.5Gzh. I will be using it mainly for video editing and I am planning to upgrade up to 8GB. Is it a good buy or should I try some other alternative.

    I am planning to buy my next desktop. I will be using this mainly for video editing. I am not a professional video editor, I normally do home made videos for youtube, like tutorial, DIY project etc. I use Nikon D3100 camera and some basic green screen techniques as part of recording. So my basic video editing would be just syncing audio, editing videos to cut un-necessary frames etc and some basic effects. I am also planning to buy final cut pro.
    So my question is should I buy the mac mini or Imac?

    Great advice from RRFS!
    For video editing, do go for 16 GB of RAM ffrom OWC & consider the twice as fast i7 2.6 model, see Geekbench scores here..
    http://www.everymac.com/systems/apple/mac_mini/specs/mac-mini-core-i5-2.5-late-2 012-specs.html
    http://www.everymac.com/systems/apple/mac_mini/specs/mac-mini-core-i7-2.6-late-2 012-specs.html

  • How to Use DLL Function in Java Applet

    Hi all,
    I have been assigned a task to develop java applet. The problem is, I need to use DLL functions in my applet to read records. Could you pls anyone guide me how to interface DLL and applet to read records with sample code?
    I'm using JDK 1.5.0_06 and Windows XP OS. thanx..
    best rgds,
    jpdbay

    You will need to use Java Native Interface JNI. Ther are many posts on the subject, please search, and this is the documentation:
    http://java.sun.com/j2se/1.5.0/docs/guide/jni/spec/jniTOC.html

  • What is the use of MAIN WINDOW in SCRIPTS

    what is the use of MAIN WINDOW in SCRIPTS, y we con't create a script w/o main window.
    Title was edited by:
            Alvaro Tejada Galindo

    Hi
    See this
    What are the different types of windows in SAP Scripts?
    Windows are defined in the Layout sets which define the position and the text to displayed.
    The different types of windows are:
    MAIN - Main Window
    The main window is a continous window which can extend over several pages. If the text in the main window fills up a page, a new page is created.
    Only one main window can be defined in the SAP Script whereas upto 100 instances of main window can be created in a page.
    VAR - Variable Window
    This window can have the variable contents displayed on them. The contents of the window cannot exceed the window size. The content can be formatted for each page.
    CONST - Constant Window
    The constant window can have a fixed content and is formatted only once.
    Main Windows (MAIN)
    Each form must have one window of type MAIN. Such a window is called the main window of the form. For SAPscript forms, the main window has a central meaning:
    • It controls the page break.
    • It contains the text body that may cover several pages.
    • It allows to fix text elements at the upper and lower margins of the allocated page window (for example, for column headings).
    As soon as a window of type MAIN is full, SAPscript automatically triggers a page break and continues to output the remaining text in the main window of the subsequent page. Page windows of type MAIN have the same width throughout the form. The SAPscript composer thus avoids reformatting of the text after each page break.
    Variable Windows (VAR)
    The contents of variable windows is processed again for each page, on which the window appears. The system outputs only as much text as fits into the window. Text exceeding the window size is truncated; the system does not trigger a page break. Unlike constant windows, the page windows declared as variable windows may have different sizes on different form pages.
    Constant Windows (CONST)
    Starting with Release 4.0, the system internally processes windows of type CONST similar to windows of type VAR. Therefore, if you create a new window, always use type VAR.
    <b><REMOVED BY MODERATOR></b>
    Anji
    Message was edited by:
            Alvaro Tejada Galindo

  • Problem with using isAuthenticate method in my applet

    Hi everyone
    I want to be sure that everytime that I select my applet the secure channel has been opened. I found isAuthenticate method from SecurityService Interface and I think that I can use this method in my applet's select method for this purpose. But when I declare an object as this type like this:
    SecurityService Objsecurity;
    to use its isAuthenticate method , I'm able to build my code and make the cap file successfully but I recieve error 6F F6 while loading my applet, And I can't find the meaning of this error in GP.
    I'll appreciate it if anyone could tell me how can I use this method in my applet .
    And the other question is is there any other way to find out the authentication have been done or not?
    Best Regards
    Shili

    Hi Pedja,
    Thanks for the prompt reply.
    I have been following the link you mentioned to create ADF security and successfully implementedthe first part where if i directly give any internal page url it redirects me back to login page.
    Instead of using weblogic-sql authenticator, i wanted to manually authenticate the user in loginbean.java where i check the username passowrd against the db.
    I had also implemented the method to access username,password mentioned in the following thread
    Re: ADF security on my jspx  page as login page
    Insted of using authentication.login, i am calling the db method to do the validation.
    The thing is after my db validation it does redirect me to the success page(menu.jspx). but when i click links on menu.jspx it redirects me back to login page.
    so i understand that user is not yet set in the session.
    I am stuck at the point how do i code the login.jspx, currently my login.jspx does not have any j_security_check and i think this is what is creating the problem.
    while searching for adding jsecurity in jspx i landed on the blog of 2006 and started using that.
    Can you please point me to some link which explains how to code login.jspx , i have been trying hard for couple of days.
    Thanks again
    ash

  • How to use IE proxy with an applet and a socket ???

    Hello!
    I need to make an applet running with Internet Explorer.
    This applet uses socket and sends http request to a server (the server where the
    applet is).
    It's ok but it doesn't work when my IE uses a proxy.
    My question is: how my applet can makes a socket using the IE proxy ?
    My applet can be used by many users, so it has to work with or without proxy, and has
    no need no configuration.
    Thanks for your help.

    Check for the system environment variable for "ie.proxy" in your applet code, if it returns something then use the proxy server, if not then ignore it.
    However, as a rule of thumb unless your IE Security settings enable applets to access URLs, then it won't work. Next, speaking in general java - applets can only access resources (URLs) from the applet's originating server (i.e. the server where the applet exists).
    If IE uses a proxy, then your applet should automatically use it, unless as I metioned before, your IE Security does not allow permission for the applet to do so. Check Tools - Internet Options - Security - Java - Advanced options.

  • How to use C-Structure in java applets

    hi alls,
    I want to use a struct model (struct in C++) in java applets. i know class is used in java applications. but, how can i convert in java applets?
    class renk
    int r;
    int gr;
    int b;
    import java.awt.Graphics;
    import java.awt.Color;
    import java.awt.Event;
    import java.applet.Applet;
    public class benek extends Applet
    final int n=10;
    int x[] = new int[n];
    int y[] = new int[n];
    int count = 0;
    renk clr[] = new renk[n];
    public void init()
    setBackground(Color.black);
    public boolean mouseDown(Event yordam, int xyer, int yyer)
    if (count<n)
    System.out.println("...");
    ekle(xyer,yyer);
    else System.out.println("Kapasite Doldu...");
    return true;
    void ekle(int xyer, int yyer)
    int r1 = (int)Math.floor(Math.random()*256);
    int gr1 = (int)Math.floor(Math.random()*256);
    int b1 = (int)Math.floor(Math.random()*256);
    clr[count].r = r1;
    clr[count].gr = gr1;
    clr[count].b = b1;
    x[count]=xyer;
    y[count]=yyer;
    count++;
    repaint();
    public void paint(Graphics g)
    it gives error message... how can � use struct model in java applets???
    if you help me i will be greatfull....

    � use import but it doesn't work.
    i add: import renk; or import class renk;
    how will � add import I assumed based on your initial post that the renk and benek classes were in the same file. Apparently you're saying they are not. So for another thing, make your renk class "public class renk", and add the "public" keyword to the 3 members of that class. Then if your code still doesn't see the "renk" class, it would just be that you don't have the directory that contains the compiled "renk.class" in your classpath.

  • Is it ok to buy student version of CC and i use it mainly for the University but ...

    Is it ok to buy student version of CC and i use it mainly for the University ... But i sometimes design (Logos, Posters .. etc..) for my friends and other peoples and i charge them for it  ? ... is legal ? because i really care about this small details.

    You are allowed to use student/teacher version for commercial purposes.
    Education FAQ

  • Is it ok to buy students version and use it mainly for University .. and sometimes i use it to design (logo, Poster, etc ..) for my friends and other peoples

    Is it ok to buy students version and use it mainly for University .. and sometimes i use it to design (logo, Poster, etc ..) for my friends and other peoples ?
    i care really about this small details

    Hi There,
    Yes, yon can use if you personal as well as commercial use.
    For more info check : Education FAQ
    Thanks,
    Atul Saini

  • Ipad won´t charge to use the mains charger, What's wrong?

    ipad won´t charge to use the mains charger, What's wrong?
    the usb cable will work to conect to itunes

    Sounds like it is dying. Is it still under warranty? If it is, I suggest you take it to Apple and ask them to repair it.
    Allan

  • Why is compressor using my main (application) disc drive?

    I’m using Compressor to convert a 2.5-hour .mov file to mpeg2/AAC. The destination is set to an external SATA drive, but the process is using the main application drive during the compressing process. The main drive has 50 GB available space but is running out of space during the conversion process. Is there a setting to direct which drive is used during compression? I don't understand why the main drive is being used when none of the project files are that drive and it is not the destination drive.

    Check:
    System Preferences>Apple QMaster>(Advanced Tab)>Shared Cluster Storage/Cluster Storage/Set...
    Choose your external hard drive.
    Attention: this is a permanent setting so when you disconnect your external drive the connection is lost.
    If this is not successful alone go back to (Setup Tab) and select "QuickCluster with services", check the Compressor service. Set the maximum Instances in "Options for selected services..." (select "Compressor" in the services list first to the number of your cores minus 4 cores. Hit "Start Sharing".
    hth
    sidenote: btw this shines a light on a recently introduced flaw in Compressor and the Cluster Storage setting. Former versions (<3.5.3) used the Cluster Storage as their intermediate render-destination, since it's latest evolution with the above described setting Compressor moves the segments to the destiantion as selected for the batch. This is unnecessary and slows down the merging process.

Maybe you are looking for

  • VLD-2550 and 2551: CLOB datatype errors

    Hi All I've been trying to solve thi sproblem but have not been able to find a solution. Basically I have a Col1 (of table A) of clob datatype which is to be mapped to Col2 (table B). But when I validate the map I get the error: VLD-2550 : BLOB,CLOB

  • Tech Help. Want to Unbridge Actiontec Fios Modem, Reset Does Not Help

    I successfully bridged my Actiontec Fios Modem in order to use a third party modem as I was looking for faster speeds. {And did get them with the Wireless N modem]. However, did not realize I would lose remote dvr search functionality. So, all I want

  • Ipod Nano - unable to upload photos

    hi. I recieved an ipod nano 8g for Christmas. I have been unable to successfully upload photos onto it. I do not have any songs on it yet so space shouldn't be an issue at all. I have a folder in my 'picutre' file designated for the photos I would li

  • Getting Start with Adobe Media Encoder

    i have installed flash cs4 3 month back it also had "Adobe Media Encoder" but i didn't installed it . but now i m running, it say u have to active it first . is there any crack file for "Adobe Media Encoder" . If any one is having it then please pass

  • Exporting HD Video in iMovie '08...YouTube

    As many know, you can now upload HD video to YouTube. I found some instructions on how to do it in iMovie using the Share>Export>As QuickTime Movie...but it doesn't work for me. The video comes out pixelated. Does anyone know a link to how to do this