4 Replies - 30309 Views - Last Post: 23 February 2007 - 09:21 AM Rate Topic: -----

#1 Anandsc2003  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 20-February 07

Difference between applets and applications in Java

Posted 22 February 2007 - 11:17 PM

Hai

I need help in java

I need some help regarding the differences between an applet and applications in java.

Are swings also considered as java applications or applet ??

can we write the code using swings to generate frame like standalone window applications.

Very urgent. :huh2:

Is This A Good Question/Topic? 0
  • +

Replies To: Difference between applets and applications in Java

#2 rahulbatra  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 16
  • View blog
  • Posts: 183
  • Joined: 28-December 05

Re: Difference between applets and applications in Java

Posted 23 February 2007 - 12:27 AM

An application typically acts as a stand-alone program that runs on top of the OS enviornment (+JVM), whereas a Java Applet lives inside a web browser. For the more technically inclined, a Java application is made up of a main() method whereas a Java applet is made up of at least one public class that has to be subclassed from java.awt.Applet.

Swing is a library which can be (and is very popular) for creating application user interfaces. So yes, it can be used to create standalone apps UI's.
Was This Post Helpful? 0
  • +
  • -

#3 1lacca  Icon User is offline

  • code.rascal
  • member icon

Reputation: 44
  • View blog
  • Posts: 3,822
  • Joined: 11-August 05

Re: Difference between applets and applications in Java

Posted 23 February 2007 - 01:16 AM

And Swing can be used in applets, too.

Applets run in applet containers ( usually provided by browsers ), which generally impose strict security restrictions (file,network access, etc.) on them, and can be relieved by signed applets only.
Was This Post Helpful? 0
  • +
  • -

#4 William_Wilson  Icon User is offline

  • lost in compilation
  • member icon

Reputation: 204
  • View blog
  • Posts: 4,807
  • Joined: 23-December 05

Re: Difference between applets and applications in Java

Posted 23 February 2007 - 05:29 AM

anything in a application (except file IO) will transfer to an applet and vice versa:
If you need help converting you can read this snippet on doing such
Was This Post Helpful? 0
  • +
  • -

#5 1lacca  Icon User is offline

  • code.rascal
  • member icon

Reputation: 44
  • View blog
  • Posts: 3,822
  • Joined: 11-August 05

Re: Difference between applets and applications in Java

Posted 23 February 2007 - 09:21 AM

View PostWilliam_Wilson, on 23 Feb, 2007 - 01:29 PM, said:

anything in a application (except file IO) will transfer to an applet and vice versa:
If you need help converting you can read this snippet on doing such


I beg to differ. For unsigned applets if no special permissions are configured for their codebase the sandbox model is applied, as seen in the policy file bundled with each JRE:
// default permissions granted to all domains

grant { 
	// Allows any thread to stop itself using the java.lang.Thread.stop()
	// method that takes no argument.
	// Note that this permission is granted by default only to remain
	// backwards compatible.
	// It is strongly recommended that you either remove this permission
	// from this policy file or further restrict it to code sources
	// that you specify, because Thread.stop() is potentially unsafe.
	// See "http://java.sun.com/notes" for more information.
	permission java.lang.RuntimePermission "stopThread";

	// allows anyone to listen on un-privileged ports
	permission java.net.SocketPermission "localhost:1024-", "listen";

	// "standard" properies that can be read by anyone

	permission java.util.PropertyPermission "java.version", "read";
	permission java.util.PropertyPermission "java.vendor", "read";
	permission java.util.PropertyPermission "java.vendor.url", "read";
	permission java.util.PropertyPermission "java.class.version", "read";
	permission java.util.PropertyPermission "os.name", "read";
	permission java.util.PropertyPermission "os.version", "read";
	permission java.util.PropertyPermission "os.arch", "read";
	permission java.util.PropertyPermission "file.separator", "read";
	permission java.util.PropertyPermission "path.separator", "read";
	permission java.util.PropertyPermission "line.separator", "read";

	permission java.util.PropertyPermission "java.specification.version", "read";
	permission java.util.PropertyPermission "java.specification.vendor", "read";
	permission java.util.PropertyPermission "java.specification.name", "read";

	permission java.util.PropertyPermission "java.vm.specification.version", "read";
	permission java.util.PropertyPermission "java.vm.specification.vendor", "read";
	permission java.util.PropertyPermission "java.vm.specification.name", "read";
	permission java.util.PropertyPermission "java.vm.version", "read";
	permission java.util.PropertyPermission "java.vm.vendor", "read";
	permission java.util.PropertyPermission "java.vm.name", "read";
};



All permissions except for these (file, net, property, runtime, etc.) must be granted explicitly, or a custom security manager must be provided.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1