How can I disable all the components in a JPanel?

I want to disable all the components( button, text field ) in a JPanel. I know I can search the panel and disable each of its children component recursively. Is there a better way to do this?

I want to disable all the components( button, text field ) in a JPanel.You haven't defined what you mean by "disable".
If you mean you want the component to be repainted in its disabled state, then you would need to set the property of each individual component to disable, which would imply some kind of recursion.
If you just want to prevent components from receiving key events and mouse events, then you can use a glass pane or maybe a panel with an overlay layout that contains a non-opaque panel that intercepts all events.

Similar Messages

  • 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.

  • How can i print all the contect of the code in sapscript window ? ?

    how can i print all the contect of the code in sapscript window ? ?

    Hi,
    Do you mean that you want to print the ABAP code to SAPscrip form ?
    Svetlin

  • How can i print all the tab pages not just the first page (tab)

    how can i print all the tab pages not just the first page (tab)

    You would need to do this programmatically. Here's one way:
    Attachments:
    Example_VI_BD6.png ‏3 KB

  • I am running out of memory on my hard drive and need to delete files. How can I see all the files/applications on my hard drive so I can see what is taking up a lot of room?

    I am running out of memory on my hard drive and need to delete files. How can I see all the files/applications on my hard drive so I can see what is taking up a lot of room?
    Thanks!
    David

    Either of these should help.
    http://grandperspectiv.sourceforge.net/
    http://www.whatsizemac.com/
    Or search 'disk size' in the App Store.
    Be carefull with what you delete & have a backup BEFORE you start, you may also want to reboot to try to free any memory that may have been written to disk.

  • When creating a book how can I get all the photos from an album to show up in the order they were in the album?

    When creating a book in iphoto, how can I get all the photos from the album I want to use to show up in the order that they are in the album?  When I tried to use the option to add my own photos instead of having the program "flow" them, they showed up all mixed up.

    iPhoto puts them in the book in chronological order.  So to get your photos from an album into an iPhoto book in the same order you will need to use the Photos ➙ Batch Change ➙ Date menu option and set them all to the same date with a 1 minute time difference between each. 
    OT

  • TS4124 Hi, do you know how can I upload inelegible songs from itunes to Icloud. They are songs added from original CDs. Another question would be how can I transfer all the music I have in my Ipod Classic to my Itunes or ICloud as I want to back it up.

    Hi, do you know how can I upload inelegible songs from itunes to Icloud. They are songs added from original CDs. Another question would be how can I transfer all the music I have in my Ipod Classic to my Itunes or ICloud as I want to back it up.

    Depends on why it's ineligible.  If it's under 96 Kpbs, try right-clicking on the file and choosing Create AAC Version.  (If you don't see this option, go to iTunes>Preferences, click "Import Settings..." then choose "Import Using: AAC Encoder" and "Setting: iTunes Plus".)  Then rescan your library to see if this version will add to iTunes Match.  Or, after changing your import setting, just re-import the song to your iTunes library.
    If the song is over 200 MB you would have to reduce it's size to make it eligible.

  • How can i display all the query items to a table?

    how can i display all the query items to a table in a jsp file?
    i always have an out of memory error..

    any body??any idea?
    is it possible thru configuration or i have to write a program by the abaper??
    Biswa

  • How can I copy all the comments from my picture/s in fotostream to my picture/s in my library?

    How can I copy all the comments from my picture/s in fotostream to my picture/s in my library?

    Hi, first, you should prevent the iTunes library auto sync with iPhone: Launch iTunes > click Preferences... > click Devices. In the window, check the option 'Prevent iPods, iPhones, and iPads from syncing automatically'. Next, connect your iPhone with your computer via the USB cable. Click the mini menu for iTunes on the very top left and click the option 'Show menu bar'. After then you can see iTunes File, Edit, View, Control, Store and Help menus on the ribbon. Click File > Devices > Transfer purchases from (your iPhone name). You can also access to the File menu by holding down Alt (Option on Mac), Shift and F keys. This is how to get your iPhone purcahsed song transferred to iTunes Library.

  • How can I display all the columns on the screen without scrolling from side to side?

    My clinic software has many columns. How can I display all the columns without having to scroll from left to right all the time?

    If the software you are using doesn't offer the ability to increase or decrease document size, as many do, then the only way is to increase your screen resolution. If that's not possible, maybe you can decrease your font size?  If you can't do any of these, I think you're out of luck!

  • Multiple calendars have appeared on my Iphone and I am unable to sync all of them to my PC, running Windows 7 and Office 2010. How can I sync all the calendars to my PC, or, merge the calendars on the Iphone so there is only 1 calendar to sync?

    Multiple calendars have appeared on my Iphone and I am unable to sync all of them to my PC, running Windows 7 and Office 2010. How can I sync all the calendars to my PC, or, alternatively, merge the calendars on the Iphone so there is only one calendar to sync?

    If the hard drive that crashed is the one that stored the itunes library, be sure to restore the library from Time Machine (mac) or whatever backup you use on windows.  That will get back your music.  I suspect that the replacement drive has an empty itunes library and thus, perhaps, the itunes match used that to sync to its servers.
    Try posting in the iTunes Match forum, you'll probably find more knowledgeable folks there.
    https://discussions.apple.com/community/itunes/itunes_match

  • How can I delete all the files in the Adobe CS4 Master Collection from my machine?

    How can I delete all the files in the Adobe CS4 Master Collection from my machine. I have tried Control Panel but it will not do anything, there are no error messages, it is like as if it is ignoring my instruction. Why should it be so difficult to delete programs one does not want. Any ideas please.

    Moved from Cloud forum to Downloading, Installing forum
    Try running the Adobe Cleaner Tool
    http://helpx.adobe.com/creative-suite/kb/cs5-cleaner-tool-installation-problems.html

  • How can you delete all the e mail at one time instead of one at a time?

    How can you delete all the e mail at one time instead of one at a time?

    you'd have to do it from the computer,

  • How can I clean all the junk files from my iMac so that it can run faster?

    How can I clean all the junk files from my iMac so that it can run faster? Its been slowing down ever since I started using it.

    Before doing anything, we might be able to help with your iMac issues here.
    Please download, install and run Etrecheck.
    http://www.etresoft.com/etrecheck
    Copy/paste its report here in another reply thread so that we have a complete profile of your Mac's hardware and installed software.

  • How can I visualize all the visits I made to a specific webpage?

    Hello.
    In case I visited a web page several times, how can I see all the visits I made to this page? The data I get in History is the Visit date (which is the last visit date) and the Count, but I would like to see the date and time of all the visits to this web page. I found a program (MozillaHistoryView) that gives me the first and the last visit date, but still I do not see the intermediary visits. (The file I use to get the data is a history.dat file).
    Does anybody have an answer?
    Thanks.

    You could use Global Search (Ctrl-K) and enter the address or name, then filter the results by checking the appropriate box for Filters or People.

Maybe you are looking for

  • Acrobat 9 Extended no Printer Icon under Printers in Windows 7 x64

    I know there are some problems with Acrobat 9 and x64 editions of Windows. I installed for testing purpose Acrobat 9 Extended on Windows 7 x64 but there is no printer Icon listed under "Devices and Printers" in Control Panel. I can make a PDF in Inte

  • HTTP Receiver Configuration

    Hi Experts, In my Business Scenario I am using the HTTP Receiver Adapter with "Additional Query String Attributes" for adding up the "MessageID" in the HTTP Header(I am not sure whether it will be added there).. and the adapter sends the HTTP data to

  • Backups in cron not running

    I'm trying to run rsnapshot through cron to automate my backups but it's not actually running rsnapshot for some reason . Here's my crontab: brian@brian-laptop:/var/log$ sudo crontab -l # DO NOT EDIT THIS FILE MANUALLY!! USE crontab -e INSTEAD. # <mi

  • Discoverer on Linux

    Hi, Does anybody have some information on the performance metrics of Oracle Discoverer on Linux as compared to Windows. i.e some sort of benchmark test or product comparison on different operating systems. Any help would be greatly appreciated. Thank

  • Variable reuse

    Good evening all, I would just like to find out how and why the following code is possible. By my thought process I would have thought that using the counter variable assigned to the two different attributes would lead to the same result in each but