Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Applet import user-define package
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


wesley1987
import user-define package
1 Answer(s)      6 years and 5 months ago
Posted in : Applet



Advertisement
View Answers

May 31, 2008 at 4:58 PM


Hi friend,

import java.io.*;
import java.awt.*;
import java.applet.Applet;


public class AppletExample extends Applet {

public void paint(Graphics g) {
int inset;
int rectWidth, rectHeight;
g.setColor(Color.pink);
g.fillRect(0,0,300,160);
g.setColor(Color.green);
inset = 0;
rectWidth = 299;
rectHeight = 159;
while (rectWidth >= 0 && rectHeight >= 0) {
g.drawRect(inset, inset, rectWidth, rectHeight);
inset += 15;
rectWidth -= 30;
rectHeight -= 30;
}

} // end paint()
}


-------------------------------------

<HTML>
<BODY>
<div align = "center">
<APPLET CODE = "AppletExample.class" WIDTH = "500" HEIGHT = "400"></APPLET>
</div>
</BODY>
</HTML>


---------------------------------

Read for more information.

http://www.roseindia.net/java/



Related Tutorials/Questions & Answers:
import user-define package - Applet
import user-define package  how to import user-define package to the frame/graphic of the applet. could i create a new frame or not ?? please help me ...  Hi friend, import java.io.*; import java.awt.*; import
how to import user-define package to applet - Applet
how to import user-define package to applet  how to import user-define package to applet... can u write a java coding can execute in jdk only .... thx...  Hi friend, import java.applet.*; import java.util.
Advertisements
user-define package for applet - Java Beginners
user-define package for applet  how to import a user-define package to applet ??  Hi import javax.swing.*; import java.awt.Graphics; import javax.swing.JApplet; public class WelcomeLines extends JApplet
import package - JSP-Servlet
import package  how to import a package into a jsp page...pls reply with an example..  Hi friend, To import a package in Jsp use the import Attribute of page Directive In JSP The package name folder is putted
user define exception programs
user define exception programs  user define exception programs   Please visit the following links: http://www.roseindia.net/java/java-exception/user-defined-exception.shtml http://www.roseindia.net/java/exceptions
Import My Own Package (Automatically)
Import My Own Package (Automatically)   How can I import my own package in every java program ( automatically )....? For example :- java.lang.String... automatically imported, we need not to import
Local Variable ,Package & import
Local Variable ,Package & import A local variable has a local scope.Such...; System.out.print(classVariable); } } Package & import Java classes can... libraries in an import statement. For More Details Click Below : Package
How to import a package
How to import a package      ... in package. Declaring the fully-qualified class name. For example...,    import world.*;    // we can call
Does importing a package imports the subpackages as well? e.g. Does importing com.MyTest.* also import com.MyTest.UnitTests?
a package imports the subpackages as well? e.g. Does importing com.MyTest.* also import... in the package MyTest only. It will not import any class in any of it's subpackage...Does importing a package imports the subpackages as well? e.g. Does importing
Display Current Date using JSP Custom(user define) Tag
Display Current Date using JSP Custom(user define) Tag In this section, we will discuss about how to display current date & time using  custom(user define) tag. JSP Custom Tags : Provide a mechanism to a Web programmer
The import keyword
; The import statement make available one or all the classes in a package... is the syntax to import a package in a class. import java.io.File... of import a package and the class of that package: java.util.ArrayList
package
package  write a package for games which have two classes indoor... specifier and also use the finalize() method   We have created a package... class, we have imported this package and using a function display(), we have
Package
Package  Create a Package named com.example.code. Write few classes, interface and abstract classes. Now create a class names PackageDemo that uses the classes of this package from other package
Package
Package  Create a Package named com.example.code. Write few classes, interface and abstract classes. Now create a class names PackageDemo that uses the classes of this package from other package
package:
package:  i hv created created a package and save it into D... in a package world. The we specify the keyword package with the name of the package. package world; public class HelloWorld { public static void main(String
package:
package:  i hv created created a package and save it into D... in a package world. The we specify the keyword package with the name of the package. package world; public class HelloWorld { public static void main(String
package
package  by what name we can save a java file that contain a package {i.e package p;} and several public classes {i.e public class abc} but not a main method
package
package  hello, What is a package?   hello, To group set of classes into a single unit is known as packaging. Packages provides wide namespace ability
package
can allow types in one package to have unrestricted access to one another, still restricting the access for the types outside the package
package
package  Smith has created a package named ApplianceDetails that contains the Appliance class.Now he wants to create a class named NewAppliance that stores the details of the newly launched appliances.He uses the following syntax
package
package  Smith has created a package named ApplianceDetails that contains the Appliance class.Now he wants to create a class named NewAppliance that stores the details of the newly launched appliances.He uses the following syntax
The import Attribute of page Directive In JSP
or import all classes of the package by using packagename.*. Here is the code... The import Attribute of page Directive In JSP       This section shows you how to import a java
import file
import file    public void importFile(BlobDomain fileData) { InputStream inStr = fileData.getInputStream(); Workbook workbook = Workbook.getWorkbook(inStr); Sheet sheet = workbook.getSheet(0); int colCount
User Define Alert Example
User Define Alert Example       Creating a user defined alert message, In the given example we have created a image that can be fill with some colors and text
Import attribute of page directive
import="{package.class | package.*}, ..." %> <%@ page import = "java.util....Import attribute of page directive   How use import attribute of page directive ?   The import attribute is used to import all the classes
Excel User Define Error Message
Excel User Define Error Message In this section, you will learn , while cell value validation,  how to show user defined error message using Apache POI... dataValidation = new HSSFDataValidation(addressList, dvConstraint); // USER DEFINE
Package in Servlet
Package in Servlet  How Create Package in Servlet ?   package packagename ; import java.io.*; import javax.servlet.*; import..."); PrintWriter out = response.getWriter(); out.println("Hello,Package Example
import package.subpackage.* does not work
com.test.* i write import com.test.A; it works. kindly explain me. I am a new user...import package.subpackage.* does not work  I have 3 class files. A.java B.java C.java Below is the code block A.java:- package com.test
JSP import
; will import all classes defined in java.util package. You can also import a user-defined package like:  <%@ page import=?roseindia.HelloWorld... packagename.classname or import all classes of the package by using packagename
Problem of Import JWorkbook
Problem of Import JWorkbook  Hi... i can't use the jworkbook in my project.what types of library files in import
Java static import
Java static import  What is the use of static import
 

 

 

DMCA.com