How do i clear the entire content of JPanel?

when a certain event happens, how do i clear anything that is currently displayed in the JPanel?

What do you mean by displayed? Something drawn on the JPanel? Or Components added to the JPanel?
If the latter:
myPanel.removeAll();
myPanel.validate();Something like that. You may have to validate the content pane also/instead.
If you want to clear the drawing, that would be slightly harder...
Graphics g = myPanel.getGraphics();
g.clearRect(0,0,myPanel.width(), myPanel.height());(I have no idea if that would work, but it sounds good).
Cheers,
Radish21

Similar Messages

  • How do I mark the entire contents of a RichTextBox (gRTbxInfo) with a background color of white?

    How do I mark the entire contents of a RichTextBox (gRTbxInfo) with a background color of white?
    I have code that finds / marks words with a different color.  Now I want to remove that color.  I've started with the following, but cannot complete it.
        //int iLength = gRTbxInfo.Length
        int iLength = 10;
        TextRange trText = new TextRange(gRTbxInfo.Document.ContentStart, gRTbxInfo.Document.ContentEnd);
        TextPointer tpStart = trText.Start.GetInsertionPosition(LogicalDirection.Forward);
        TextPointer tpSelectionStart = tpStart.GetPositionAtOffset(0, LogicalDirection.Forward);
        TextPointer tpSelectionEnd = tpSelectionStart.GetPositionAtOffset(iLength, LogicalDirection.Forward);
        TextRange tpSelection = new TextRange(tpSelectionStart, tpSelectionEnd);
        tpSelection.ApplyPropertyValue(TextElement.BackgroundProperty, new SolidColorBrush(Colors.White));
    bhs67

    Isn't that just
    TextRange tr = new TextRange(rtb.Document.ContentStart, rtb.Document.ContentEnd);
    tr.ApplyPropertyValue(TextElement.BackgroundProperty, Brushes.White);
    Hope that helps.
    Recent Technet articles: Property List Editing;
    Dynamic XAML

  • How do I copy the entire contents of my laptops failing hard drive to copy back onto a new computer.

    How do I copy the entire contents of my laptops failing hard drive to copy back onto a new computer.

    If the drive has failed the only way to get any data off it is to send it to a Data Recovery company. Which is very expensive and no guaranty they will be able to retrieve any data.
    That is why Apple has included a system to backup your Mac on a regular basis, Time Machine. Also there are other Apps to do basically the same thing by Cloning your internal drive to an external drive. Carbon Copy Cloner and SuperDuper. Along with using Disk Utility to Image the internal drive to an external drive.
    Sorry to tell you but if the drive has really failed your Data is gone unless you pay a large sum of money to one of the Data recovery companies.

  • When I am on my home screen on the iPhone, swipe left to the search page. Put a letter in the search field. then scroll down. eventually you get to all your texts previously deleted or not. The are all there. How can I clear the entire text from the phone

    When I am on my home screen on the iPhone, swipe left to the search page. Put a letter in the search field. then scroll down. eventually you get to all your texts previously deleted or not. The are all there. How can I clear the entire text from the phone

    When I am on my home screen on the iPhone, swipe left to the search page. Put a letter in the search field. then scroll down. eventually you get to all your texts previously deleted or not. The are all there. How can I clear the entire text from the phone

  • How do you copy the entire contents of a hard drive?

    Without all the permission issues and such? One example is when I try to copy my drive to an external firewire drive that's empty I get the can't copy a file cause one already exists. The drive is blank? I'm doing a quick reformat and it would be easiest to just copy the entire drive and pull files I need over later. It's a powerbook G4.
    Mac Pro Tower 2.0GHz   Mac OS X (10.4.9)  

    Hi
    Will Kappy's answer in this thread (link below) help?
    http://discussions.apple.com/thread.jspa?threadID=959886&tstart=0
    Steve

  • How do I "drag" the entire contents of a library onto Ipod (manual update)

    I can select the entire library to highlight it, but when I point on it with my mouse and try to drag it over, it's not working for me. I sometimes get the blockout symbol, but that's about it. HELP PLEASE!
    Much thanks.

    Forgive what may be a dumb question on my part, but do you have iTunes set to manage your iPod manually (which isn't possible for an iPod shuffle, if that's what you have)?

  • How do you print the entire contents from a data field?

    I have a simple Acrobat form that was sent to me and one of the data fields employs a scroll bar because it contains more text than the field can hold. How do I print my document so that it prints everything in that field, not just was is visible?
    Thanks

    I'm not sure you can do this with a standard Adobe Acrobat form. If the form is created with Acrobat Designer (Windows, not Mac product) there is the possibility to have the field grow in size. Designer based forms can be used on a Mac, but cannot  be created under the Mac OS (virtualization excluded).

  • How to clear the table contents for the new selection values?

    Hi,
    Im developing some very basic web dynpro applications.I have created one application to demonstrate use of SERVICE CALL.Now in one of the COntext Nodes,I have one attributes as TABLE.I have 2 input fields and when i enter any sel critteria in these 2 fields,the table is populated accordingly.Now when i change the value in the input fields,the new output gets appended in the output TABLE.How do I clear the contents of the OUTPUT table attribute  in the method?
    Can someone tell me the common methods used with context nodes like REFRESHING,CLEARING etc?How do I know which methods to call for what action of the nodes ...like for binding internal table to any context node we use the method BIND_TABLE...
    Any inputs will be highly appreciated.
    Thanks!
    BR,
    SRM tech.

    Hi,
    To clear the contents of the node, use invalidate method.
    data: l_node type ref to if_wd_context_node.
    l_node  = wd_context->get_child_node( 'NODENAME' ).
    l_node->invalidate( ). " all the data in the node will be cleared
    To clear a single attribute you can use set_attribute_null.
    Regards,
    Radhika.

  • How cacn I clear the system clipboard content? and notify

    Hi all,
    I have any question please,
    -How can I clear the content of system clipboard?
    -How can I notify if a paste failed, the application which start the cut, so not remove the elements which selected for cut? /Cut & paste between two applications/
    Thx.

    Hi,
    try to search the forum as I did:
    http://onesearch.sun.com/search/onesearch/index.jsp?charset=utf-8&qt=how+to+use+clipboard&rf=0&rt=1&nh=10&cs=0&y=0&x=0&col=developer-forums
    L.P.

  • I have forgotten my password and locked my phone, how can i clear the problem

    I have forgotten my password and locked my phone, how can i clear the problem

    By coincidence, this happened to my son just last night.  You do NOT have to restore it to a new phone, but you probably want a current backup.
    Luckily, you can still sync and back it up even if it's locked, so connect it to the computer you usually sync it to. Go to the summary page. It's easiest and fastest to use a local backup, so if iCloud backup is on, turn it off and click "Backup now".  
    After it backs up, either click "Restore iPhone", or
    - hold home and the top button until the screen goes black, release the top and continue to hold the home button until iTunes says "iPhone in recovery mode detected". 
    Follow instructions to restore from backup, and then sync to restore content.  Your phone will come up in an unlocked state. If you have any stuff that was purchased directly to the iPhone (only), you'll have to re-download it. 
    Remember to turn iCloud backups back on if you use them.
    If you don't sync you iPhone to a computer then I *think* those instructions with the buttons will put it into a mode where you can restore it from the cloud (make sure it is NOT connected to a computer while you do this). Otherwise, you will have to restore it as a new phone, then go to settings, reset, then restore it from the cloud.

  • How do I set the column content to automatic break lines

    Hello Guys,
    I have a problem with the column width and the column content of a standard report. Within the report are hugh entries which aren't interrupted by an space character. I set my column width to a special value by usingen "css style: display block; width: 300px;". Now the problem is that some of the column entries have a longer width than the column width is setted. So they overlock the entries of the column next to them.
    My question is: How do I set the column content to automatic break lines after a certain count of characters?
    After researching a couple of websites and discussion thread I found maybe a reference to the solution. I hope it help you to give me an answer.
    COLUMN LAST_NAME FORMAT A4
    regards
    wderr

    Wderr,
    PDFs are another animal entirely. Try adjusting the width of the column under the Print Attributes tab of the report.
    If that doesn't work you'll probably need to create custom XSL-FO layouts which, depending on the tools you have at your disposal, could take some time.
    Regards,
    Dan
    Blog: http://DanielMcGhan.us/
    Work: http://SkillBuilders.com/

  • Can I send the entire contents of a mailbox to another person as a .zip?

    I have a mailbox folder (MobileMe) that I specifically created in Snow Leopard Mail to segregate several hundred emails from the rest of my inbox. I would like to send the entire contents of this folder to someone via MobileMe - is this possible?
    In other words, how do I insure that someone else who is using Snow Leopard Mail will be able to view and open all the emails in the folder that I want to send to them (as if they were looking at the same folder on my own computer)?
    Is there a file somewhere in my user library that I can simply copy to a new folder, zip, upload to MobileMe, and send someone the download link to that will accomplish my goal?
    Many thanks!

    The mailbox you created in mail will be in your user account folder>Library>Mail>Mailboxes. You should see the MobileMe folder that you created in Mail.
    I'm not sure how it would work if you have attachments involved. If so, you will have a folder for attachments and messages. If so, maybe you would have to copy the whole mailbox.
    If it just has a Messages Folder, then all your messages are there. You can copy and send that.

  • I have passed my iphone to my partner. How does she clear the phone and set up her own itunes account

    I have upgraded my iphone and have given it to my partner. How does she clear the phone and start from scratch with an itunes account. Thank you.

    ERASE / Clear All Data
    Go to Settings > General > Reset > Erase all content and settings
    Then Connect to iTunes on their computer.
    Syncing with iTunes
    From Here  >  http://www.apple.com/support/iphone/getstarted/

  • How do i rotate the entire document?

    how do i rotate the entire document?

    There is no such thing. You will have to adjust the artboard and then manually rotate the content to fit.
    Mylenium

  • I recently created a new folder, dragged some items into it, and found that the entire contents of my desktop appeared to be in there as well. This happens every time I make a new folder. Any suggestions?

    I recently created a new folder on my MacBook, dragged some items into it, and found that the entire contents of my desktop appeared to be in the folder as well. This happens every time I make a new folder. Any suggestions?

    Csound1 What Ive been trying to explain is that I have been running bootcamp, I open the app where the first screen is the introduction, i hit continue, the first time I select "download the latest windows support software fromm Apple" then I return and instead select "Install Windows 7." Then hit continue. The third screen is where I "Create a Partition for Windows" I set Windows to 80 gigs then hit INSTALL. As stated before Bootcamp cannot find the install drivers saying "The installer disc could not be found." My windows software is on a USB drive not a disc, I tried using a virtual disc reader to make it appear that the windows software was running on a disc, still no luck. What I would like to know is how to install windows on bootcamp.

Maybe you are looking for

  • HOW TO SET UP PARTNER APPLICATION TO USE SSO OUTSIDE OF PORTAL

    If anyone knows how Portal switches context to run as the db user mapped to the lightweight schema and how it knows the db schema password please let me know. Should you have any queries please do not hesitate to contact me on 07775 896738. From docu

  • Heap Memory Issue in weblogic 9.2 for a JSF 1.1 web application

    Hi, We are running a JSF application (Myfaces, facelets, tomahawk, richfaces & iBATIS) in weblogic 9.2 server on Solaris 10. This application is deployed in production and works fine under normal circumstances. But when there is a heavy user load we

  • Adding parametric value to role programmatically

    I would like to add a large number of parametric values to a parametric role and I have tried the following code to do so: String sql = "Select distinct majorcode from GS_Contacts"; Fuego.Lib.Role rl = Role.find(name:"GS_Department"); if(rl != null){

  • SUP-Error creating Unwired Server Connection connection to MyUnwiredServer

    Hi all, I've installed the SUP 1.5.2 and selected the Evaulatiuon (30 day trial) and my Unwired Server cannot start. When i try to test the connection in Enterprise Explorer -> Unwired Servers -> My Unwired Server i get the error. com.sybase.uep.admi

  • About logical port used to call Web service

    Hi Experts: I found that logical port can be created either from "LPCONFIG" or "SOAMANAGER", They can't be found from the other transaction. What's the difference between them? Which one should be used in cases? Wayne