What is lightweight and heavyweight ? how to create my applet lightweight?

Sir ,
t have created an applet and in that i have not use any component
for drawing now i want to use component for applet but cant grtting how to do this , by reference of sun java i have found this code for application to create lightweight::
import java.awt.*;
import java.awt.event.*;
* Silly Sample program which demonstrates the basic paint
* callback mechanism in the AWT.
public class test1{
public static void main(String[] args) {
Frame f = new Frame("Have a nice day!");
f.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
f.add(new SmileyCanvas(Color.yellow), BorderLayout.CENTER);
f.pack();
f.show();
* A canvas which renders a smiley-face to the screen
* Note: Canvas is a heavyweight superclass, which makes
* SmileyCanvas also heavyweight. To convert this class to
* a lightweight, change "extends Canvas" to "extends Component".
class SmileyCanvas extends Canvas {
public SmileyCanvas(Color faceColor) {
setForeground(faceColor);
public Dimension getPreferredSize() {
return new Dimension(300,300);
* Paint when the AWT tells us to...
public void paint(Graphics g) {
// Dynamically calculate size information
// (the canvas may have been resized externally...)
Dimension size = getSize();
int d = Math.min(size.width, size.height); // diameter
int ed = d/20; // eye diameter
int x = (size.width - d)/2;
int y = (size.height - d)/2;
// draw head (color already set to foreground)
g.fillOval(x, y, d, d);
g.setColor(Color.black);
g.drawOval(x, y, d, d);
// draw eyes
g.fillOval(x+d/3-(ed/2), y+d/3-(ed/2), ed, ed);
g.fillOval(x+(2*(d/3))-(ed/2), y+d/3-(ed/2), ed, ed);
//draw mouth
g.drawArc(x+d/4, y+2*(d/5), d/2, d/3, 0, -180);
this code is not for applet so how to make this code for applet ?

I use the Snippets folder to store re-usable code. Scroll to
the file or
folder desired, double click and voila! Code is inserted into
the page.
As for the other bells & whistles, you are probably
thinking about DW
Extensions (.mxp) files. There are many 3rd party makers of
extensions.
Some are free, some cost a nominal fee. Check around to see
if what you
want isn't already available. If not, read this article.
Creating an Extension:
http://help.adobe.com/en_US/Dreamweaver/10.0_Extending/WS5b3ccc516d4fbf351e63e3d117f508c8d e-7fde.html
Nancy O.
Alt-Web Design & Publishing
www.alt-web.com

Similar Messages

  • I want to know what I need and then how to take a pdf form I created in word and add the blue boxes so that anyone can type into my form

    I want to know what I need and then how to take a pdf form I created in word and add the blue boxes so that anyone can type into my form

    Hey john@adobe,
    Could you please specify how exactly have you created your form.
    You might need to have Acrobat installed on your computer to convert a word document to PDF.
    Do you have Acrobat installed? If yes, what version? If no, then please try using the trial version of Acrobat DC (latest version) and access its features:
    Download Adobe Acrobat free trial | Acrobat Pro DC
    Also, let me know what kind of blue boxes are you talking about.
    If you want others to edit your PDF form, then you need to make it a fillable form by choosing 'Form Editing' option from Tools pane.
    Let me know more on this so that I can help you out.
    Regards,
    Anubha

  • How to create an applet that shows a pdf as non-editable.

    Hi friends,
    Does any one know how to create an applet that shows a pdf document (should make that pdf a non-editable one) while clicking a link.Its urgent for me as I have to complete this one tomorrow itself...please help me...
    I am able to view the pdf document but that cannot be make a non-editable one.
    Can anyone gave me the code for that one....please I am not very much good in Java.

    PDF is a proprietary format and Java doesn't support it by default. Are you using a 3rd party tool to create the PDF? If so, you need to review the developer docs to see how to make the document non-editable. Frankly, I don't see why you're using an Applet to view a PDF in the first place. What exactly are you trying to do. I'm confused.

  • What is Data source? How to create a datasource?

    Hi All,
        anybody could you explain me What is Data source and how to create data source?
    How it is related to BW.
    Points will be rewarded for all the useful answers.
    Priya.

    Hi Priya,
    You can Create DataSource for Different Source systems.
    Chech these URLs.
    http://help.sap.com/saphelp_nw04s/helpdata/en/43/01ed2fe3811a77e10000000a422035/content.htm
    http://help.sap.com/saphelp_nw04s/helpdata/en/43/00153831035167e10000000a1553f6/content.htm
    http://help.sap.com/saphelp_nw04s/helpdata/en/42/fdccb72aa95277e10000000a1553f7/content.htm
    http://help.sap.com/saphelp_nw04s/helpdata/en/43/93dbdbff0b274ee10000000a422035/content.htm
    http://help.sap.com/saphelp_nw04s/helpdata/en/43/03b1f4dc636e72e10000000a422035/content.htm
    steps in 'how to delta generic datasource'
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/84bf4d68-0601-0010-13b5-b062adbb3e33
    /message/3471234#3471234 [original link is broken]
    Re: How to create datasource
    <b>Reward points for helpful answers</b>
    Satish

  • How to create signed applet and make it work with browser

    i hav an applet that needs to write a file to onto local system resource. i came to know that the applet needs to be signed. so i searched some guides to create a signed applet but most of them specify how to use it with applet viewer and not on a browser. plz help me with how to sign an applet and and allow it to write a file from within a browser.

    On linux, something like this:
    keytool -genkey -alias signSocket -keystore socketstore -keypass abc123 -dname "cn=your name" -storepass abc123
    jar cvf Socket.jar *.class
    jarsigner -keystore socketstore -storepass abc123 -keypass abc123 -signedjar SSocket.jar Socket.jar signSocket
    And in html:
    CODE = "YourClass.class"
    ARCHIVE = "SSocket.jar"
    ...

  • How to create an applet, with many squares inside?

    Hey,
    I'm having problems creating an applet. Heres the image I need to recreate. The drawing should scale, so that it reaches the full width and
    height of the applet.
    http://img503.imageshack.us/my.php?image=graphicsafx5.jpg
    I created a similar one (the code is below), but don't know how to modify it to create the image in the above link. Do I need a for loop? like for ( int i = 0; i < 10; ++i )
    import java.applet.Applet;
    import java.awt.*;
    public class AprilTest1 extends Applet
       public void paint(Graphics g)
            Graphics2D g2 = (Graphics2D)g;
            int width = getWidth();
            int height = getHeight();
            g2.setColor( Color.black );
            g2.fillRect( 0, 0, width, height);
            int pen_width = width/90 + 1;
            g2.setStroke(new BasicStroke(pen_width));
            g2.setColor( Color.white );
            g2.drawRect( width/4, height/4, width/2, height/2);
    }

    As CeciNEstPasUnProgrammeur said you do need a loop. You can probably make good use of the % operator inside your loop also.
    for(int i=0; i<NUMBER_OF_RECTANGLES; i++){
         if(i % 2 == 0) {
             //draw black rectangle
         } else {
             //draw white rectangle
    }Just think about what you need to do:
    -Start 1 rectangle at (0,0) and have its width and height as getWidth() and getHeight().
    -Pick an increment [this will be the 'width' of each rectangle]
    -Now for each rectangle you want to move your x and y points right and down by your increment. Moreover, you want to make your width and height smaller by your increment*2
    Essentially what I did is initialize 3 variables to 0 [say x, y, and z]. In your for loop use the % operator in an if-else block. If the loop is on an even number make a white rectangle, if the loop is on an odd number make a black rectangle. Set the x and y position to x+z and y+z respectivley. Set the height and width to getHeight()-(z*2) and getWidth()-(z*2) and then increment z by...lets say 10.
    This means on the first loop:
    x = 0
    y = 0
    width = getWidth()
    height = getHeight()
    Second loop:
    x = 10
    y = 10
    width = getWidth()-20 [10 to compensate for the shift, and 10 for the width]
    height = getHeight()-20
    Here is what I came up with - hope it helps.
    import java.applet.Applet;
    import java.awt.*;
    public class AprilTest1 extends Applet {
         private int x, y, z = 0;
         public void paint(Graphics g) {
              for(int i=0; i<10; i++){
                   if(i%2==1){
                      g.setColor( Color.white );
                      g.fillRect(x+z, y+z, getWidth()-(z*2), getHeight()-(z*2)); 
                   } else {
                      g.setColor( Color.black );
                      g.fillRect(x+z, y+z, getWidth()-(z*2), getHeight()-(z*2));
                   z += 10;
    }Any questions, feel free to ask :)

  • How to create an applet in a JDestopPane?

    hello i would like to create an applet (JApplet) in a desktop (JDesktopPane).
    i have to put the applet in a JInternalFrame so i can move and resize the window around.
    indeed i can have several applets in the JDesktopPane.
    it would be more powerfull than viewing it in a web navigator.
    more i want to load an applet from its web site from its jar file.
    i know that from a html page, you have to tell the navigator where is the jar file with the "archive" tag; the "CODE" tag is the name of the class file not the path to the package like my.package.myclass !
    can i put my.package.myclass instead of myclass.class in the "CODE" tag?

    duplicate post

  • How to create an applet in a jDesktopPane

    hello i would like to create an applet (JApplet) in a desktop (JDesktopPane).
    i have to put the applet in a JInternalFrame so i can move and resize the window around.
    indeed i can have several applets in the JDesktopPane.
    it would be more powerfull than viewing it in a web navigator.
    more i want to load an applet from its web site from its jar file.
    i know that from a html page, you have to tell the navigator where is the jar file with the "archive" tag; the "CODE" tag is the name of the class file not the path to the package like my.package.myclass !
    can i put my.package.myclass instead of myclass.class in the "CODE" tag?
    here's some snaphot of my softwar kevin_shell to give you some ideas:
    http://go.to/kevin-net/SNAP
    desktop_panel: the JDesktopPane where i have opened a simple applet.
    explorer_panel
    it is an open source project.
    hope someone answer me, i will give to you my source code.

    duplicate post

  • What to ship today? How to create Packing Slip?

    Sales created 20x A/R invoice for today's orders.
    1. For the warehouse who has access to SBO, how do they view what they need to ship today? Is there anyway to display some sort of list what they need to ship today?
    2. Secondly, after I created A/R invoice, how do I create and print Packing Slip? I have browsed SBO documentations, but I didn't find such a thing.
    Please help.

    Correct me if I'm wrong here, but for your Sales department, they should be creating Sales Orders first then Sales Delivery Order and finally Sales AR Invoice.
    This is how SAP B1 can help you track what to ship today. Within each Sales Order, there is a date field for 'estimated delivery date' and for each Sales order your Sales team creates, they can have a estimated delivery date here.
    Once that is done, you can either:
    A. Write a query and use that as a report or attach it to the Alert Management to trigger a message to users on what Sales Orders have to be delivered today.
    Example Query to show what items from the Sales Order that have to be delivered today
    SELECT T0.DocNum, T0.CardCode, T0.CardName, T1.ItemCode, T1.Dscription, T1.Quantity, T1.ShipDate FROM ORDR T0 INNER JOIN RDR1 T1 ON T0.DocEntry = T1.DocEntry WHERE T1.ShipDate = (CONVERT(CHAR(8),GETDATE(),10)) AND T1.OpenQty <> 0
    B. Use the Open Item report to see which Sales Orders have not been sent out.
    When your Sales department creates AR Invoices, SAP B1 will already have deducted the inventory from the warehouse, so there's no such thing as 'what to deliver today'

  • Volumes and disks - how to create/use?

    Hi,
    Environment: x86. I've one Solaris system disk (80 GB) and two additional disks, one 250 GB and 80 GB. I'd like to use these two as one. I've created volume (RAID 0, first option in smc), with name d0. The size of the volume is ~310 GB.
    My question is how to mount this volume, how to make system to see it -- I'm lost. When I try to:
    bash-3.00# mount /dev/md/dsk/d0 /mntI get:
    mount: /dev/md/dsk/d0 is not this fstypeAre there any additional steps to do? When I tried to use format, it could operate on hardware disk level (obvious).
    Rev

    reveler_ wrote:
    Yep, I've already done it. But, by the way, a question: I created fs without T option (no newfs -T...). Will it be possible in the future to:
    1. add another disk to the volume group (I guess yes, no problem)
    2. extend fs to cover new disk?
    Thanks,
    Rev1) Yes.
    2) The command is growfs; but I've not done a growfs in conjunction with LVM. It should work but not having seen it work myself I won't got the last little bit and say it does work ;)
    Best,

  • HT1937 I have an imac and an iPad. emails are synched but suddenly, last night, the calendar on my imac was erased for no apparent reason but it is still on my iPad. what has happened and can how do I resynch calendars?

    I have an imac and ipad. Last night the calendar was erased for no apparent reason. It remains on my ipad. what happened and how can I get the calendar dates back on my imac?

    Hello Chisels,
    Welcome to the Apple Support Communities. If you want to get content from your iPad to you iMac, there are a few things to try.
    First check to the iPad to see if it is syncing with iCloud. To do this, go to Calendar app and click the Calendars button in the upper left hand corner. If it says iCloud, then all you need is to enable iCloud on your iMac if you are running 10.7 Lion or later. That preferences is System Preferences > iCloud, if you are
    If on the iPad it says “On my iPad”, the following steps will guide you to get it back your iMac.
    First, in iTunes, go to the preferences by clicking in the drop down menu iTunes  > Preferences… Go to the device tab and make sure to check the box that says Prevent iPods, iPhones, and iPads from Syncing automatically.
    Then follow the steps in the following articles to make a backup and the sync the data.
    For backup instructions.
    iOS: How to back up
    http://support.apple.com/kb/HT1766
    This one will assist with syncing your iPad to the iMac.
    iOS: How to transfer or sync content to your computer
    http://support.apple.com/kb/HT1296
    Regards,
    -Norm G.

  • [SOLVED]JDeveloper 10g and ADF: How to create proxy from WSDL behind SSL?

    Hi all,
    I have successfully created web service proxies using the "Create Web Service Proxy" wizard. However, when I attempt to generate proxy from a wsdl file behind a ssl connection, JDeveloper throws a "SSLHandshakeException". I have a working java keystore file which was verified by using the soapUI tool. Within the soapUI tool, there is a "SSL Settings" preference tab which allows me to point to a *.jks file/password. I tried looking for a similar setting in JDeveloper preference with no luck. Is anyone familiar with this type of request?
    Many thanks,
    Wes
    Edited by: Wes Fang on Sep 21, 2010 10:25 AM

    add certificate to java keystore with something similar to the following:
    C:\jdev10134\jdk\jre\lib\security>keytool -import -trustcacerts -file MYCERTIFICATE.cer -alias MYCERTIFICATEALIAS -keystore cacerts
    Enter keystore password: *******
    Certificate already exists in system-wide CA keystore under alias <MYCERTIFICATEALIAS>
    Do you still want to add it to your own keystore? [no]: yes
    Certificate was added to keystore
    The reason it said certificate already exist is because I also added it to the JAVA_HOME\ path.
    I restarted jdeveloper and used the proxy generation wizard again, everything worked fine.

  • What is AIVMFile and why are they creating themselves?

    There was a couple in the root folder of my hard drive, now there are hundreds. Can I delete? Is it some attempt at spy ware? Thanks!

    I just ended up with 2117 AIVMFileXXX files at the root level of my startup drive, after Adobe Illustrator sucked up all my remaining hard disk space while working on several AI docs in Illustrator CS6. I had to force-quit Illustrator and restart my MacBook Pro because I was down to 200 MB of free space on my drive! I presume AIVMFile means Adobe Illustrator Virtual Memory File. Note that all the AIVMFileXXX were zero K in size. I simply deleted them.

  • HT201328 There's an icon symbol of a lock with an arrow circleing it how can I find out what this is and just how to resolve this issue?

    I turned the iPhone on to find out that there's a lock with a circle with an arrow arroubd it! Can any one out there give me any advise on just how to resolve this issue?

    Please check your duplicate post for answers already provided.
    https://discussions.apple.com/message/24278034#24278034

  • How to create an applet within an application?

    Hi. Im trying to make an applet work within a main application but I cant get it to work because then I have 2 of these and it gives me an error:
    public class java_tester extends JFrame implements MouseListener //MAIN APPLICATION
    public class MusicPlay extends JApplet //APPLET
    I cant have both if them because it is like two different programs.
    Can anyone help me with this?
    Thanks

    ProGenius wrote:
    But when I put public class MusicPlay extends JApplet it underlines it because the name of the main program is different and when I give it the same name it still underlines it. I know it probably is easy to do it but I really dont know how to make it work.
    Thanks a lot for your helpWhat is "it", what is "it" underlining, and why is this a problem? There's no such concept as "main program". If you're confused by the presence of two whole classes, don't be. Anything beyond the laughably trivial will consist of several classes.

Maybe you are looking for

  • How do I delete an Apple ID if it say the password is incorrect?

    I have an Apple ID and my wife has an Apple ID. However, her ID is on my iPad and iPhone. I did manage to get the Apple ID changed to mine for apps on my iPhone and iPad, but the iCloud ID is still my wife's. When I try to delete her's from my iPad o

  • How do I get my Hp scanner to work with Mavericks?

    I am running 10.9.4 and my wife uninstalled the software to our HP Scanjet 4370. I'm not sure what to do to get the scanner to operate because HP does not have a driver or software for Mavericks yet. Can anyone help?

  • How do you get your iMessages to say iMessage when you get a message on the updated iO6?

    My iMessages are on but before I updated it when I received a message it would say iMessage instead of the actually message. Now that I updated it it doesn't how do I turn that back on. I don't want people to read my messages! It's the newest iPod to

  • Disk Utility results

    A few months ago I migrated from an iBook G4 w/Tiger to a MBP, and installed Leopard. I did a custom install, leaving out printer drivers, extra fonts and additional languages. Since I began using this MBP, whenever I repair permissions I get a long

  • Open PDF with Parameters has no effect if PDF is already open

    Hello Users, I try to open a PDF at a named destination. This works fine. But if the PDF is already open and I change the nameddest-Parameter, nothing happens. The Document don't jump to the new destination: I try this on the DOS-Shell, finally I wou