I want to remove all the components from particular panel.

hi all,
i have 3 panels p,p1,p2.i added panels p1 and p2 to a window,then i added a panel p(this panel contaning JScrollPane) to a panel p1.i have a button on panel p2,if i press that button i want to remove all the components as well ass JScrollPane(remember JScrollPane in panel p).
if possible give example.
Thanks in advance
bhaskar
code is here
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.util.*;
public class test1 extends Window implements ActionListener
JPanel p,p1,p2;
JScrollPane jp;
Button b,b1,b2,b3,b4,b5,b6,b7,b8,b9,b10,b11,b12;
test1()
super(new Frame("testing"));
p=new JPanel();
p1=new JPanel();
p2=new JPanel();
adding();
jp=new JScrollPane(p);
jp.setPreferredSize(new Dimension(300,300));
add(jp);
setSize(new Dimension(200,200));
setVisible(true);
public void adding()
b12=new Button("hai");
b12.addActionListener(this);
p2.add(b12);
add(p1,BorderLayout.CENTER);
add(p2,BorderLayout.WEST);
p.setLayout(new GridLayout(11,1));
p.setBackground(Color.white);
b=new Button("one");
b1=new Button("two");
b2=new Button("three");
b3=new Button("4");
b4=new Button("5");
b5=new Button("6");
b6=new Button("7");
b7=new Button("8");
b8=new Button("9");
b9=new Button("10");
b10=new Button("11");
b11=new Button("12");
p.add(b);
p.add(b1);
p.add(b2);
p.add(b3);
p.add(b4);
p.add(b5);
p.add(b6);
p.add(b7);
p.add(b8);
p.add(b9);
p.add(b10);
p.add(b11);
p1.add(p);
public void actionPerformed(ActionEvent e)
if(e.getSource()==b12)
System.out.println(e.getSource());
System.out.println("111");
p.removeAll();
public static void main(String args[])
test1 t=new test1();
/*****************************************/

p.removeAll();

Similar Messages

  • How can I remove all the music from my iPhone?

    I want to remove all the music from my iPhone 5 (Current iOS) and then load a completely new set of songs from my Mac (Current OS).
    How do I do that ? 
    Even when I define a specific new playlist and tell it to apply only that it still does not remove the unwanted songs.
    Thanks !

    I feel I've explained plenty what you must do but you aren't getting it.
    All music on your old iPhone should be in your iTunes library on your computer. Transfer the music from your iTunes library on your computer to your new iPhone in the same way it was transferred from your iTunes library to your old iPhone - via the iTunes sync/transfer process.
    Since you prefer the manual way, you must manually drag and drop the same 377 songs from your iTunes library to your new iPhone - in the same way the 377 songs were manually transferred from your iTunes library to your old iPhone.
    Or you can sync which provides more options overall. Create an iTunes playlist for the 377 songs. Select Sync Music under the Music tab for your iPhone sync preferences with iTunes and choose selected playlists, artists, albums, and genres. Select the iTunes playlist below that includes the 377 songs followed by a sync.  

  • HT204406 i want to download all the songs from itunes match back to my pc.  there are well over 2000 songs. instead of downloading one by one, is there a way to download all of them while I sleap?

    I want to download all the songs from iTunes Match back to my PC (iTunes).  Instead of downloading one by one, can I have all the songs downloaded back to my iTunes by one shot (while I sleap)?

    I just found the answer by myself.  Instead of clicking Cloud icon one by one, highlight all the songs in Cloud (after sorting by Cloud status) and riight click, download.  Now I am getting all the songs back to my local machine.  I will sync my iOS devices tomorrow and just GET RID OF iTUNES MATCH.  To me, it was a disaster.  Worse than their map app.

  • My Macbook pro was stolen 09/12, the police just returned it to me. I want to remove all the data and start over. Format the drive's etc. I have windows 7 on 1 partion and mountain lion OSX on the apple partition. How is the best way to do this?

    My Macbook pro was stolen 09/12, the police just returned it to me. I want to remove all the data and start over. Format the drive's etc. I have windows 7 on 1 partion and mountain lion OSX on the apple partition. How is the best way to do this?

    Have a look here...
    what-to-do-when-your-hard-drive-is-full.html

  • I want to copy all the objects from one user to another... Please help

    Hii Experts.... I have a problem here. Please give me solution for this...
    I am using Oracle 11g on my windows XP system.
    I created a new user named "some"
    I want to copy all the objects from scott user to some user... Please help me
    Please Explain me in detailed way
    Thank you

    SowmyRaj wrote:
    Hii Experts.... I have a problem here. Please give me solution for this...
    I am using Oracle 11g on my windows XP system.
    I created a new user named "some"
    I want to copy all the objects from scott user to some user... Please help me
    If all what you are interested is Scott schema than no need to use the datapump or CTAS. Run demobld.sql in your schema and it would have all the objects of Scott.
    http://www.oracle.com/technology/sample_code/tech/sql_plus/htdocs/demobld.html
    HTH
    Aman....

  • HT1349 i just got my second ipad, i want to put all the music from my 1st one straight to my second, how do i do that?

    i just got my second ipad, i want to put all the music from my 1st one straight to my second, how do i do that?

    Set you 2nd iPad from your 1st iPad. If you have your music in your iTunes library, it's easier as you can set it up as a new device and then go to music>sync all music.
    Once you set up you 2nd iPad from your 1st one, if you want do not want the other setting to be synced, turn it off. For example, in apps, uncheck everything and you can get rid of them.

  • I have accidentally deleted the trash bin in my mailbox and can no longer move any deleted mail into the trash.  I thought I was removing all the emails from the trash but somehow managed to delete the bin instead.  Does anyone know who to reinstate it?

    I have accidentally deleted the trash bin in my mailbox and can no longer move any deleted mail into the trash.  I thought I was removing all the emails from the trash bin but somehow managed to delete the bin instead.  Does anyone know who to reinstate the bin?

    You are running 10.6.8? If yes, I assume you have your install disks? As the trash bin is part of Mail app and that is an integral part of the OS, the only way I know to get it back is to reinstall the OS. You won't lose any files, just reinstall the OS over the top of the current system.

  • Recently tried to upload photos on my iPad to the iCloud PL beta and in the process it removed all the photos from my device through the photo stream. No CPU backup of photos, photos are older than 30days. Any third party recovery software I can use?

    Recently tried to upload photos on my iPad to the iCloud PL beta and in the process it removed all the photos from my device through the photo stream. No CPU backup of photos, photos are older than 30days. What can I do?

    First of all, you should always save you photos on computer like any other digital camera.
    Backup on iCloud or iTunes only backup your Camera Roll. The other photos should be already on the computer.
    Note: Photos are not saved in iTunes, it's only a conduit between your iPhone and your photo managing software on computer.
    What computer do you have?

  • Ok, so I want to buy the new iPod touch 5g this week and I have an iPhone 4. I want to transfer all the data from the phone to the iPod and have the files the exact same. I don't want to redo data, say erase game data (campaigns, achievements)...

    Ok, so I want to buy the new iPod touch 5g this week and I have an iPhone 4. I want to transfer all the data from the iPhone to the iPod and have the files the exact same. I don't want to redo data, say erase game data (campaigns, achievements)... I have apps that have very important data on them and if I sync it to iTunes and then transfer all that data to the iPod Touch 5g, will that erase app data?

    iOS: Transferring information from your current iPhone, iPad, or iPod touch to a new device

  • Disable all the components of a panel ( panels within the main panel )

    Hi guys!
    I have a problem!
    i have to disable all the components of a panel. please note that i am also having panels within the main panel. please tell me how to do that!!!
    its urgent!!

    Hi guys!
    I have a problem!Wouldn't have figured that one out by myself ...
    its urgent!!No, it's not.
    You know, a panel is most often a subclass of Container, so all you need to do is recursively disable all child components. The methods getComponents and getComponent are very helpful when trying to access child components. Code likeif ( comp instanceof Container )
      // do soemthing
    }will help in determining whether a child component is yet another Container.

  • Not able to access Site logo from layout and css After removing all the permission from site

    Hi Techis,
    I have stucked here, actually I have removed permissions from all the users from the site and after sometime I got the mails from client that they are not able to access the Site logo and css in the site.
    When I logged from Farm account and checked I can see everything working fine.Also the masterpage and all are checked in
    I am not getting whats the exact issue.I stucked here from last one day Please help me to solve this issue.
    Thanks Regards,
    Simanchal

    Hello,
    Is it the publishing site? If so then go to site permission and provide permission to "NT AUTHORITY\authenticated users" to "Style Resource Readers" group.
    You also need to make sure that "style library" is inheriting permission from parent otherwise you need to give at least read permission to library for all users. To verify this, just open view all site content page-->then click on style library,then
    check permission.
    Let us know your result
    Hemendra:Yesterday is just a memory,Tomorrow we may never see<br/> Please remember to mark the replies as answers if they help and unmark them if they provide no help

  • I just got a new computer and I want to transfer all the music from my ipod classic onto my computer.

    I just got a new computer and want my entire library on my ipod classic to be transferred to my computer.  I transferred as many files as I could from my old computer through my external hard drive, but many of my cds didn't transfer.  When I hook up my ipod, I see it's entire contents.  My question is, does a sync only work from the computer to the ipod, or if I sync my ipod will the songs on it be synced to my computer along with all the playlists?  My biggest worry is if I sync it, it will go back to the factory settings or I lose all my music.  I appreciate any help.

    Yes...
    For iTunes purchases...
    Launch iTunes on the new computer. From the iTunes menu bar click Store > Authorize This Computer
    Now from the menu bar click File > Transfer Purchases from...
    Fro non iTunes purchases see Zevoneer's post here > Moving files from Ipod to Itunes: Apple Support Communities

  • How can i remove all the photos from my iphone 5S that i synced from my computer

    Hi All, my iPhone 5S is full of photos (1326) or so. however the camera roll is 827. there is an album named "My Photo Stream" which has 466 from My Computer and under it is "Shared" which has 12 from my computer. Can anybody help me to remove both these albums as there taking up a lot of space and I have tried everything to remove them!!!

    On option is to open your my photo stream album in the thumnail view, tap Edit, tap all the photos, tap Share, tap Save to Camera Roll.  Then import them to your computer using your usb cable (http://support.apple.com/kb/HT4083).  A more convenient option is to use an app like PhotoSync, which will transfer all your photos from any album (including photo stream) to any of your devices (including your computer) over wifi by pressing a single button.

  • IOS 5.1 removes all the music from iPhone

    Updated my iPhone to iOS 5.1 and all the music got removed. No I need to spend hours to get it back. I'm not buying the music from iTunes because iTunes store is not available in my country. Even if it was avaiable still some of the music cannot be found there. Did anyone else encoutered this as well? what is the solution? What to do to prevent this situation to happen in the future with iOS 5.2 or iOS 6.0?
    PS
    I've updated OTA

    Never lost my music in all the years updating my phones. Did you sync your phone with a different computer that doesn't have your original itunes library? Thiings do get erased that way.

  • I always had used my family computer for iTunes. so my Iphone music was backed up to that with my moms id. But i got a macbook. and downloaded my cds on it. I want to put all the music from my iphone on my new apple id. How can i without deleting anything

    Please help! I really have no idea how to do it.. And i don't want to lose all my stuff. My old computer is still working but it's super slow it's an acer. and my new computer is a macbook pro!

    You can change the email address of one's appleID...
    I'd recommend changing moms email to yours to get a good backup on the Mac
    Then switch mom's back to hers
    Then change your account to the same email you used.
    I've done something similar when I needed to update my Apple account (one ID changing email addresses and phone)

Maybe you are looking for