Popup memory removement

Hello,
we have to use many popup-windows with flex (flex 2.0). so we
create the flex-popupwindows with the addPopup and remove the popup
windows with, removepopup function.
we have now the following problem.
on every popup event the memory usage icrease (this is ok)
but on removing the popup, we dectect a "memory-leak".
if use the function a lot of time (creating 10 or more modal
popupwindows with an menubar) -- the memoryusage is very high, too
high. i have seen, some other users have the same or similar
problem with memorymanagement. I searched in some forums and
searchmachines , i get allways the same answert that the garbage
collector of flex and / or actionscript 3.0 (flash 9.0 player) is
great an removed obcject without references. we remove, befor
closing the popup all Childs... set the variable to null etc.. no
effect.
Our customers cannot work with this memory-leak, is there an
solution?
Btw: we have a memory-problemt with the menubar too, on
moving the mouse-cursor over the menubar the memoryusage is
increasing too.
Thanks for helping
kuschelino

Hey guys,
Do you have a code example for me please?
I am using the popup for a piece of code that takes some time
to run.. and when its done running i remove the popup. But when i
run the script again, my popup doesn't appear. :(
Here the code i use:
private var pop2:Canvaspopup;
public function imageSelected(event:Event):void // i cum
here on the select event from a file dialog box.
trace(pop2);
if(pop2!=null)
pop2=null;
pop2=new Canvaspopup();
pop2 =
Canvaspopup(PopUpManager.createPopUp(Application.application as
Sprite,Canvaspopup,true));
PopUpManager.centerPopUp(pop2);
// here i do some image stuff like use a loader for the
selected image
public function handleImageComplete(event:Event):void //when
the loader is complete i cum here
// do some image resizing and saving
PopUpManager.removePopUp(pop2);
pop2=null;
}

Similar Messages

  • Want to remove popup blockers with firefox, I don't want to specify what site

    work with internet on virtual call center. I need all popup blockers removed. my mac has removed popup blockers. but for a specific client i have to use fire fox. please help

    To download/install an app directly to the iPod you need available storage equal to about three times the file download size. Syncing the app to the iPod requires a lot less. Thus you either have to free up more storage or sync the app from your computer.

  • Upgrading Memory Modules: HP Envy Rove 20 Mobile All-in-One PC

    ** Be aware that performing this process to an In-Warranty device could effect warranty coverage.
    Memory Max
     16GB DDR3 SDRAM (2 SO-DIMMs)
    CAUTION: Observe all precautions when removing and replacing components.
    To prevent damage to the unit, protect data, and avoid personal injury, review and follow these precautions.
    Before you begin
    If the unit contains heated components, wait until the components have cooled off before proceeding. Refer to the service manual for details on how long each component requires to adequately cool off.
    Put on your electrostatic discharge (ESD) wrist or shoe strap to avoid damaging any circuitry.
    Place an ESD mat on a suitably grounded surface, and then place the unit on the mat.
    Remove any devices from the unit being serviced, such as diskettes, tape cartridges, or CD-ROMs.
    Power off the unit and any peripheral devices that are connected to it.
    NOTE: Replacing a hot-plug device does not require powering down the unit.
    Disconnect the power cord from the electrical outlet and then from the unit. When a unit is plugged into an AC power source, voltage is always applied to the unit. You must therefore disconnect the power cord from the power source before opening the unit.
    Disconnect all peripheral device cables from the unit.
    Static electricity
    Static electricity can damage electrical components. Before removing or replacing a component, observe the following precautions to prevent damage to electric components and accessories:
    Remove all ESD-generating materials from your work area.
    To avoid hand contact, transport and store all electrostatic parts and assemblies in conductive or approved ESD packaging such as ESD tubes, bags, or boxes.
    Keep electrostatic-sensitive parts in their containers until they arrive at static-free stations. Before removing items from their containers, place the containers on a grounded surface.
    Do not take the new component out of its ESD package or handle any component before connecting your ESD wrist or shoe strap to a suitably grounded surface.
    Always use an ESD-protected work station when servicing the unit. If an ESD work station is not available, ground yourself to discharge body static by touching the metal chassis of the unit you are servicing.
    Avoid contact with pins, leads, or circuitry.
    Use the ESD package provided with the new part to return the old part.
    Disassembly
    Ensure that you take the following precautions when disassembling a unit:
    Label each cable as you remove it, noting its position and routing. This will make replacing the cables much easier and will ensure that the cables are rerouted properly.
    Keep all screws with the component removed, if applicable. The screws used in each component can be of different thread sizes and lengths. Using the wrong screw in a component could damage the unit.
    If the unit contains light-sensitive components such as toner cartridges, store the component in its original packaging or in a dark location to avoid damage.
    STEP 1: Removing the bottom cover
    NOTE: The battery cannot be disconnected until the back cover is removed. Use care not to power on the unit during handling.
    With the unit flat, back cover facing up, close the stand.
    Remove the media card or media blank from the media slot in the center of the bottom cover.
    Using a non-marring tool, carefully pry out two rubber screw covers.
    Loosen completely, the two captive P1 Phillips-head screws that secure the bottom cover to the back cover.
    Starting along the bottom, carefully pry off the bottom cover and pull it away from the unit to remove.
    STEP 2: Remove the back cover
    Remove the five 6 mm P1 Phillips-head screws that secure the back cover to the unit.
    Starting along the sides, carefully pry off the back cover and pull it up and off of the unit to remove.
    STEP 3: Memory Removal
    Before you begin: Disconnect the battery cable from the system board.
    Push both arms outward simultaneously to release the memory board to the spring tension position.
    CAUTION: When handling a memory board, use care to prevent touching the memory chips on the board. Touching the memory chips could damage or destroy the memory.
    Grasp the memory board by the edges and pull gently to remove it.
    Place the memory board in a static dissipative bag.
    STEP 4: Memory replacement or installation
    Grasp the memory board by the edges and remove it from the static dissipative bag.
    Align the notch in the memory board with the key in the empty board receptacle on the system board.
    At an angle, gently insert the memory board into the slot on the system board.
    CAUTION: When handling a memory board, use care to prevent touching the memory chips on the board. Touching the memory chips could damage or destroy the memory. 
    Press the memory board down to latch the arms. 
    NOTE: Be sure to reconnect the battery cable to the system board before completing reassembly of the unit.
    STEP 5: Back cover replacement
    Align and press the back cover into position until it snaps into place.
    Replace the five 6 mm P1 Phillips-head screws to secure the back cover to the unit.
    STEP 6: Bottom cover replacement
    Align the bottom cover tabs with the slots in the back cover.
    Carefully press the bottom cover into position and snap it into place.
    Tighten the two captive P1 Phillips-head screws to secure the bottom cover to the back cover.
    Replace the two rubber screw covers.
    Replace the media card or media blank removed earlier.
    Press the stand release button to have the stand pop up to support the unit when it is upright.
    ** Remember to keep the original RAM module(s) for potential future troubleshooting needs.  If you ever have to send the unit in for repair it will have to have these original module(s) in place.
    Hope this helps,
    Jason
    -------------How do I give Kudos? | How do I mark a post as Solved? --------------------------------------------------------
    I am not an HP employee.

    Hi Jason
    Can you buy replacement backs for the rove
    Thanks

  • Mac Pro 2.66, New Memory & Repeated KPs

    Hi all
    I've had 4GB of RAM in my Mac Pro for some time now, in the following config
    Riser A - 2x1GB, EMPTY
    Riser B - 2x512MB, 2x512MB
    I recently upgraded to another 2x1GB, which I put in the empty slots of Riser A... I did this back in February or so - purchased from OWC... as soon as I installed them, my computer ended up KPing almost immediately and when I rebooted, the MP wouldn't boot anymore off the main drive...
    So I returned those modules and got a replacement pair, which I finally got around to installing this past week... the KPs started almost immediately and all seem to be related...
    Here's the latest one
    Sat Apr 4 08:55:31 2009
    panic(cpu 2 caller 0x001A9C68): Kernel trap at 0x00194178, type 14=page fault, registers:
    CR0: 0x80010033, CR2: 0x00000308, CR3: 0x0149c000, CR4: 0x00000660
    EAX: 0x240c8900, EBX: 0x00269190, ECX: 0x00000b80, EDX: 0x00000304
    CR2: 0x00000308, EBP: 0x7f44ba28, ESI: 0x08269190, EDI: 0x00000fff
    EFL: 0x00010202, EIP: 0x00194178, CS: 0x00000008, DS: 0x0d210010
    Error code: 0x00000002
    Backtrace (CPU 2), Frame : Return Address (4 potential args on stack)
    0x7f44b7a8 : 0x12b4f3 (0x45b13c 0x7f44b7dc 0x1335e4 0x0)
    0x7f44b7f8 : 0x1a9c68 (0x464700 0x194178 0xe 0x463eb0)
    0x7f44b8d8 : 0x1a038d (0x7f44b8f0 0x0 0x7f44ba28 0x194178)
    0x7f44b8e8 : 0x194178 (0xe 0xa610048 0x7f440010 0x1a0010)
    0x7f44ba28 : 0x196491 (0x9b820e8 0x2c20a000 0x0 0x782f5050)
    0x7f44ba88 : 0x16a4f0 (0x9b820e8 0x2c20a000 0x0 0x2c217000)
    0x7f44bba8 : 0x16e804 (0x2c217000 0x0 0x8 0x1e1a744)
    0x7f44bd18 : 0x172106 (0x1e1a26c 0x7f44bdb0 0xd000 0x0)
    0x7f44bdd8 : 0x376176 (0x1e1a26c 0x7f44bf50 0xd000 0x0)
    0x7f44bf78 : 0x3df460 (0x9ef4a80 0xa5d96c0 0xa5d9704 0x0)
    0x7f44bfc8 : 0x1a0887 (0xa351040 0x0 0x1a30b5 0xa351040)
    No mapping exists for frame pointer
    Backtrace terminated-invalid frame pointer 0xbfffdb28
    BSD process name corresponding to current thread: OmniWeb
    Mac OS version:
    9G55
    Kernel version:
    Darwin Kernel Version 9.6.0: Mon Nov 24 17:37:00 PST 2008; root:xnu-1228.9.59~1/RELEASE_I386
    System model name: MacPro1,1 (Mac-F4208DC8)

    I suppose you want some ideas on why or what to do?
    First try with JUST the new 2 x 1GB. Riser A 1:2 with all the other memory removed.
    Second, install the "original" 2 x 1GB in Riser B 1:2 (that insures the ideal 4-channel config also)
    Third, the 4 x 512MB should be either left out, or slots 3:4 on each Riser.
    Fourth, insist on OWC TechWorks. And 2 x 2GB costs ~$30 more than 2 x 1GB.
    Have there ever been parity errors? System Profile -> Memory.
    Those can result in writing dirty data out to disk and leaving the system unstable.
    Once you do get it back working you may want to do a fresh install or restore, depending.
    Lastly, run Apple Hardware Test when you install new RAM.

  • Problem with Popups

    Since downloading the adobe flash player update (install_flashplayer11x32au_mssd_aaa_aih.exe) today I've been getting popups, usually after clicking an unrelated link or moving the cursor. How do you stop these from popping up?
    Popup example: [removed]

    I don't know what you mean by "Popup example"; your link leads to a site that sells Apple products.  I have removed that link from your post, as it looks like spam to me.

  • Low memory startup disk

    Computer very slow or freezes when running 2 programs at the same time. popup: memory low on startup disk. what can i do????? please!!!!

    Delete some of the Junk files you have on the hard drive.

  • PopUp Issue?

    Hi All
                       I have a scenario where i am using one button and when i click on that button it wil populate one popup window ... and that popup window contains title window ...  when i click on the button the popup created second time and when i click on third time the popup created third time.. so presently i have three popup created in my application... i dont want this,,, type of creation... if  once pop up created it will not allow to create the second popup .... i want it to throw an error where already popup created u cannot create second pop up ..
                       how many time i am cliking  on button it must open only one popup ... i dont want multiple popups created when i click button multiple times ....   i think u got my question .. please give me suggestions and code to achieve this issue......

    @flex4,
    Try to remove the focus from your button whenever you click the button once and your popup gets opened and try to set the Focus now on the PopUp by removing the Focus on Button. So that it will not be possible for you again to click the button once when the PopUp is already opened.
    Thanks,
    Bhasker

  • SAP installtion stopped - error cant create shared memory

    Dear All,
    Greetings!
    We are trying to install SAP ECC 6.0 IDES system on Windows 2003 x64 Server and DB2 9.1, during the process of installation - in the step of Start Instance. The sapinst Gives Up! the process since the enqueue server is found in stopped state when the instance tries to start up.
    I found the below given error message from the Developer Trace files of the enqueue server.
    [Thr 1384] Sat May 09 18:21:13 2009
    [Thr 1384] *** ERROR => ShmDelete: Invalid shared memory Key=34. [shmnt.c      719]
    [Thr 1384] *** ERROR => ShmCleanup: ShmDelete failed for Key:34. [shmnt.c      793]
    [Thr 1384] initialize_global: enqueue server without replication
    [Thr 1384] Enqueue: EnqMemStartupAction Utc=1241873473
    [Thr 1384] *** ERROR => [CreateOsShm] CreateFileMapping(37,65 KB) failed with Err=5
                  ERROR_ACCESS_DENIED: Access is denied.  [shmnt.c      2174]
    [Thr 1384] *** ERROR => ShmCreate: Create (37,67072,1) failed [shmnt.c      506]
    To note - we had a virus attack on the server recently and an Anti-Virus tool was used to clean the server, after that I found most of the SAP folders in Read-Only mode.
    I suspect any causes of the same for the above mentioned ACCESS_DENIED error. Currently I have allocated 28GB of swap size, but the SAP instance is not able to create a shared memory from the same I hope.
    Num
    Pagefile
    Min.Size
    Max.Size
    Avail.Max
    Curr.Size
    1
    c:\pagefile.sys
    8192000 K
    8192000 K
    8192000 K
    8192000 K
    2
    e:\pagefile.sys
    10485760 K
    10485760 K
    10485760 K
    10485760 K
    3
    f:\pagefile.sys
    10485760 K
    10485760 K
    10485760 K
    10485760 K
    Please help me with your suggestions for the workaround,
    - How will I be able to enable the swap size of the server to be used by the SAP instance?
    - Is this the effect of the anti-virus or an aspect in windows server to change the folders and files to read-only after a virus attack?
    I have tried the possibilities of adding more shared memory, removing the shared memory and restarting the OS and assigning back the same, but these dint prove useful.
    Kindly help me with your suggestions.
    Thank you
    Regards,
    Vineeth

    Hi,
    I would suggest you to go to run > services.msc
    now try to manually stop / start the SAP<SID>_<nr> services. are you able to start it properly? If you get error here, that means SAP services not able to start as it has permission problem.
    login with <sid>adm & reregister the service by running sapstartsrv.exe in <drive>:\usr\sap\SID\sys\exe. after you give the parameters and press ok, wait for sometime for the 'success' message.
    once its done, then start sap in MMC.
    another thread talks about similar kind of problem.
    Shared Memory Ceation error when we install NW04S Java Stack.
    Regards,
    Debasis.

  • Nokia N73 Phone memory full.

    Hi,
    I am using the N73. When ever i receive message or try to save contacts it shows a message -"Memory Full please delete some data". I deleted all data from Memory card, but when i check Phone Memory it shows 44MB in use. How do i clean my Phone memory?
    Please help.

    memory maybe distributed between different categories that you may not of, not only user files. first of all check the memory distribution by checking the : menu > tools > memory manager > options > memory details.
    if you have alot of messages stored on the phone memory , try to delete some, especially the ones that have attachments or you have recieved through bluetooth.
    if you have applications or themes installed on the phone memory , remove these and reinstall on the memory card.
    Fear not those who argue but those who dodge

  • Best Way to "Unload" or remove assets in AS3

    I read G. Skinner's article on removing resources in AS3 and
    garbage collection (
    click
    for relevant section of article) and I was a bit astounded.
    I understand that one must be careful to manage memory --
    remove listeners, add weak references, etc -- and clean up when you
    go. I.e. I have a basic understanding of how to make assets, once
    off the display list, eligible for garbage collection. But let's
    say you load a SWF and it's running -- and particularly if this is
    not your own SWF, e.g. in a gallery setting -- is there a way to
    get rid of it? What if you load in a SWF, and it uses a lot
    of CPU -- and you want it
    gone when it's gone? Is there any way to really get rid of
    things in AS3, or do you just make them eligible for GC and hope
    for the best? This seems a very bad thing -- particularly, if, say,
    you're loading in content over which you don't have control (as in
    that proverbial gallery).

    no.
    no.
    yes.
    and yes.
    so, just say no to loading assets over which you have no
    control.

  • Storing Shape Information IN a Table-Like Structure

    Hi All,
    I have a Program which displays shape (rectangle,oval,etc) in the panel which is enclosed in a frame.. shape can be dragged and dropped anywhere on panel... also one can delete shape... Now I Want To Store All The Exiting Shapes (as they are added on panel ) in some structure say a table, and alongwith it, i also want to store additional information about shape, say its location currently on panel, its present color, etc so that i can use this information later in the program... how do i do implement this ?? Plz Help Me.. It would be great if you include the changes in the source code itself...
    thanks
    Here is the source code :
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.util.ArrayList;
    public class ShapeDrawFrame extends javax.swing.JFrame {
        JCheckBoxMenuItem addLargeShapes;    
       JCheckBoxMenuItem addBorderedShapes; 
       JRadioButtonMenuItem red, green, blue,      
                            cyan, magenta, yellow, 
                            black, gray, white;  
       JPopupMenu popup;
        public ShapeDrawFrame() {
            super("Shape Draw");
            //initComponents();        
          ShapeCanvas canvas = new ShapeCanvas();
          setContentPane(canvas);
          /* Create the menu bar and the menus */
          JMenuBar menubar = new JMenuBar();
          setJMenuBar(menubar);
          JMenu addShapeMenu = new JMenu("Add");
          addShapeMenu.setMnemonic('A');
          menubar.add(addShapeMenu);
          JMenu shapeColorMenu = new JMenu("Color");
          shapeColorMenu.setMnemonic('C');
          menubar.add(shapeColorMenu);
          JMenu optionsMenu = new JMenu("Options");
          optionsMenu.setMnemonic('O');
          menubar.add(optionsMenu);
          /* Create menu items for adding shapes to the canvas,
             and add them to the "Add" menu.  The canvas serves
             as ActionListener for these menu items. */     
          JMenuItem rect = new JMenuItem("Rectangle");
          rect.setAccelerator( KeyStroke.getKeyStroke("ctrl R") );
          addShapeMenu.add(rect);
          rect.addActionListener(canvas);
          JMenuItem oval = new JMenuItem("Oval");
          oval.setAccelerator( KeyStroke.getKeyStroke("ctrl O") );
          addShapeMenu.add(oval);
          oval.addActionListener(canvas);
          JMenuItem roundrect = new JMenuItem("Round Rect");
          roundrect.setAccelerator( KeyStroke.getKeyStroke("ctrl D") );
          addShapeMenu.add(roundrect);
          roundrect.addActionListener(canvas);
          /* Create the JRadioButtonMenuItems that control the color
             of a newly added shape, and add them to the "Color"
             menu.  There is no ActionListener for these menu items.
             The canvas checks for the currently selected color when
             it adds a shape to the canvas.  A ButtonGroup is used
             to make sure that only one color is selected. */
          ButtonGroup colorGroup = new ButtonGroup();
          red = new JRadioButtonMenuItem("Red");
          shapeColorMenu.add(red);
          colorGroup.add(red);
          red.setSelected(true);
          green = new JRadioButtonMenuItem("Green");
          shapeColorMenu.add(green);
          colorGroup.add(green);
          blue = new JRadioButtonMenuItem("Blue");
          shapeColorMenu.add(blue);
          colorGroup.add(blue);
          cyan = new JRadioButtonMenuItem("Cyan");
          shapeColorMenu.add(cyan);
          colorGroup.add(cyan);
          magenta = new JRadioButtonMenuItem("Magenta");
          shapeColorMenu.add(magenta);
          colorGroup.add(magenta);
          yellow = new JRadioButtonMenuItem("Yellow");
          shapeColorMenu.add(yellow);
          colorGroup.add(yellow);
          black = new JRadioButtonMenuItem("Black");
          shapeColorMenu.add(black);
          colorGroup.add(black);
          gray = new JRadioButtonMenuItem("Gray");
          shapeColorMenu.add(gray);
          colorGroup.add(gray);
          white = new JRadioButtonMenuItem("White");
          shapeColorMenu.add(white);
          colorGroup.add(white);
          /* Create the "Clear" menu item, and add it to the
             "Options" menu.  The canvas will listen for events
             from this menu item. */
          JMenuItem clear = new JMenuItem("Clear");
          clear.setAccelerator( KeyStroke.getKeyStroke("ctrl C") );
          clear.addActionListener(canvas);
          optionsMenu.add(clear);
          optionsMenu.addSeparator();  // Add a separating line to the menu.
          /* Create the JCheckBoxMenuItems and add them to the Options
             menu.  There is no ActionListener for these items because
             the canvas class will check their state when it adds a
             new shape. */
          addLargeShapes = new JCheckBoxMenuItem("Add Large Shapes");
          addLargeShapes.setSelected(true);
          optionsMenu.add(addLargeShapes);
          addBorderedShapes = new JCheckBoxMenuItem("Add Shapes with Border");
          addBorderedShapes.setSelected(true);
          optionsMenu.add(addBorderedShapes);
          optionsMenu.addSeparator();
          /* Create a menu for background colors, and add it to the
             "Options" menu.  It will show up as a hierarchical sub-menu. */
          JMenu background = new JMenu("Background Color");
          optionsMenu.add(background);
          background.add("Red").addActionListener(canvas);
          background.add("Green").addActionListener(canvas);
          background.add("Blue").addActionListener(canvas);
          background.add("Cyan").addActionListener(canvas);
          background.add("Magenta").addActionListener(canvas);
          background.add("Yellow").addActionListener(canvas);
          background.add("Black").addActionListener(canvas);
          background.add("Gray").addActionListener(canvas);
          background.add("White").addActionListener(canvas);
          /* Create the pop-up menu and add commands for editing a
             shape.  This menu is not used until the user performs
             the pop-up trigger mouse gesture on a shape. */
          popup = new JPopupMenu();
          popup.add("Delete Shape").addActionListener(canvas);
          popup.add("Bring to Front").addActionListener(canvas);
          popup.addSeparator();
          popup.add("Make Large").addActionListener(canvas);
          popup.add("Make Small").addActionListener(canvas);
          popup.addSeparator();
          popup.add("Add Black Border").addActionListener(canvas);
          popup.add("Remove Black Border").addActionListener(canvas);
          popup.addSeparator();
          popup.add("Set Color to Red").addActionListener(canvas);
          popup.add("Set Color to Green").addActionListener(canvas);
          popup.add("Set Color to Blue").addActionListener(canvas);
          popup.add("Set Color to Cyan").addActionListener(canvas);
          popup.add("Set Color to Magenta").addActionListener(canvas);
          popup.add("Set Color to Yellow").addActionListener(canvas);
          popup.add("Set Color to Black").addActionListener(canvas);
          popup.add("Set Color to Gray").addActionListener(canvas);
          popup.add("Set Color to White").addActionListener(canvas);
          /* Set the "DefaultCloseOperation" for the frame.  This determines
             what happens when the user clicks the close box of the frame.
             It is set here so that System.exit() will be called to end
             the program when the user closes the window. */
          setDefaultCloseOperation(EXIT_ON_CLOSE);
          /* Set the size and location of the frame, and make it visible. */
          setLocation(20,50);
          setSize(550,420);
          show();       
       class ShapeCanvas extends JPanel
                         implements ActionListener, MouseListener, MouseMotionListener {
             // This class represents a "canvas" that can display colored shapes and
             // let the user drag them around.  It uses an off-screen images to
             // make the dragging look as smooth as possible.
          ArrayList shapes = new ArrayList();
               // holds a list of the shapes that are displayed on the canvas
          ShapeCanvas() {
               // Constructor: set background color to white
               // set up listeners to respond to mouse actions
             setBackground(Color.white);
             addMouseListener(this);
             addMouseMotionListener(this);
          public void paintComponent(Graphics g) {
               // In the paint method, all the shapes in ArrayList are
               // copied onto the canvas.
             super.paintComponent(g);  // First, fill with background color.
             int top = shapes.size();
             for (int i = 0; i < top; i++) {
                Shape s = (Shape)shapes.get(i);
                s.draw(g);
          public void actionPerformed(ActionEvent evt) {
                 // Called to respond to action events from the
                 // menus or pop-up menu.
             String command = evt.getActionCommand();
             if (command.equals("Clear")) {
                shapes.clear(); // Remove all items from the ArrayList
                repaint();
             else if (command.equals("Rectangle"))
                addShape(new RectShape());
             else if (command.equals("Oval"))
                addShape(new OvalShape());
             else if (command.equals("Round Rect"))
                addShape(new RoundRectShape());
             else if (command.equals("Red"))
                setBackground(Color.red);
             else if (command.equals("Green"))
                setBackground(Color.green);
             else if (command.equals("Blue"))
                setBackground(Color.blue);
             else if (command.equals("Cyan"))
                setBackground(Color.cyan);
             else if (command.equals("Magenta"))
                setBackground(Color.magenta);
             else if (command.equals("Yellow"))
                setBackground(Color.yellow);
             else if (command.equals("Black"))
                setBackground(Color.black);
             else if (command.equals("Gray"))
                setBackground(Color.gray);
             else if (command.equals("White"))
                setBackground(Color.white);
             else if (clickedShape != null) {
                    // Process a command from the pop-up menu.
                if (command.equals("Delete Shape"))
                   shapes.remove(clickedShape);
                else if (command.equals("Bring to Front")) {
                   shapes.remove(clickedShape);
                   shapes.add(clickedShape); 
                else if (command.equals("Make Large"))
                   clickedShape.setSize(100,60);
                else if (command.equals("Make Small"))
                   clickedShape.setSize(50,30);
                else if (command.equals("Add Black Border"))
                   clickedShape.setDrawOutline(true);
                else if (command.equals("Remove Black Border"))
                   clickedShape.setDrawOutline(false);
                else if (command.equals("Set Color to Red"))
                   clickedShape.setColor(Color.red);
                else if (command.equals("Set Color to Green"))
                   clickedShape.setColor(Color.green);
                else if (command.equals("Set Color to Blue"))
                   clickedShape.setColor(Color.blue);
                else if (command.equals("Set Color to Cyan"))
                   clickedShape.setColor(Color.cyan);
                else if (command.equals("Set Color to Magenta"))
                   clickedShape.setColor(Color.magenta);
                else if (command.equals("Set Color to Yellow"))
                   clickedShape.setColor(Color.yellow);
                else if (command.equals("Set Color to Black"))
                   clickedShape.setColor(Color.black);
                else if (command.equals("Set Color to Gray"))
                   clickedShape.setColor(Color.gray);
                else if (command.equals("Set Color to White"))
                   clickedShape.setColor(Color.white);
                repaint();
          } // end actionPerformed()
          void addShape(Shape shape) {
                 // Add the shape to the canvas, and set its size, color
                 // and whether or not it should have a black border.  These
                 // properties are determined by looking at the states of
                 // various menu items.  The shape is added at the top-left
                 // corner of the canvas.
             if (red.isSelected())
                shape.setColor(Color.red);
             else if (blue.isSelected())
                shape.setColor(Color.blue);
             else if (green.isSelected())
                shape.setColor(Color.green);
             else if (cyan.isSelected())
                shape.setColor(Color.cyan);
             else if (magenta.isSelected())
                shape.setColor(Color.magenta);
             else if (yellow.isSelected())
                shape.setColor(Color.yellow);
             else if (black.isSelected())
                shape.setColor(Color.black);
             else if (white.isSelected())
                shape.setColor(Color.white);
             else
                shape.setColor(Color.gray);
             shape.setDrawOutline( addBorderedShapes.isSelected() );
             if (addLargeShapes.isSelected())
                shape.reshape(3,3,100,60);
             else
                shape.reshape(3,3,50,30);
             shapes.add(shape);
             repaint();
          } // end addShape()
          // -------------------- This rest of this class implements dragging ----------------------
          Shape clickedShape = null;  // This is the shape that the user clicks on.
                                      // It becomes the draggedShape is the user is
                                      // dragging, unless the user is invoking a
                                      // pop-up menu.  This variable is used in
                                      // actionPerformed() when a command from the
                                      // pop-up menu is processed.
          Shape draggedShape = null;  // This is null unless a shape is being dragged.
                                      // A non-null value is used as a signal that dragging
                                      // is in progress, as well as indicating which shape
                                      // is being dragged.
          int prevDragX;  // During dragging, these record the x and y coordinates of the
          int prevDragY;  //    previous position of the mouse.
          public void mousePressed(MouseEvent evt) {
                // User has pressed the mouse.  Find the shape that the user has clicked on, if
                // any.  If there is no shape at the position when the mouse was clicked, then
                // ignore this event.  If there is then one of three things will happen:
                // If the event is a pop-up trigger, then the pop-up menu is displayed, and
                // the user can select from the pop-up menu to edit the shape.  If the user was
                // holding down the shift key, then bring the clicked shape to the front, in
                // front of all the other shapes.  Otherwise, start dragging the shape.
             if (draggedShape != null) {
                  // A drag operation is already in progress, so ignore this click.
                  // This might happen if the user clicks a second mouse button before
                  // releasing the first one(?).
                return;
             int x = evt.getX();  // x-coordinate of point where mouse was clicked
             int y = evt.getY();  // y-coordinate of point
             clickedShape = null;  // This will be set to the clicked shape, if any.
             for ( int i = shapes.size() - 1; i >= 0; i-- ) { 
                    // Check shapes from front to back.
                Shape s = (Shape)shapes.get(i);
                if (s.containsPoint(x,y)) {
                   clickedShape = s;
                   break;
             if (clickedShape == null) {
                   // The user did not click on a shape.
                return;
             else if (evt.isPopupTrigger()) {
                  // The user wants to see the pop-up menu
                popup.show(this,x-10,y-2);
             else if (evt.isShiftDown()) {
                  // Bring the clicked shape to the front
                shapes.remove(clickedShape);
                shapes.add(clickedShape);
                repaint();
             else {
                  // Start dragging the shape.
                draggedShape = clickedShape;
                prevDragX = x;
                prevDragY = y;
          public void mouseDragged(MouseEvent evt) {
                 // User has moved the mouse.  Move the dragged shape by the same amount.
             if (draggedShape == null) {
                    // User did not click a shape.  There is nothing to do.
                return;
             int x = evt.getX();
             int y = evt.getY();
             draggedShape.moveBy(x - prevDragX, y - prevDragY);
             prevDragX = x;
             prevDragY = y;
             repaint();      // redraw canvas to show shape in new position
          public void mouseReleased(MouseEvent evt) {
                 // User has released the mouse.  Move the dragged shape, and set
                 // draggedShape to null to indicate that dragging is over.
                 // If the shape lies completely outside the canvas, remove it
                 // from the list of shapes (since there is no way to ever move
                 // it back on screen).  However, if the event is a popup trigger
                 // event, then show the popup menu instead.
             if (draggedShape == null) {
                   // User did not click on a shape. There is nothing to do.
                return;
             int x = evt.getX();
             int y = evt.getY();
             if (evt.isPopupTrigger()) {
                   // Check whether the user is trying to pop up a menu.
                   // (This should be checked in both the mousePressed() and
                   // mouseReleased() methods.)
                popup.show(this,x-10,y-2);
             else {
                draggedShape.moveBy(x - prevDragX, y - prevDragY);
                if ( draggedShape.left >= getSize().width || draggedShape.top >= getSize().height ||
                        draggedShape.left + draggedShape.width < 0 ||
                        draggedShape.top + draggedShape.height < 0 ) {  // shape is off-screen
                   shapes.remove(draggedShape);  // remove shape from list of shapes
                repaint();
             draggedShape = null;  // Dragging is finished.
          public void mouseEntered(MouseEvent evt) { }   // Other methods required for MouseListener and
          public void mouseExited(MouseEvent evt) { }    //              MouseMotionListener interfaces.
          public void mouseMoved(MouseEvent evt) { }
          public void mouseClicked(MouseEvent evt) { }
       }  // end class ShapeCanvas
       // ------- Nested class definitions for the abstract Shape class and three -----
       // -------------------- concrete subclasses of Shape. --------------------------
       static abstract class Shape {
             // A class representing shapes that can be displayed on a ShapeCanvas.
             // The subclasses of this class represent particular types of shapes.
             // When a shape is first constructed, it has height and width zero
             // and a default color of white.
          int left, top;      // Position of top left corner of rectangle that bounds this shape.
          int width, height;  // Size of the bounding rectangle.
          Color color = Color.white;  // Color of this shape.
          boolean drawOutline;  // If true, a black border is drawn on the shape
          void reshape(int left, int top, int width, int height) {
                // Set the position and size of this shape.
             this.left = left;
             this.top = top;
             this.width = width;
             this.height = height;
          void setSize(int width, int height) {
                // Set the size of this shape
             this.width = width;
             this.height = height;
          void moveBy(int dx, int dy) {
                 // Move the shape by dx pixels horizontally and dy pixels vertically
                 // (by changing the position of the top-left corner of the shape).
             left += dx;
             top += dy;
          void setColor(Color color) {
                 // Set the color of this shape
             this.color = color;
          void setDrawOutline(boolean draw) {
                 // If true, a black outline is drawn around this shape.
             drawOutline = draw;
          boolean containsPoint(int x, int y) {
                // Check whether the shape contains the point (x,y).
                // By default, this just checks whether (x,y) is inside the
                // rectangle that bounds the shape.  This method should be
                // overridden by a subclass if the default behavior is not
                // appropriate for the subclass.
             if (x >= left && x < left+width && y >= top && y < top+height)
                return true;
             else
                return false;
          abstract void draw(Graphics g); 
                // Draw the shape in the graphics context g.
                // This must be overridden in any concrete subclass.
       }  // end of class Shape
       static class RectShape extends Shape {
             // This class represents rectangle shapes.
          void draw(Graphics g) {
             g.setColor(color);
             g.fillRect(left,top,width,height);
             if (drawOutline) {
                g.setColor(Color.black);
                g.drawRect(left,top,width,height);
       static class OvalShape extends Shape {
              // This class represents oval shapes.
          void draw(Graphics g) {
             g.setColor(color);
             g.fillOval(left,top,width,height);
             if (drawOutline) {
                g.setColor(Color.black);
                g.drawOval(left,top,width,height);
          boolean containsPoint(int x, int y) {
                // Check whether (x,y) is inside this oval, using the
                // mathematical equation of an ellipse.
             double rx = width/2.0;   // horizontal radius of ellipse
             double ry = height/2.0;  // vertical radius of ellipse
             double cx = left + rx;   // x-coord of center of ellipse
             double cy = top + ry;    // y-coord of center of ellipse
             if ( (ry*(x-cx))*(ry*(x-cx)) + (rx*(y-cy))*(rx*(y-cy)) <= rx*rx*ry*ry )
                return true;
             else
               return false;
       static class RoundRectShape extends Shape {
              // This class represents rectangle shapes with rounded corners.
              // (Note that it uses the inherited version of the
              // containsPoint(x,y) method, even though that is not perfectly
              // accurate when (x,y) is near one of the corners.)
          void draw(Graphics g) {
             g.setColor(color);
             g.fillRoundRect(left,top,width,height,width/3,height/3);
             if (drawOutline) {
                g.setColor(Color.black);
                g.drawRoundRect(left,top,width,height,width/3,height/3);
        // <editor-fold defaultstate="collapsed" desc="Generated Code">                         
        private void initComponents() {
            setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
            javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
            getContentPane().setLayout(layout);
            layout.setHorizontalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGap(0, 400, Short.MAX_VALUE)
            layout.setVerticalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGap(0, 300, Short.MAX_VALUE)
            pack();
        }// </editor-fold>                       
        public static void main(String args[]) {
            java.awt.EventQueue.invokeLater(new Runnable() {
                public void run() {
                    new ShapeDrawFrame().setVisible(true);
        // Variables declaration - do not modify                    
        // End of variables declaration                  
    }

    Sure. In your original post, you had a sort of a design. The general idea was right. And then you asked us to implement it. Well, that's the wrong approach. You need to make the sort-of-a-design into a real design. Don't implement anything until you know what you are going to implement.

  • Error message on my Mac Pro Quad Core Dual

    Hello..I'm hoping someone out there can help or advise me.
    I turned on my mac this morning to find it's normal loading screen of grey with the darker grey logo in centre..all normal at this stage. This was followed by a wipe from top to bottom making the background grey a little darker and in the centre the apple logo was replaced by what appeared to be a semi transparent power button symbol with the words. "You need to restart your computer. Hold down the Power button for several seconds or press the restart button"
    I have tried this several times to no avail I have also zapped the P RAM again nothing. Can anyone out there help. I have a Mac Pro Quad Core Dual which is only a few months old and is up to date with its system software.
    I could be so grateful of any assistance.
    Warm regards
    Sophia

    Make an appointment. But in the meantime...
    So from cold boot, you can't do the Command Option P R through 2-3 full reboot cycles (don't let up)?
    Unplug everything and let it sit overnight without power cord or anything. That is the only way to rest the SMC system management controller on the 2008 model, the older model still had a reset button.
    Also learned that the 2008 Macs can all boot AHT if the original OEM installer was used to install the system and the drive has not be completely reformatted and retail OS X used, just holding down "D" on startup. But you have to
    Also, pull all your hard drives. Rule out that, which I have seen a hard drive cause panic on startup, which required disabling journaling and other repairs from Disk Utility and deleting caches, then repair, and finally do Safe Boot (shift key down on startup).
    The only way to test RAM is with TechTool Deluxe or Pro; with Memtest or Rember; and to test some devices is to try using a differnent one, keyboard and mouse included if you have any.
    Last hope: open case, look inside, take the two RAM Riser cards and pull out, check the DIMMs are fully seated.
    If you have 3rd party memory, remove that (would need to before taking in probably).
    Might want to put RAM back to way it shipped with 2 x 1GB and one DIMM on each Riser in slot one. Maybe that will wake this sleeping giant. Changing RAM config use to be one way to clear nvram in the distant past in the time of Arthur.
    PS: it is "odd" to find a BTO 3.2GHz system, and only 2GB. For memory performance, Barefeats found a marked improvement with 8 DIMMs, and of course Mac Pro really needs memory to feed 8 cores and pro apps (2GB would be okay for web and email type use only).

  • HP Pavillion will not boot up everytime

    We dont use this desk to to often, but we turned it on, fans came on,  sounded like somthing eas startingt to boot. and then nothing black screen.  after a little while of turning it off and on it booted up, was able to update virus software and windows updates. and then a little bit later it crashed (we were not in the room at the time). I did a little looking on here and I found that it coulb be memory or a mother board. This morning I sat down next to the tower (its on the floor) hand accidently hit the power button and it powered and booted just like it suppose to. then after about a minute or 2 a blue screen came up (see bleow)  HELP what do I need to do to get this working again? I tried the memory removal and test in each spot but still not booting. 

    Hello @ajgriswell,
    Welcome to the HP Forums, I hope you enjoy your experience! To help you get the most out of the HP Forums I would like to direct your attention to the HP Forums Guide First Time Here? Learn How to Post and More.
    I understand that you are getting the BSOD 0x0000008E error and require assistance. I am providing you with an About Technology document: How To Fix STOP 0x0000008E Errors that explains what causes this error and how to go about fixing it. I suggest you review the document and follow the steps provided.
    Please feel free to re-post if you require additional support. Thank you for posting on the HP Forums. Have a great day!
    Please click the "Thumbs Up" on the bottom right of this post to say thank you if you appreciate the support I provide!
    Also be sure to mark my post as “Accept as Solution" if you feel my post solved your issue, it will help others who face the same challenge find the same solution.
    Dunidar
    I work on behalf of HP
    Find out a bit more about me by checking out my profile!
    "Customers don’t expect you to be perfect. They do expect you to fix things when they go wrong." ~ Donald Porter

  • Export command in oops

    hi all,
    Observe the code .
    LOOP AT lines INTO ls_lines.
         ls_tdline =  ls_lines-tdline.
          APPEND ls_tdline TO lt_tdline.
        ENDLOOP.
    Export the text on the text editor into ABAP memory.
        EXPORT (lt_tdline) TO MEMORY ID 'MID'.
    as u see i am exporting Lt_tdline to memory id .
    this statement gives me a dump saying that the contents in the table is not recognised. Actually i am moving the contents in the field tdline from table tline into ABAP MEMORY. Its urgent.
    Please help.

    If you are trying to export the table to memory, remove the parentheses.  Adding the parentheses will make it look for the contents within the table.  For example, if you have a row that says "This is a test", then the export statement will try to export a parameter called "This is a test" to memory.

  • Video not working

    plx......help me i have a big problem in my noklia 5800 xpressmusic phone .my realone player does not play any one of my video files in my phone if you are trying to open any video files it sticks it does not play videos you can see what am i talking about in the photos ........plx.help me and what am i suppose to do with my phone......thanks.....
    Attachments:
    Picture 008.jpg ‏10 KB
    Picture 009.jpg ‏10 KB

    do u hear any sound? How did u transfer the videos? When did this problem start?
    Maybe the video format is not suppprted f u just hear sounds.
    Try moving a small video to ur phone memory, remove the memory and try playin. If the video plays, then maybe ur memory card has problems.
    If it still doesn't try usin videos of proper format. If u were able to play video before and u r not able to do so now, then u may have to do a soft reset..
    And if u'v never been able to play a video, try transferrin video via the ovi suite or try convertin videos with a video converter like Videora, etc.
    So plz provide some more details like yhe questions asked above so tht we cn assist u.
    Regards,
    Dr. Shoubhik

Maybe you are looking for

  • DMLException: JBO-26061: Error while opening JDBC connection, Broken pipe

    Hi, We are facing a strange problem with oc4j903 container using bc4j getConnection() method. We are getting the following error intermitantly using bc4j getConnection() method. ApplicationModuleProvider JBO-30003: The application pool (bc4j_paris) f

  • Large PDF file sizes when exporting from InDesign

    Hi, I was wondering if anyone knew why some PDF file sizes are so large when exporting from ID. I create black and white user manuals with ID CS3. We post these online, so I try to get the file size down as much as possible. There is only one .psd im

  • Http headers, http receiver adapter

    Hello, I have a scenario SAP -> RFC -> XI -> HTTPREQUEST -> webserver SAP <- RFC <- XI <- HTTPRESPONSE <- -""- I need to read a http header in the httpresponse. How can that be done? Anyone has an example? Best regards /Otto

  • Oracle 10g and internet connection

    I recently installed a program which uses and installed the Oracle 10g database, but cannot run the database while I have an internet connection. If I disable my internet, I can run Oracle and my program. If I am connected to the internet and run the

  • Updating Views in sql server

    Hi, I am trying to update a view but the result is 0 row(s) updated ALTER VIEW vw_AuthorizedStationeries AS SELECT StationeryID, CreatedOn, StationeryName FROM dbo.Stationeries WHERE Authorized = 1 GO -----------------Update Views-------------------