Academic Tutorials



English | French | Portugese | German | Italian
Google

Home Source Codes E-Books Downloads Contact Us About Us

Java Tutorial
Java Introduction
Object Oriented Programming Concepts
Anatomy of a Java Application
Syntax and Semantics of Java
Java Objects, Classes, and Interfaces
The String and StringBuffer Classes in Java
Setting Program Attributes in Java
Using System Resources in Java
Threads of Control in Java
Errors and Exceptions in Java
Java Input and Output Streams
Overview of Java Applet
Creating an Applet User Interface in Java
Communicating with Other Programs in Java
Overview of the Java UI
Using GUI Building Blocks in Java
Laying Out Components within a Container
Working with Graphics in Java
How Java Differs from C and C++
Java Summary

HTML Tutorials
HTML Tutorial
XHTML Tutorial
CSS Tutorial
TCP/IP Tutorial
XML Tutorials
XML Tutorial
XSL Tutorial
XSLT Tutorial
DTD Tutorial
Schema Tutorial
XForms Tutorial
XSL-FO Tutorial
XML DOM Tutorial
XLink Tutorial
XQuery Tutorial
XPath Tutorial
XPointer Tutorial
RDF Tutorial
SOAP Tutorial
WSDL Tutorial
RSS Tutorial
WAP Tutorial
Web Services Tutorial
Browser Scripting
JavaScript Tutorial
VBScript Tutorial
AJAX Tutorial
DHTML Tutorial
HTML DOM Tutorial
WMLScript Tutorial
E4X Tutorial
Server Scripting
ASP Tutorial
PHP Tutorial
PERL Tutorial
SQL Tutorial
ADO Tutorial
.NET (dotnet)
Microsoft.Net
XML Web Services
ASP.Net
.Net Mobile
C# : C Sharp
ADO.NET
VB.NET
Multimedia
SVG Tutorial
Flash Tutorial
Media Tutorial
SMIL Tutorial
Web Building
Web Browsers
Web Hosting
W3C Tutorial
Web Building
Web Quality
Web Semantic
Web Careers
Java Tutorials
Java Tutorial
JSP Tutorial
Servlets Tutorial
Struts Tutorial
EJB Tutorial
JMS Tutorial
JMX Tutorial
Programming Langauges
C Tutorial
C++ Tutorial
Visual Basic Tutorial
Data Structures Using C
Soft Skills
Communication Skills
Time Management
Project Management
Team Work
Leadership Skills
Corporate Communication
Negotiation Skills


Creating an Applet User Interface in Java

Previous Next



Almost all the applets have graphical user interface (GUI).This page discusses few issues which are particular to applet GUIs.




Applet is a Panel.

Since an Applet is a subclass of AWT Panel class, applets can contain other Components, just as a Panel can contain. As Panels, Applets also do participate in AWT drawing and the event hierarchy.




Applets do appear in the pre-existing browser windows.

This is having two implications. First, unlike GUI-based applications, applets dont have to create the window to display themselves on. (They can do, if they have a good reason, but usually they just display themselves within the browser window ). Second, depending on browsers implementation, the applet's components may not be shown unless an applet calls the validate() after adding components to itself. Fortunately, calling validate() cannot hurt.




Each applet have a user-specified, pre-determined size.

Since the <APPLET> tag requires the applet's width and height to be specified, and because browsers not necessarily allow applets to resize themselves, applets should make with fixed amount of space that may not be ideal. Even if amount of space is ideal for one platform, the platform-specific parts of applet (such as buttons) may require a different amount of space on the other platform. You can do compensate by recommending the pages that includes your applet specify a little more space than be necessary, and by using the flexible layouts, like GridBagLayout and BorderLayout, which adapt well to extra space.




Applets do load images using Applet getImage() methods.

An Applet class do provide a convenient form of getImage() which lets you to specify a base URL as one argument, followed by second argument which specifies an image file location, relative to base URL. The Applet getCodeBase() and getDocumentBase() methods do provide the base URLs which the most applets use. Images that the applet always needs, or needs to rely on a backup, are usually specified relative to where an applet's code was loaded from. Images which are specified by an applet user (often with the parameters in HTML file) are usually relative to page which includes the applet (document base).




Applet classes and often the data files they use are loaded over the network,

Applets can perform several things to decrease the perceived startup time. Their Applet subclass can be small one which immediately displays the status message. And, if some of the applet classes or data are not used right away, the applet can preload classes or the data by referencing them before they are needed. Cosider for example, the AppletButton class, at the beginning of the main thread, gets the class object for the window the button brings up. Here its main purpose is to make sure that the class is valid, but an added benefit is getting the class object force the class file to be loaded before it is needed, which makes the class instantiating much quicker than if a class still had to be loaded.




Share And Enjoy:These icons link to social bookmarking sites where readers can share and discover new web pages.
  • blinkbits
  • BlinkList
  • blogmarks
  • co.mments
  • connotea
  • del.icio.us
  • De.lirio.us
  • digg
  • Fark
  • feedmelinks
  • Furl
  • LinkaGoGo
  • Ma.gnolia
  • NewsVine
  • Netvouz
  • RawSugar
  • Reddit
  • scuttle
  • Shadows
  • Simpy
  • Smarking
  • Spurl
  • TailRank
  • Wists
  • YahooMyWeb

Previous Next

Keywords: Graph Drawing Applet, java ftp applet, web ftp client, java file upload


HTML Quizes
HTML Quiz
XHTML Quiz
CSS Quiz
TCP/IP Quiz
XML Quizes
XML Quiz
XSL Quiz
XSLT Quiz
DTD Quiz
Schema Quiz
XForms Quiz
XSL-FO Quiz
XML DOM Quiz
XLink Quiz
XQuery Quiz
XPath Quiz
XPointer Quiz
RDF Quiz
SOAP Quiz
WSDL Quiz
RSS Quiz
WAP Quiz
Web Services Quiz
Browser Scripting Quizes
JavaScript Quiz
VBScript Quiz
AJAX Quiz
DHTML Quiz
HTML DOM Quiz
WMLScript Quiz
E4X Quiz
Server Scripting Quizes
ASP Quiz
PHP Quiz
PERL Quiz
SQL Quiz
ADO Quiz
.NET (dotnet) Quizes
Microsoft.Net Quiz
XML Web Services Quiz
ASP.Net Quiz
.Net Mobile Quiz
C# : C Sharp Quiz
ADO.NET Quiz
VB.NET Quiz
Multimedia Quizes
SVG Quiz
Flash Quiz
Media Quiz
SMIL Quiz
Web Building  Quizes
Web Browsers Quiz
Web Hosting Quiz
W3C Quiz
Web Building Quiz
Web Quality Quiz
Web Semantic Quiz
Web Careers Quiz
Java Quizes
Java Quiz
JSP Quiz
Servlets Quiz
Struts Quiz
EJB Quiz
JMS Quiz
JMX Quiz
Programming Langauges Quizes
C Quiz
C++ Quiz
Visual Basic Quiz
Data Structures Using C Quiz
Soft Skills Quizes
Communication Skills Quiz
Time Management Quiz
Project Management Quiz
Team Work Quiz
Leadership Skills Quiz
Corporate Communication Quiz
Negotiation Skills Quiz

Privacy Policy
Copyright © 2003-2008 Vyom Technosoft Pvt. Ltd., All Rights Reserved.