Painting new objects without repainting old objects

Halle you
I am a no- vice in this branch. Help me
THe problem is I am drawing some rectangle and lines inside the canvas
but I have to repaint the existing geometrical images along with the new one, but but but
I want to only draw the new object ONLY without redrawing the older ones. that is when I draw some object say RECTANGLE after drawing the CIRCLE and repaint the CIRCLE vanishes.
I AM TRYING TO AVOID VECTORS.
HELP ME FRIENDS

Why don't you keep an area object (Shape) that will contains all your previous as well as the new shapes so that you need not to draw all shapes everytime.
See this demo if you like...
import java.awt.*;
import javax.swing.*;
import java.awt.geom.*;
import java.awt.event.*;
public class MyCanvas extends Canvas {
     Area area = new Area();
     static MyCanvas canvas = new MyCanvas();
     public MyCanvas(){
          draw(new Ellipse2D.Double(10,10,50,50));
     public void draw(Shape shape){
          area.add(new Area(shape));
          repaint();
     public void paint(Graphics g) {
          super.paint( g);
          Graphics2D g2 = (Graphics2D)g;
          g2.draw(area);
     public static void main(String[] args) {
          JFrame f = new JFrame("Shape demo");
          f.getContentPane().add(canvas, BorderLayout.CENTER);
          JButton button = new JButton("add rectangel");
          button.addActionListener(new ActionListener() {
               public void actionPerformed(ActionEvent e) {
                    Rectangle r = new Rectangle(10,100, 100,50);
                    canvas.draw(r);
          f.getContentPane().add(button, BorderLayout.SOUTH);
          f.setSize(500,300);
          f.setLocation(200,200);
          f.show();
}

Similar Messages

  • How to create a new user without any sample objects from any other user?

    Question as the title.
    I had the example dababase installed when I installed the Oracle database.
    Every time, when I create a new user, there will be some example objects coming
    with the new user.
    How can I remove these objects from the new user?
    Or, how can I create a new user without the example objects?
    Thanks in advance.

    I think the easiest way for you would be to use OEM.
    Just locate each object that you want to remove and right click->remove. Don't bother doing this for any indexes as these will be removed when you drop the corresponding tables.
    If you want to try command line through sqlplus then identify the objects you want to remove by selecting from the user_objects view while logged in as this user. This will give you the name and type of object. Then issue the relevant drop command.
    It's probably worth making sure you have a valid backup first, just in case things go wrong!

  • How do I sync purchased ringtones to a new iPhone without the old iPhone

    Is it possible to sync purchased ringtones to a new iPhone without the old iPhone

    If you have copies of them on your computer's iTunes then you should be able to - if they show in the Tones part of your iTunes library then you should be able to sync them to your new phone. Or do you not have copies of them on your computer nor on your backup of your library ?

  • I have one playlist on iphone4. how can i add new playlist without deleting old one. i do not have old playlist in itunes any more.

    I have one playlist on iphone4. how can i add new playlist without deleting old one. i do not have old playlist in itunes any more.When i try to sync iphone with itunes it says that this action will remove my old playlist and all songs.

    "it says that this action will remove my old playlist and all songs."
    Are you connecting to a different iTunes library than you normally connect to?  That will erase the songs and playlists since the iPhone can't be connected to multiple libraries even if it is in manual sync mode.
    If you no longer have access to the original library that your iPhone calls 'home', then the only way to save the playlist (and the songs on your iPhone) would be to use a 3rd party application to extract your iPhone contents to this new iTunes library you're trying to connect to.

  • My hdd is gone and now I have a new one without my old key - how can I get my stored data on my new hdd?

    all data on my old hdd is lost after an crash. so i changed it with a new hdd. but the old sync key is not longer available. I generated a new key so i lost all my old date stored with sync... is there any way to restore the old data from my old hdd sync key...?

    Sorry, no. The SyncKey is used for encryption / decryption during the Sync process, without the Sync Key that was used to encrypt your personal data as it was uploaded to the Sync storage server your data is worthless. Plus, when you generate a new Sync Key for an existing account, all the data that is saved on the server for that account is deleted for your security.
    Do you still have the old HDD? It may work long enough for you to extract your Firefox data, if you put that drive in a USB drive enclosure and access it as an external drive. <br />
    http://support.mozilla.com/en-US/kb/Recovering+important+data+from+an+old+profile

  • How to export music from my iphone to my pc on a new computer without my old computer

    how do i export music from my iphone to my pc on a new computer, without having my old computer?

    Hi elizabethann317!
    I have an article here that can tell you what media you can and cannot transfer from phone to computer, and can provide you with some links to steps for completing these types of syncs:
    iTunes: Transferring media from your iPhone, iPad, iPod touch, or iPod
    http://support.apple.com/kb/HT1209
    Thanks for coming to the Apple Support Communities!
    Regards,
    Braden

  • I transfer the music from the ipod to my new computer without my old computer being available?? anybody know?

    how can i transfer music from an ipod classic to my new computer from my ipod without my old computer being available??

    http://www.yamipod.com/main/modules/home/

  • Running sysprep AFTER I install a HDD into a new PC without the old PC?

    Is it possible to run sysprep on a HDD that I
    install into a NEW PC without having access anymore to the old one? I know you
    have to run sysprep on the old PC while the HDD is plugged in and running system
    and then you sysprep it with generalize but is it possible to do this
    afterwards? Maybe you don't have the source/original PC....
    Thank you

    Hi,
    What do you meand by "source hardware"?  The HDD isn't built in the computer?  sysprep relied on the Windows you installed, you should run the sysprep.exe at where the Windows is installed.
    Regards
    Wade Liu
    TechNet Community Support

  • How can I get my old iPod onto my new computer without my old computer?

    The hard drive on my old computer recently crashed and there was no way to recover anything from it. I was currently using iTunes 7 on that computer so everything was updated. I was using Windows XP on my old computer but I just bought a new one that has Vista. I have a lot of songs and pictures on my iPod and want to get them to my new computer. How can I do this if I don't have any computer authorized to my iPod without losing everything? Please help!

    Connect your iPod to your computer. If it is set to update automatically you'll get a message that it is linked to a different library and asking if you want to link to this one and replace all your songs etc, press "Cancel". Pressing "Erase and Sync" will irretrievably remove all the songs from your iPod. Your iPod should appear in the iTunes source list from where you can change the update setting to manual and use your iPod without the risk of accidentally erasing it. Also when using most of the utilities listed below your iPod needs to be enabled for disc use, changing to manual update will do this by default. Check the "manually manage music and videos" box in Summary then press the Apply button: Managing content manually on iPod
    Once you are safely connected there are a few things you can do to restore your iTunes from the iPod. If you have any iTMS purchases the transfer of purchased content from the iPod to authorised computers was introduced with iTunes 7. A paragraph on it has been added to this article: Transfer iTunes Store purchases using iPod
    The transfer of non iTMS content such as songs imported from CD is designed by default to be one way from iTunes to iPod. However there are a number of third party utilities that you can use to retrieve the music files and playlists from your iPod. You'll find that they have varying degrees of functionality and some will transfer movies, videos, photos, podcasts and games as well. Have a look at the web pages and documentation, this is just a small selection of what's available, they are generally quite straightforward. You can also read reviews of some of them here: Wired News - Rescue Your Stranded Tunes
    TuneJack Windows Only
    iPod2PC Windows Only
    iGadget Windows Only
    iDump Windows Only
    iRepo Windows Only
    iPodRip Mac & Windows
    YamiPod Mac and Windows Versions
    Music Rescue Mac & Windows
    iPodCopy Mac and Windows Versions
    There is also a manual method of accessing the iPod's hard drive and copying songs back to iTunes on Windows or a Mac. The procedure is a bit involved and won't recover playlists but if you're interested it's available at this link: Two-way Street: Moving Music Off the iPod
    There are various programs out there for recovering photos from an iPod, have a look at the ones below. If you search the internet you can find more:
    iPodPhotoCopy Windows only
    CopyPodPhoto Windows only
    Tansee iPod Transfer Photo Windows only
    iPod Photo Liberator Mac & Windows
    If you have full resolution copies of the photos on the iPod have a look here: Apple Knowledge Base article - Use Disk Mode to copy photos from iPod
    Whichever of these retrieval methods you choose, keep your iPod in manual mode until you have reloaded your iTunes and you are happy with your playlists etc then it will be safe to return it auto-sync. I would also advise that you get yourself an external hard drive and back your stuff up, relying on an iPod as your sole backup is not a good idea and external drives are comparatively inexpensive these days, you can get loads of storage for a reasonable outlay.

  • I have to use two different versions of Firefox for two different employers - How to install new version without losing old one?

    One employer requires that I use Firefox 3. Another requires that I use the newest version. How do I install a new version Firefox to a different path without over-writing the old version?

    The easiest way it to have one version be a Firefox Portable installation. The Portable installation is self-contained and won't affect your "regular" Firefox installation.<br />
    http://portableapps.com/apps/internet/firefox_portable
    Otherwise you need to set up a Profile specifically for the 2nd version and make sure the correct Profile is launched with each version. <br />
    [http://support.mozilla.com/en-US/kb/Managing+Profiles] <br />
    http://kb.mozillazine.org/Shortcut_to_a_specific_profile
    Overall you are probably better off replacing your current Firefox 3.6.25 version with the Portable Apps version - http://portableapps.com/apps/internet/firefox_portable/localization#legacy36 - and install Firefox 9.0.1 as your "regular" installation.

  • How to run setup for new datasources without breaking old datasources?

    Hi,
    I am wondering how to install some more data sources (2LIS_05_Q0NOTIF, 2LIS_17_10NOTIF and 2LIS_18_10NOTIF) without breaking the delta mechanism for other data sources when I start to use the new datasources.
    I have installed some QM cubes (0QM_C04, -05, -08 and -11) and delta loads run every night.  Now I want to add two more cubes (0QM_C02 and -03). The new cubes use datasources that are not yet available.
    If I now activate the needed datasources, delete the content of the setup tables again and run 'Application-Specific Setup of Statistical Data' for 'Quality Management', 'Plant Maintenance' and 'Service Management', I am afraid that I will re-initialize the delta queue for the datasources that are already in use... In other words: I am afraid of breaking all datasources in application 05, 17 and 18...
    I cannot find documentation addressing this problem. Any input, anyone?
    Best regards,
    Christian Frier

    Hi all,
    if I understand you all correctly, I can use the following plan:
    0) Wait until no documents are posted on the R/3 side.
    1) Run the delta loads and check that the queues are empty (RSA7 and LBWQ).
    2) Delete the setup tables.
    3) Run the 'Application-Specific Setup of Statistical Data'
    4) Create and execute infopackages for initial dataload (for the new datasources).
    5) Create and execute infopackages for delta loads      (for the new datasources).
    6) Run the infopackages for delta load from the 'old' datasources without running a new initial dataload.
    So basically 6) is the step I worry about.
    That is that I can start to use 2LIS_05_ITEM, 2LIS_17_ITEM and 2LIS_18_ITEM without breaking the delta sequence for 2LIS_05_TASK, 2LIS_17_TASK and 2LIS_18_TASK.
    regards,
    Christian

  • How to sync ipod games to new computer without losing old games on ipod?!?!

    I bought a game for my 5th gen ipod and it worked fine, yadda yadda yadda. Well, tha computer I bought it with died and now I have a new one. I've bought another game, but am afraid if i sync it to my ipod, it will delete my old games. Any way around this? Thanks

    Be very careful when connecting an iPod full of music to an empty iTunes library.There is very real risk of permanently losing all the music.
    To prevent auto sync, before you connect the iPod go to the iTunes preferences and select "devices", then select "disable automatic syncing for iPhones and iPods".
    An alternative method is to connect the iPod whilst holding down the 'control+shift' keys and do not let them go until your iPod appears in iTunes.
    If you see a message that your iPod is associated with a different library and asks if you want to link to a new one, make sure you press "Cancel".
    If you should click on "Erase and Sync" will erase all the content currently on your iPod and it will be replaced with the content of the iTunes library you just connected to.
    When you've pressed cancel your iPod should appear in the iTunes source list under "devices" and allow you to change the update setting to manage the iPod content manually, and that will let you use your iPod for the time being without the risk of accidentally erasing the contents.
    Then do any of the following to transfer your music from iPod back to the computer/iTunes.
    For iTunes version 7 or later, then you can transfer purchased iTunes store music from the iPod to an authorized computer by using the "file/transfer purchases from iPod" menu. Note that the maximum of 5 authorized computers applies here.
    Find out how to do that here.
    How to copy iTunes purchases from an iPod or iPhone to a computer.
    Once you've done that, you can sync your iPod to iTunes as normal.

  • How to migrate to a new computer without the old computer?

    My old PC was destroyed in a flood. I have all my music on my iPod and want to get it all to my new PC. I have 9100+ songs of which about 95% were imported from CD. I do not want to have to spend a month re-importing.
    All the threads I found by searching seem to assume I have access to my old PC to change settings etc.
    Can I do this or am I screwed?

    1). Connect your iPod to your computer. If it is set to sync automatically you'll get a message that it is linked to a different library and asking if you want to link to this one and replace all your songs etc, press "Cancel". Pressing "Erase and Sync" will irretrievably remove all the songs from your iPod.
    2). When your iPod appears in the iTunes source list change the update setting to manual, that will let you continue to use your iPod without the risk of accidentally erasing it. Check the "manually manage music and videos" box in Summary then press the Apply button. Also when using most of the utilities listed below your iPod needs to be enabled for disc use, changing to manual update will do this by default: Managing content manually on iPod and iPhone
    3). Once you are connected and your iPod is safely in manual mode there are a few things you can do to restore your iTunes from the iPod. iTunes will only let you copy your iTunes Store purchases directly from an iPod to the computer, you'll find details in this article: Copying iTunes Store purchases from your iPod or iPhone to a computer
    For everything else (music from CDs, other downloads and including iTunes purchases) there are a number of third party utilities that you can use to retrieve the music files and playlists from your iPod. You'll find that they have varying degrees of functionality and some will transfer movies, videos, photos, podcasts and games as well. You can read reviews and comparisons of some of them here:
    Wired News - Rescue Your Stranded Tunes
    Comparison of iPod managers
    A selection of iPod to iTunes utilities:
    TuneJack Windows Only (iPhone and iPod Touch compatible)
    SharePod Windows Only (iPhone and iPod Touch compatible)
    iPod2PC Windows Only
    iDump Windows Only
    YamiPod Mac and Windows
    iPod Music Liberator Mac & Windows
    Floola Mac & Windows
    iPodRip Mac & Windows (iPhone and iPod Touch compatible)
    iPod Music Liberator Mac & Windows (iPhone and iPod Touch compatible)
    Music Rescue Mac & Windows (iPhone and iPod Touch compatible)
    iGadget Mac & Windows (iPhone and iPod Touch compatible)
    iRepo Mac & Windows (iPhone and iPod Touch compatible)
    iPod Access Mac & Windows (iPhone and iPod Touch compatible)
    TouchCopy Mac & Windows (iPhone and iPod Touch compatible)
    There's also a manual method of copying songs from your iPod to a Mac or PC. The procedure is a bit involved and won't recover playlists but if you're interested it's available on page 2 at this link: Copying Content from your iPod to your Computer - The Definitive Guide
    4). Whichever of these retrieval methods you choose, keep your iPod in manual mode until you have reloaded your iTunes and you are happy with your playlists etc then it will be safe to return it auto-sync.
    5). I would also advise that you get yourself an external hard drive and back your stuff up, relying on an iPod as your sole backup is not a good idea and external drives are comparatively inexpensive these days, you can get loads of storage for a reasonable outlay: Back up your iTunes library by copying to an external hard drive

  • How do I sync old devices to a new iMac without our old iTunes library? Our orig iMac died with the library on it.

    Our old iMac died and we got a new one. The problem is that our entire iTunes library was on the old iMac and all of our iPads and iPhones were synced to the old dead iMac. How do we sync the devices to the new iMac now?

    Your i-device was not designed for unique storage of your media. It is not a backup device and media transfer was planned with you maintaining a master copy of your media on a computer which is itself independently backed up against loss.  To use a device with a new computer you transfer the content from the old computer (or its backup) directly to the new computer, not the device to the new computer. Media syncing is one way, computer to device, updating the device content to the content on the computer, not updating or restoring content on a computer. The exception is iTunes Store purchases which can be transferred to a computer.
    iTunes Store: Transferring purchases from your iOS device or iPod to a computer - http://support.apple.com/kb/HT1848 - only purchases from iTunes Store
    For transferring other items from an i-device to a computer you will have to use third party commercial software.  See this document by turingtest2: Recovering your iTunes library from your iPod or iOS device - https://discussions.apple.com/docs/DOC-3991

  • How do i load the music from my ipod onto a new computer without the old computer

    my ipod has music on it from another computer that died and i just downloaded itunes on my new computer, how do i put new songs on my ipod without erasing all the music already on it?

    See this older post from another forum member Zevoneer covering the different methods available for copying content from your iPod back to your PC and into iTunes.
    https://discussions.apple.com/thread/2452022?start=0&tstart=0
    B-rock

Maybe you are looking for

  • Pulling the condition records - help in the ABAP code -urgent!!!!!

    hi folks, I need some urgent help here.. I have discussed this portion before in the forum  but there are some changes and I need some help here. The code goes like this.... select knumv kschl kbetr kwert   from konv into table cdata      for all ent

  • Sets in Mdx Query

    HI, More Sets will give the performance or less sets will give the more performance.Could you please help me. with member [Measures].[Uniquenames] as [Date].[Calendar Year].currentmember.uniquename set s1 as filter(([Date].[Calendar Year].children),

  • Allowing Expressions in JSLT 1.0.3 Tag Libraries within JDevelper 9.0.3

    I down loaded the latest version of the Java Standard Tag Library (1.0.3) from the Apache site. I installed the standard-1.0.3/lib/standard.jar file and associated it with the c-rt.tld in JDeveloper using Tools/Manage Libraries. I added the component

  • N 73 asking acess points during call

    Hi, I have the Nokia N73, Whenever i make or receive call, pop-up occurs and ask to select the access point. i can't undrestand why it is asking the access points, If I select the access point, data connections gets activated, but for the next call i

  • Can B2B accpt a compressed file [ tar,zip]  over  AS2

    we have a situation where one of our Partner would like to send us a tar file with xml files in it., usually the b2b server will accept xml file based on the matching function we configure with. can some body chime in of b2b is capable of accepting t