How can I make a drawing stable and not disappear?

When I draw some shapes in a panel, if another window goes over the panel, then the drawing disappears and I have to draw it again.
How can I make the drawing stable?

Encephalopathic wrote:
Of course you've read the graphics tutorials, and you are doing all of your drawing in a paintComponent(Graphics g) method override, correct?Encephalopathic is correct. If you want the stuff you draw to persist, you should override paintComponent() and redraw everything there. Just because you've drawn something on a component once (say, a line or an Image) does not mean it'll be redrawn the next time the component needs to be painted. You have to re-draw your custom stuff every time a repaint event is sent to the component, and that means overriding paintComponent().
If your component will have lots of custom painting done to it (such as if you're making a MS Paint-style program), you might want to consider drawing to a BufferedImage, then in your component's paintComponent() override, just rendering the BufferedImage. Check the documentation for more details.

Similar Messages

  • I want to switch to firefox from Explorer, but somethinbg called Imesh keeps coming up when i try to get to firefox. How can i make firfox my browser and not Imesh?

    I have beeb using Explorer on my laptop that came with Vista home premiun. (unfortunately). Explorer keeps crashing. i want to switch my browser to Firefox, but when I try I keep getting something called "Imesh" that appears to be posing as Firefox.

    From what I understand Imesh is P2P software used to download various things. (Like Limewire.) I would just uninstall Imesh. My favorite utility to uninstall stuff is ccleaner, it makes uninstalls quick and painless. You can download it at http://www.piriform.com/ they make great free ware.
    Now that the Imesh is removed do you have Firefox installed? When you install Firefox it will ask you if you want to use it as the default browser.
    I hope this helps, if you wish to continuing various downloads with out the typical "P2P" silly stuff check in to torrents.
    Have a nice day.

  • How can i make shorten systemlog files and joblog files on OS

    Hello
    How can i make shorten systemlog files and joblog files on OS

    Hello Jan,
    You can limit the size of system log.
    The size of the application server's System Log is determined by the
    following SAP profile parameters. Once the current System Log reaches
    the maximum file size, it gets moved to the old_file and and a new
    System Log file gets created. The number of past days messages in the
    System Log depends on the amount/activity of System Log messages and the
    max file size. Once messages get rolled off the current and old files,
    they are no longer retrievable.
    rslg/local/file /usr/sap/<SID>/D*/log/SLOG<SYSNO>
    rslg/local/old_file /usr/sap/<SID>/D*/log/SLOGO<SYSNO>
    rslg/max_diskspace/local 1000000
    rslg/central/file /usr/sap/<SID>/SYS/global/SLOGJ
    rslg/central/old_file /usr/sap/<SID>/SYS/global/SLOGJO
    rslg/max_diskspace/central
    Refer to http://help.sap.com/saphelp_nw70/helpdata/EN/c7/69bcbaf36611d3a6510000e835363f/content.htm
    for explanation of profile parameters.you can reduce the size of system log using rslg/max_diskspace_local and rslg/max_diskspace_central
    But you can't reduce the size of job log files on OS
    Rohit

  • How can I make Use of PS and Ai (offer) in spite of running Windows Vista ?

    How can I make Use of PS and Ai (offer) in spite of running Windows Vista ?

    Once you have signed up, you could - in theory - choose "other version" under the icon on the CC website and install CS6, but I'm not sure if that works for this special offer or only for "full" CC. Anyway, it seems simple enough to upgrade to Win 7 or Win 8 and perhaps you were planning on starting fresh, anyway...
    Mylenium

  • My Macbook Pro has become slow and sometimes it hangs. How can I make it work fast and normal.

    My Macbook Pro has become very slow and it sometimes hangs. How can I make it work faster and normal? I  used Etrecheck and got the report below;
    EtreCheck version: 1.9.12 (48)
    Report generated June 16, 2014 at 18:05:25 GMT+1
    Hardware Information:
        MacBook Pro (13-inch, Mid 2012) (Verified)
        MacBook Pro - model: MacBookPro9,2
        1 2.5 GHz Intel Core i5 CPU: 2 cores
        4 GB RAM
    Video Information:
        Intel HD Graphics 4000 - VRAM: (null)
            Color LCD 1280 x 800
    System Software:
        OS X 10.9.3 (13D65) - Uptime: 0 days 1:50:52
    Disk Information:
        APPLE HDD TOSHIBA MK5065GSXF disk0 : (500.11 GB)
            EFI (disk0s1) <not mounted>: 209.7 MB
            Machintosh HD (disk0s2) / [Startup]: 499.25 GB (465.33 GB free)
            Recovery HD (disk0s3) <not mounted>: 650 MB
        MATSHITADVD-R   UJ-8A8 
    USB Information:
        Apple Inc. FaceTime HD Camera (Built-in)
        Apple Inc. Apple Internal Keyboard / Trackpad
        Apple Inc. BRCM20702 Hub
            Apple Inc. Bluetooth USB Host Controller
        Apple Computer, Inc. IR Receiver
    Thunderbolt Information:
        Apple Inc. thunderbolt_bus
    Gatekeeper:
        Mac App Store and identified developers
    Launch Daemons:
        [loaded]    com.adobe.fpsaud.plist Support
        [loaded]    com.microsoft.office.licensing.helper.plist Support
    User Login Items:
        iTunesHelper
        Dr.Web Light
        Dropbox
    Internet Plug-ins:
        SharePointBrowserPlugin: Version: 14.0.0 Support
        FlashPlayer-10.6: Version: 14.0.0.125 - SDK 10.6 Support
        Flash Player: Version: 14.0.0.125 - SDK 10.6 Support
        QuickTime Plugin: Version: 7.7.3
        Default Browser: Version: 537 - SDK 10.9
    Safari Extensions:
        iGetter Extension: Version: 2.9.2
    Audio Plug-ins:
        BluetoothAudioPlugIn: Version: 1.0 - SDK 10.9
        AirPlay: Version: 2.0 - SDK 10.9
        AppleAVBAudio: Version: 203.2 - SDK 10.9
        iSightAudio: Version: 7.7.3 - SDK 10.9
    iTunes Plug-ins:
        Quartz Composer Visualizer: Version: 1.4 - SDK 10.9
    User Internet Plug-ins:
        iGetter Plugin: Version: 2.9.2 Support
        iGetterScriptablePlugin: Version: 2.9.2 Support
    3rd Party Preference Panes:
        Flash Player  Support
    Time Machine:
        Time Machine not configured!
    Top Processes by CPU:
             4%    Dropbox
             3%    WindowServer
             0%    fontd
             0%    Microsoft Word
             0%    Microsoft Excel
    Top Processes by Memory:
        242 MB    drwebd
        176 MB    Dropbox
        147 MB    Dr.Web Light
        86 MB    WindowServer
        82 MB    App Store
    Virtual Memory Information:
        43 MB    Free RAM
        1.68 GB    Active RAM
        1.65 GB    Inactive RAM
        641 MB    Wired RAM
        421 MB    Page-ins
        0 B    Page-outs

    Meli070,
    uninstall Dr.Web Light.

  • How can i make my video card and sounds work on Windows 7 on my Macbook Pro 2.2? Help please...

    How can i make my video card and sounds work on Windows 7 on my Macbook Pro 2.2? Help please...

    i lost my Mac OSX dvd...

  • How can i download premiere elements 10 and not 11?

    how can i download premiere elements 10 and not 11?

    Direct Download Link(ensure you read the very important instructions)
    Thanks
    Nikhil  

  • How can i read every"number" value and not only the 1st?

    in the vi only the first "number" value(from the data acquisition)is read in the small loop.how can i make every value to be read?every value must be compared with the "numeric" constant,and,if greater the led must turn on.afterwards,when a value which is less than the "numeric" is found the led must turn off.please answer or send mail to [email protected]
    Attachments:
    oximet5.vi ‏152 KB

    The more I look at your program, the less I understand it.
    Why are you setting number = number in a case if SO2 = ""? number always equals number.
    In your sequence frames 1 and 4, you have no control over which write (date or time) happens first. Just placing one function to the left of another doesn't make it happen first if your wiring doesn't create data dependency. Review the section on Data Dependency in chapter 5 of the LabView User's Manual.
    It looks you're writing to and reading from the same file using Write File and Read Lines from File.vi. Why read back data you just wrote? You have the data on your diagram. If you want to convert it from string to numeric, use a Sring/Number Conversion function from the String palette.
    On Read Lines from File.vi (which I'm not sure you even need), you should use a shift register for the start of read offset rather than a local variable for mark after read (chars.). With a shift register, you can initialize it to 0 when the VI starts. Using a local, if you restart the VI, it will try to startup from where you left off the last time, but you just opened the file for create or replace.
    In your sequence frames 2 and 3, why do you wait for the number to be less than the numeric before writing a carriage return to the file? Also, LabView has a End of Line constant which adapts to the expected value for the operating system. That's generally more flexible than a Carriage Return.
    It looks to me like you're overusing control refnums. You don't need to use a control refnum and a property node to set or read a control's value if you can wire directly to the control's terminal.
    I really don't understand what you're doing with pause and variants. I may be missing the point, but it looks like you made this much more complicated than it needs to be. Why not keep it a boolean?
    For your pause-path, you open the file but never close it. You can lose data that way. You also open it using open function 3, create new file. You'll get an error if the file already exists.
    On a general note, your diagram would be easier to read if you were more selective in how you routed your wires: you have wires on top of wires, wires running under sub-VIs, wires running in the frame of a while loop, wires running under labels.
    I think there's a temptation to overuse sequences. I don't think you need one here. As I mentioned in my earlier message, case structures and shift registers will be more useful to you.

  • HT4098 how can i cancel my zoosk app and not be charge at all

    how can i cancel my zoosk app and nt be chanrge at all?

    If it's an auto-renewing subscription then there are instructions on that page that you posted from on how to manage and cancel them. If you've already paid then, from the app's description page in the store :
    No cancellation of the current subscription is allowed during active subscription period.
    So you can only stop the next payment happening

  • How can I make a drawing with forms in a column, so that it is fixed to that cell and it will be printed on that cell?

    If I have made  drawings with forms in a column, how can I tie it up on that cell, so it wil be printed on the right place in that column.

    If I have made  drawings with forms in a column,
    Not sure what you mean by "drawings with forms in a column" but if you mean you have a graphical object (photo, drawing, etc.) then you can select that image, command-c to copy to the clipboard, click once in a cell, and command-v to copy. That pastes it into the background of the cell. You can then adjust the width/height of the column/row as desired to display the image.  The image will then follow the cell wherever it goes.
    SG

  • How can I make a circular mask and decrease the expansion without....

    I created a circular mask using the elliptical tool on a 400x400 pixel composition, but when I tried decreasing the Mask Expansion from 0.0pixels to -180 pixels the circle becomes a vertical ellipse. I was wondering why does it become elliptical and how can I change it that it stays circular? Thanks

    Same answer as 2 threads down: http://forums.adobe.com/thread/1016445?tstart=0
    Mylenium

  • How can I show only text edits and not text formatting when using print comments summary?

    Acrobat 9.3.0 for Mac.
    Here is the scenario: I used the Compare command to see the changes between 2 PDFs. The resulting file some edits are inserts and some are deletions. I want to print a comments summary only showing the text edits. In the Compare Option pane, I select Text and deselect Images, Annotations, Formatting, Headers/Footers, and Backgrounds. Now on the screen I see inserts are highlighted in blue and deletions are marked with sort of a caret and vertical bar symbol. So all looks good at this point. However, when I show the Comments List, I see addtional comments that indicate "Replace - The following text attributes were changed: fill color." Those comments do not appear in the page view unless I check the Formatting check box to show them. With Formatting unchecked, I print a comments summary and all of the "Replace - Fill Color" comments" appear on the resulting comments summary.
    I only want to show text edits, not text formatting changes. So questions are:
    1. Why, when the Formatting checkbox is unchecked, do the text formatting comments still appear in the comments list when they do not appear on the page display.
    2. How can I print only the text content edits and not show the text formatting changes when using Print Comments Summary.

    Hi,
    You can set ExecuteWithParams as default activity in the task flow then method activity to return total no of rows passing to Router activity if your method has value 0 then call Create insert operation else do directly to page.
    Following idea could be your task flow
    Execute With param (default) > SetCurrentRowWithKey > GetTotalNoOfRows (VOImpl Method)
    |
    v
    Router
    1. If pageFlowScope outcome is 0 then call CreateInsert > MyPage
    2. if pageFlowScope outcome > 0 then MyPage
    hope it helps,
    Zeeshan

  • How can I block a particular program and not the whole channel?

    I want to block a particular program. When I am trying to that, it blocks whole channel. How can I do that?
    Second Q is: can I have two parental control pins to block programs?

    Then there is no point to use it for me. Some channels require parental control for some programs, so this option should be available.Someone can argue that then "why don't you lock whole channel and unlock whenever you want to use it." I want to avoid locking-unlocking by locking specific programs.
    Comcast has this option of locking specific program as well locking channel!

  • If You Sync Notes Via iCloud, How Can You Make Local/On My Mac Notes?

    I've you're using the Notes app in Mountain Lion, and your Notes are stored in iCloud, is it possible to make notes that are just On My Mac and not in iCloud? If so, how do you do it?

    Choose Apple menu > System Preferences, and then click Mail, Contacts & Calendars.Open Mail, Contacts & Calendars preferences
    Set up an account with Notes:
    For an existing account:
    Select the account, and then select the Notes checkbox.
    For a new account:
    Click an account type, enter your account information, and then follow the onscreen instructions.
    I didn't need to set it up in ML but here's what Help has to say...

  • I just ordered an iPad 4 32gb from Amazon but sold by a store called iPadShop.  In the customer reviews there were several reports of this store selling used and refurbished iPads as new.  How can i verify mine is new and not used when it arrives.?

    Ok, first time here, so forgive me if Im repeating the question.  I just ordered a NEW iPad 4 32gb from Amazon, but is actually being sold by a seller called "iPadShop". Although this seller got a high approval rating of 4.9 there were several reports of customers receiving used and refurbished iPads but sold as new.  Once I receive mine how can I verify it is new.  Also, even the ones that were new were purchased by this seller and then resold, which shortened the life of the 1 year warranty offered by Apple..?

    If you just ordered it, I suggest you cancel your order as soon as possible. If you can't contact Amazon, call your credit card company and cancel payment on that. Why go through worrying about the ipad you are paying for as new? If it's to save money, then that can be defeated if you get a used or refurbished ipad with a less than full one year warranty. You'll be dealing with the ipad shop's return policy which could mean that once you open it, it's yours, unlike when you buy from Apple you have a full 14 days to return it even if you've opened it.
    I looked at Amazon and did not see a price difference. If cost led you to buy from Amazon, what are you saving?
    I suggest you buy it directly from Apple. If cost is an issue, consider buying a refurbished ipad from the Apple online Refurbished store. I would not buy a refurbished anything from anywhere but the Apple online refurb store.
    The ipad 4 32 gb is $499.00 refurbished - a savings of $100.00 vs. a new one. We bought two ipads last year and one as a gift this year and they have been great!
    All ipads sold in the Apple refurb store come with new front and back covers, a brand new battery, a full one year warranty, and in case it matters, come in a new white Apple box like all ipads do. Earphones and charger are also included. You can also get the new Apple Care +, which insures up to three breakages (damaged glass, water damage, etc.) in two years.
    Hope this helps.

Maybe you are looking for

  • HELP NEEDED IN JAVASCRIPT!

    A new American-style bar and restaurant is being set up. They require a system for recording orders and producing customer bills. Restaurant ordering system This system is used by the waiter or waitress. Having taken a customer order for food and dri

  • HT1751 Why can't iTunes handle a music library on an external drive?

    I put all my music files on an external drive and imported them into iTunes. So far so good. The first time you run iTunes while the drive is disconnected - all your songs suddenly have that dreaded exclamation point next to them. Yes, while the driv

  • Lock Object Creation

    Hi, Is it possible to create lock objects at runtime? if not, how do I lock tables at runtime when the table name is specified in the selection screen by the user? Thanks. Tyken

  • Deploying a program to a user with UAC enabled causes LaunchWith32BitLauncher error and system crash

    We are deploying a program to run as the logged on user on a Win 7 Sp1 client which runs as an EXE silently.  It fails to execute and we believe that it's due to it being blocked by UAC. When we examine the logs we see the following error in the Ccm3

  • Struts configuration

    Does anyone have experience using Struts 1.1 with oc4j. I have successfully created an application, but I am having problems defining my ApplicationResources in the struts-config.xml. Everything works fine if I define them in the web.xml, but when I