Can you draw a shape and add it to an application?

Hi,
I am totally new to Flex and Flash, action script and all
(started Wednesday). I am not sure what I'm doing wrong here, if
anyone could help me Id really appreciate it.
var max:Shape=new Shape();
max.graphics.beginFill(0x000000);
max.graphics.lineStyle(1, 0x000000);
max.graphics.drawRect(0, 0, 100, 10);
max.graphics.endFill();
stats.addChild(max);
Now stats is a canvas which is a child of my application
object. The application object is the root of it all.
I also tried using the "Rectangle" class but that did not
work either.
Thanks to anyone who can point me in the right direction
:)

Thanks, ill try that next time i need to use a shape.
Yesterday i decided to stretch a 1x1 image to make it a rectangle
:p Worked like a charm.

Similar Messages

  • Draw a shape and add it to cells in a JTabel. Help Please

    Hi all
    I have written some code that draws a shape using Graphics2D.
    What I am after being able to do is create this shape then place it in a cell of a JTable.
    One Other thing is I need to create different color shapes for each row in the table.
    is this posable ??
    Any help would be appreciated
    Craig
    import java.awt.*;
    import javax.swing.*;
    public class RectangleDemo2D extends JFrame {
      private Color color1 = new Color(255, 3, 3);// Color
      private Color color1a = new Color(255, 3, 3, 155); // Color with Alpha
      private Color color2 = new Color(255, 255, 255, 155); //Color White
      int x = 150;
      int y = 150;
      int w = 12;
      int h = 12;
      int arc = 6;
      GradientPaint gradient = new GradientPaint(5, 0, color1, 5, 90, color2, false);
      final static BasicStroke stroke = new BasicStroke(1.0f);
      public void paint( Graphics   g) {
        Graphics2D g2 = (Graphics2D) g;
        g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
        g2.setPaint(gradient);
        g2.fillRoundRect(x, y, w, h, arc, arc);
        g2.setPaint(color1a);
        g2.setStroke(stroke);
        g2.drawRoundRect(x, y, w, h, arc, arc);
        //ImageIcon ico = new ImageIcon("check.png"); // This adds a check image
       // g2.drawImage(ico.getImage(), x, y - 3, this);
      public static void main(String s[]) {
        RectangleDemo2D demo = new RectangleDemo2D();
        demo.setBackground(Color.white);
        demo.pack();
        demo.setSize(new Dimension(300, 300));
        demo.show();
    }

    Hi,
    You can check out a similar thread where the poster has opted to use imageicons instead of shapes. That thread is here.
    http://forums.java.net/jive/thread.jspa?threadID=15074&tstart=0.
    As for creating different color shapes for different cells of the jtable, it is definitely possible once you have a custom renderer for your jtable. Just read up on how to create custom table cell renderer.
    cheers,
    vidyut
    http://www.bonanzasoft.com

  • Can you open a calculator and add or subtract within a cell?

    I am trying to see if there is a way to use the number pad as a calculator and add figures then enter into a cell for further use.  I want to eliminate the use of my adding machine if possible and just use my keyboard to do my additions and enter directly into my spreadsheet.  Is there a function that opens a calcultor for a cell, do the additions on the keypad, hit enter and have the total put into the cell?

    AG,
    Are you aware that OSX has, built-in, Calculator.app?
    With Calculator.app, you can make your calculations, Command-C to copy the result to the Clipboard, switch to Numbers and Command-V into the target cell.
    Jerry

  • Can you take a photograph and add a caption and then email for business use?

    I want to be able to utilize my ipad in the followin manner:
    take a photo of a construction condition, write a caption under the photo or several photos adn then email to office so they can format and send out to contractor.
    I also want to create a report template to insert on my ipad and write my info on the report to submit to office with photos.... Is this possible?

    With the pages app, my experience has been you have to take the photo, close out of camera, open pages, create a new blank document, go to tools, select the photo(s), copy them to the document, size it appropriately and then work your text around the outside of the photo box.  Its good if you want to add arrows and stuff pointing to an object in the photo but frankly it's time consuming and actually kind of a hassle.
          I want to be able to snap a pic and pop a caption on it RIGHT THEN, ....without closing and opening any other apps.  The key for me is quick and easy.  I take allot of job site photos that need descriptions on them. Any input on that ?

  • Draw a symbol and add text in UIImageView.

    I want to Draw a symbol and add text in UIImageView. when move it should move together. When it would get opened next time, it should be editable. pls needful for me

    Hi,
    You can check out a similar thread where the poster has opted to use imageicons instead of shapes. That thread is here.
    http://forums.java.net/jive/thread.jspa?threadID=15074&tstart=0.
    As for creating different color shapes for different cells of the jtable, it is definitely possible once you have a custom renderer for your jtable. Just read up on how to create custom table cell renderer.
    cheers,
    vidyut
    http://www.bonanzasoft.com

  • I would like to find a program to draw lines, shapes and words for my iMac.

    If anyone can help me find a program or App for my iMac that lets me draw lines, shapes and letters.
         Thank You
         Sandy

    http://www.sketchup.com/
    Try this it is a free download and it is a great program. I almost feel guilty not paying anything:)

  • I have a new iPad with wifi. When I send messages I can see my sons and my husbands but not my phone number.  We all have an iPad and all use the same apple ID as iPad the bill.  How can I remove their numbers and add mine?

    I have a new iPad with wifi. When I send messages I can see my sons and my husbands but not my phone number.  We all have an iPad and all use the same apple ID as iPad the bill.  How can I remove their numbers and add mine?

    Add another e-mail account to your messages, so people could reach you on that e-mail from messages. As soon as you are online (if you have wifi only iPad) you are able to send and receive messages. i.e. your son can send you a messages from his iPhone addressing it to your (that additional) e-mail address.

  • How to draw a shape and have x,y axis

    i have to draw a shape and have x.y axis i want use java but i have no ideas could you help me ?thank you !

    i have to draw a shape and have x.y axis i want use java but i have no ideas could you help me ?thank you !

  • Can you change the shape of a box in Visio?

    Can you change the shape of a box in Visio? I want to change a process box to a data box without loosing all of my data fields. Silly me I just want to be able to highlight the box right click and change the shape to a parallelogram.

    shape swapping is a standard feature in v2013. In v2010 you can use a 3rd party utility
    http://www.sandrila.co.uk/visio-utilities/
    hth,
    al
    Al Edlund Visio MVP

  • IWeb - Can you make a blog? Can you make a title and let people respond?

    Can you make a title and let people respond?
    For Example:
    'Do you like my new Book?'
    Comment:-
    ???

    Yes. You can add forms to you page which send you emails with the information the visitor put in the form. There are two types, one that you create with Form Action Code that you create and put in an html snippet, Form Action comment form, and more sophisticated forms that are created at a 3rd party site and embedded into a page with an HTML snippet and iFrame code as in this demo page: Embedding Forms & Encoding Email Addresses. With the second method you can set the form to any color combination you'd like. Another example of the Wufoo type is at the bottom of this demo page: QT Movie w/o Quicktime.
    OT

  • Can I use my photos and add them or substitute them for wallpaper.

    Can I use my photos and add them or substitute them for wallpaper on the Ipod Touch?  If so, what procedure is suggested to add the photos and use them.
    Thank you for your help.

    Here are the instructions form the Users Guide:
    Adding Wallpaper
    You can set an image or photo as wallpaper for the Lock screen. You can also set
    wallpaper for your Home screen. You can choose an image that came with iPod touch,
    or a photo synced to iPod touch from your computer.
    Set wallpaper (iPod touch 3rd generation or later):
    1 In Settings, choose Wallpaper, tap the image of the Lock and Home screens, then tap
    Wallpaper or an album.
    2 Tap to choose an image or photo. If you choose a photo, drag to position it and pinch
    to zoom in or out, until it looks the way you want.
    3 Tap Set, then choose whether you want to use the photo as wallpaper for your Lock
    Screen, Home screen, or both.
    SInce you said you have iOS 4.3.2, you must and a 3 or 4G ipod.

  • Can you move files back and forth between an iPad and a PC using iTunes?

    If I read this article correctly, http://support.apple.com/kb/ht4094 I should be able to connect my iPad to my PC, fire up iTunes and then on the Apps tab in iTunes I should be able to click on an app, Pages for example and then just drag files onto the Pages Documents column from a Windows Explorer window.
    This is great.  I was hoping to use DropBox but it is such a hassle I don't know why people are so thrilled with DropBox on iPad.  If I can just move files back and forth using iTunes that should be fairly easy.  I wish there was a way to just upload my files to iCloud from my PC but the iCloud control panel app for Windows only seems to connect Outlook, Photostream and Bookmarks. I want to be able to just carry my iPad and not have to deal with a computer. 
    I thought that they said that you didn't need to have a computer to have an iPad.  I guess if you have a computer and then GET an iPad its a different story, unless you have a Mac of course.
    Anyway my question is: can you move files back and forth between a PC and an iPad using just iTunes?

    I still need to do some trial and error testing with DropBox and my iPad.  But can I link my iPad to my DropBox account so that I can always see the files on DropBox when I open Pages on my iPad?  I just want one place to store my documents, and iCloud doesn't seem to be up to the task when it comes to opening a fil;e, editing it and then saving it back to iCloud.  I just want a networked storage location that works like a networked drive on my LAN.
    I realize that hollywood and the music industry are up in arms about file sharing on the Cloud which is why so many things are made more difficult than they need to be. 

  • How many photos can you load into Organizer and Editor

    How many photos can you load into Organizer and Editor at one time.  I receive the error message, "Unable to Import Files", which says "You exceeded number of files that can be selecteed and imported at once...."  What is the number?  Secondly is there a way around this for either the Organizer or Editor to work on thousands of photos at the same time?
    Thanks

    I have never heard of this particular limit before.
    Please understand, this appears to be the limit you can import into the Organizer at one time -- you can have as many photos as you want in the Organizer; but apparently you have to import in batches rather than all at once.
    I don't think it applies to the editor; and I can't imagine wanting to have more then a few files in the editor at any one time ... even if you could open 2000 photos in the editor at once, what sense would that make?

  • Can you remove a date and time stamp off a photo that has already been taken?

    Can you remove a date and time stamp off a photo that has already been taken?

    only with Photoshop or similar software that offer some clone/heal feature.
    Weekend Travelers Blog | Eastern Sierra Fall Color Guide

  • How Can You Change the Look and Feel of Charts in OBIEE 11g

    How Can You Change the Look and Feel of Charts in OBIEE 11g?
    Edited by: user11973122 on Jul 18, 2012 12:13 AM

    Check these files
    OFM_HOME\Oracle_BI1\bifoundation\web\msgdb\s_blafp\viewui\chart\dvt-graph-skin.xml
    OFM_HOME\Oracle_BI1\bifoundation\web\msgdb\views\dvtchart\obips.dvtchart.xml
    OFM_HOME\Oracle_BI1\bifoundation\web\display\chartfontmapping.xml
    Pls mark correct or helpful if helps

Maybe you are looking for

  • IPad app AiO Remote

    I scanned document with IPad app AiO Remote and HP printer. App created .pdf file 306 Mb in documents folder on my iPad Air iOS 8 When I tried to open document in AiO Remote, I receive error: Not enough memory to complete operation. And then .pdf pre

  • ?how to i fix my ipod that is disabled

    i cant get itunes to update and it wont  let me restore my ipod! i dont know what to do!

  • What other hp print drivers will work with the officejet pro 8600

    I have an Officejet Pro 8600 and like many others here, I am having a problem printing a custom size envelope (6x9). I did find that I can use the drivers for a deskjet 450 and setup  my 8600 using those drivers. However, the 450 6x9 does not have a

  • Logo niet zichtbaar in pdf

    als ik een standaardbrief met logo wil opslaan of printen is het logo in dat document niet te zien terwijl andere die de brief ontvangen wel het logo in de brief zien en kunnen printen. welke instelling staat bij mij verkeerd

  • Speakers won't mute with Headpho

    This is for an Audigy 4-pro. When the headphones are plugged in, the speakers still function. I've turned on the option to mute the speakers when the headphones are plugged in. That doesn't seem to make any difference. Am I doing something wrong? Sho