Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Re: Applet code conversion...

Reply
Thread Tools

Re: Applet code conversion...

 
 
Jeff Higgins
Guest
Posts: n/a
 
      04-30-2012
On 04/30/2012 02:50 AM, linus wrote:
> How an applet code code can be trasformed to an application code ?
> I thought that adding a "main" would be enough .... but it is not so
> easy ! Is there an example about this my problem ?
> Thank a lot.


For the simplest case:

import java.awt.BorderLayout;
import java.awt.Frame;
import javax.swing.SwingUtilities;
import usenet.linus.MyApplet;

public class AppletFrame {

public static void main(String[] args) {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
MyApplet myApplet = new MyApplet();
Frame myFrame = new Frame("Linus MyApplet Frame");
myApplet.init();
myFrame.add(myApplet, BorderLayout.CENTER);
myFrame.pack();
myFrame.setVisible(true);
}
});
}
}
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Applet - server communication - edited code on the applet side - problem! Rune Andresen Java 2 09-17-2003 06:26 PM
Cool Applet Cool Applet http://24.60.235.213/Grid/ Alisher Fatykhov Java 1 08-06-2003 04:32 AM
Re: newbie: Join JApplet & Applet in one applet Andrew Thompson Java 0 08-05-2003 01:41 PM
Re: play wave files using java.applet.Applet webster Java 0 07-20-2003 01:51 PM
applet vs. canvas in applet Rob Love Java 1 07-07-2003 10:07 PM



Advertisments