Chechbox header : deselect all not working

folks,
I have a jtable generated from my database. IT has 3 columns . The 3rd column has checkboxes in it. I am implementing a "CHECK ALL"
checkbox on the header for selection and deselection of checkboxes. the below code works for selection of all boxes.. IT DOES NOT
WORK WHEN IT IS DESELECTED ? i want to make it work for deselection also
I call the custom table renderer from main program as follows :
tc = table.getColumnModel().getColumn(3);
tc.setHeaderRenderer(new CustomTableCellRenderer1(new MyItemListener(),Name));
this is item listner in main program for checkbox "check all" present in the table header :
class MyItemListener implements ItemListener
public void itemStateChanged(ItemEvent e) {
Object source = e.getSource();
if (source instanceof AbstractButton == false) return;
boolean checked=e.getStateChange() == ItemEvent.SELECTED;
for(int x = 0, y = table.getRowCount(); x < y; x++)
table.setValueAt(new Boolean(checked),x,3);
if (e.getStateChange() == ItemEvent.DESELECTED) // dosent work
System.out.println("deselect all"); // may b code for deselection
this is CustomTableCellRenderer1 class below:
package moxaclient;
import java.awt.*;
import javax.swing.*;
import javax.swing.table.*;
import java.awt.event.*;
class CustomTableCellRenderer1 extends JCheckBox
implements TableCellRenderer, MouseListener {
private static final long serialVersionUID = 1L;
protected CustomTableCellRenderer1 rendererComponent;
protected int column;
String Name;
private JTable table1;
Object abc=null;
protected boolean mousePressed = false;
public CustomTableCellRenderer1(ItemListener itemListener,String name) {
rendererComponent = this;
rendererComponent.addItemListener(itemListener);
this.Name=name;
public Component getTableCellRendererComponent(
JTable table, Object value,
boolean isSelected, boolean hasFocus, int row, int column) {
if (table != null) {
JTableHeader header = table.getTableHeader();
this.table1=table;
if (header != null) {
rendererComponent.setForeground(header.getForegrou nd());
rendererComponent.setBackground(header.getBackgrou nd());
rendererComponent.setFont(header.getFont());
header.addMouseListener(rendererComponent);
setColumn(column);
rendererComponent.setText("Check All");
setBorder(UIManager.getBorder("TableHeader.cellBor der"));
return rendererComponent;
protected void setColumn(int column) {
this.column = column;
public int getColumn() {
return column;
protected void handleClickEvent(MouseEvent e) {
if (mousePressed) {
mousePressed=false;
JTableHeader header = (JTableHeader)(e.getSource());
JTable tableView = header.getTable();
TableColumnModel columnModel = tableView.getColumnModel();
int viewColumn = columnModel.getColumnIndexAtX(e.getX());
int column = tableView.convertColumnIndexToModel(viewColumn);
if (viewColumn == this.column && e.getClickCount() == 1 && column != -1) {
doClick();
int row=table1.getRowCount();
if(row!=0)
for(int i=0;i<=row-1;i++)
String Sensor =(String) table1.getValueAt(i, column-3); // // when checkbox selectedthis code gets all value present in table and stores in string abc
Double Value =(Double) table1.getValueAt(i, column-2);
String Date =(String) table1.getValueAt(i, column-1);
abc += Sensor+"\t"+Value+"\t"+Name+"\t"+Date+"\t";
public void mouseClicked(MouseEvent e) {
handleClickEvent(e);
((JTableHeader)e.getSource()).repaint();
public void mousePressed(MouseEvent e) {
mousePressed = true;
public void mouseReleased(MouseEvent e) {
public void mouseEntered(MouseEvent e) {
public void mouseExited(MouseEvent e) {
plzz help.

please add tags around the code in your posts.
Dinud123 wrote:
IT DOES NOT
WORK WHEN IT IS DESELECTED ? i want to make it work for deselection alsoI don't know any user interface where I would toggle "select all" and "deselect all" via the same control. That may be for a reason.
So my suggestion is: provide a second button for "deselect all".
bye
TPD                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Similar Messages

  • Select/Deselect  All not working !!

    Hi Gurus,
    I have searched thru SDN forum, but didn't get any pointers on this.
    I have created 2 custom buttons for select/deselect all on ALV toolbar, thru oops.
    Select/Deselect All are not working for me. Please help me with some pointers.
    I have attributes for customized ALV toolbar buttons, and then checking at user command.
    Many Thanks,
    Madan

    Hi,
    Check the links
    https://wiki.sdn.sap.com/wiki/display/Snippets/TutorialABAPALVThroughOOPS
    Addiing Custom button to ALV Grid Standard tool bar
    https://wiki.sdn.sap.com/wiki/display/Snippets/AsimpleprogramonALV+OOPS
    Regards,
    Amit

  • TS3219 I have an ipad 3 that has wifi and for some reason my youtube, facebook, and app store app are all not working. How do i fix this?!!!

    I have an ipad 3 that has wifi and for some reason my youtube, facebook, and app store app are all not working. How do i fix this?!!!

    Hey there FlamingTurd!
    If you are having issues connecting to the App Store on your phone, there is an article here that can help you troubleshoot this issue a little further:
    Can't connect to the iTunes Store
    http://support.apple.com/kb/ts1368
    We also have an article that deals with troubleshooting apps you have downloaded from the App Store and installed on your computer. That article can be found here:
    iOS: Troubleshooting applications purchased from the App Store
    http://support.apple.com/kb/ts1702
    Finally, if neither of those articles resolve the issue, you may need to restore your iPad:
    iTunes: Restoring iOS software
    http://support.apple.com/kb/ht1414
    Take care, and thanks for visiting the Apple Support Communities.
    -Braden

  • Report Column Heading Alignment - Center Not Working Correctly

    I am using Apex 2.1 (XE) and now have an application with about 30 pages. I've noticed that some of my reports which have columns with a heading alignment of "center" are not always centering if they have columns that align to the left or right included before them. I looked at the generated HTML and it shows that align="LEFT" or align="RIGHT" is being generated in the source even when the column heading is set to center in the designer. It appears that if a field higher on the list says to align the column heading left or right, then that is what the following columns are going to do also if they are set to center. So column heading left and right works great, and center works only if all the columns are set to center.
    My question: Is this a known bug? Is it something that can be scheduled for a fix at some point in the future?
    Luckily the column data itself obeys the column alignment, so this is strictly a cosmetic problem with the column headings.
    Thanks,
    Jim

    Hello,
    What theme are you using?
    Try setting them with a css decalration. Instead of align="right" put this is in the heading attribute
    style="text-align:right;" or style="text-align:left;"
    Carl

  • Header UI 2007 not working + Time-out CRM 2007

    Hello,
    We are currently installing CRM 2007 as a standalone. However we encounter 2 problems:
    1. De header menu (personalize etc) is not working. Clicking on those links has no effect at all
    2. When starting a functionality (e.g. account management -> accounts) we get a time-out after 60 seconds. Probably because SAP is compiling the screen for the first time. How can we adjust the time-out settings?
    Thanks!

    Sander,
    The timeouts are controlled by profile parameter settings for the ICM.  You can use the parameters listed below to control these settings.
    icm/keep_alive_timeout - seconds
    icm/conn_timeout - msec
    icm/max_timeout_net - msec
    icm/min_timeout_mpi - msec
    rdisp/plugin_auto_logout - seconds
    I would strongly recommend however that you SGEN your entire system before using the new CRM webclient.  You still can time out even with the parameters above set to generous values.
    Take care,
    Stephen

  • Help! Youcam, Microsoft Word, Excel, Powerpoint and Adobe Reader all not working in U310

    Using a U310 ideapad with Windows 7 bought one year ago - warranty just expired of course!!
    5 days ago I tried to pull up and excel spreadsheet from an e-mail and got an error message that there was not enough memory to do so.
    Afterward, I tried to open word and it simply grayed out with a message box saying it was not working - it would try to fix the problem and then it just disappeared.  The same thing continues to happen.
    I tried to open a PDF with Adobe Reader and it, too, crashed.  I uninstalled it and reinstalled it, stopped it from coming up in protected mode and now it doesn't crash but I cannot edit any pdf with it and the tools box no longer works at all - a small circle spins in it for a couple of seconds, then fades to gray.
    My youcam will not turn on at all - when I click on the youcam icon, the cursor spins for a couple of seconds,then returns to an arrow and the youcam doesn't come on.
    So, after experiencing all these things, I figured I'd try the tried-and-true method of rebooting my laptop.  When the laptop restarted, before allowing me to enter my password, the error message "verifyhost.exe - application error unable to start correctly Oxc000007b" came up.  I x'd out of that, entered password, then 2 other errors came up "lenovoreg.exe" and SACpl.exe
    After working on this for hours, I'm really at a loss as to what it could be.  Does anyone have any idea?   It's unbelievable to me that this has happened on a new laptop that basically just sits on my desk - I don't travel with it and don't do much more than email and word processing on it!  I have no games and very little else even downloaded!  

    Download this, install, update and try to scan your hdd for malware.

  • My BBM and BB Instant messaging all not working on my BB Torch 9800 Even with my Data Plan Activated!

    Device: BB Torch 9800
    Carrier: Globe Telecom (Philippines)
    OS Version: 2949 (v6.0.0.668,Platform 6.6.0.236)
    App free Space: 266.7 MB
    Device Memory free space: 3.5 GB
    Apps Installed:
    AOL IM: 2.5.78
    BBM: 6.1.0.71
    Facebook: 2.0.0.58
    Google Talk: 2.5.125
    My Space: 2.0.0.19
    Twitter: 2.1.0.28
    Windows Messenger: 2.5.125
    Yahoo Messenger: 2.5.125
    BB App World: 3.1.1.21
    Problem: I bought my Torch 9800 on a Blackberry Retailed outlet and inserted my Old Simcard on it . I enrolled on a BB data plan from my carrier (GLOBE's BB Social ON: pls refer from this link to understand better regarding my Carrier's Data plan ) I can access only on my Facebook,My space and Twitter Apps. All other such as BBM, YM,WM,AOL ang GoogleTalk are not working. For BBM: I tried to add a contact as well as my frend tried to add me but i never received the invitation nor did my friend (my friend also has the same Carrier as mine and enrolled on the same package using his BB Bold 9000 OS 5 with BBM 6.1.0.71),another friend also tried to send me BBM invite but never received it. When I tried to log-in on my YM app,it says "service not enabled for this handheld".. I tried to go to the Carrier Customer Service to help me with the settings or something and say that my account is already updated to their BB services and I have already the correct settings. I tried to delete and reinstall the apps..did countless hard resets on my phone..but still the same problem..Can Someone help me plz..

    I'm sorry to say, but I'm having the EXACT same telecom, same plan, same problem. I wonder if the original poster was able to solve his problem. I still can't use my BBM, though the other apps work just fine. :/

  • MY WINDOW 8.1 APP ALL NOT WORKING

    Dear Microsoft
    i just brought my laptop last month..the model is ACER ASPIRE E1-572G with the windows 8.1 inside..on first week after i buy the laptop all function was great...but after a week my apps not working already even Store app also not working..please help me
    to slove it..thansks 

    Hi ALENTHIEN,
    Sorry, I think you post in a wrong forum, and I will move to off-topic.
    I think the suitable forum for you is
    http://answers.microsoft.com/en-us/windows
    --James
    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support
    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

  • Header border style not working in firefox....

    In my skin i have declare for header text (sortable)
    example for sortable header style...
    af|column::sortable-header-text
    background-color: #EF8A1E;
    border: 1px !important;
    color: #000000;
    border-color:black;
    border-style:none;
    in IE border is comming correctly, but in firefox border is not comming for header.
    why ?? is there any error on my style?? or it is not working in firefox/safari??

    Hi,
    try
    .OraSortableHeaderBorder{
    border:2px ;border-width: 2px ;border-style: solid ;
    Frank

  • Post RH 9 Upgrade Expand All and Collapse All not working.

    After upgrading to RoboHelp 9 from 7 - the Collapse All and Expand All is not working.  I am taking over after attending a RoboHelp 9 Training Class a little over a week ago, so any help would be appreciated.

    Hi,
    What is your output? Where are the show/hide buttons placed: In the topic or in the toolbar? You're using RoboHTML right?
    Did you use any kind of twisties in your RoboHelp 7 project? The show all hide all buttons are controlled by a custom script and I'd like to know which method you are using. (If you know which.) See also http://www.grainge.org/pages/authoring/twisty/twisty.htm
    If you're not sure which method you are using, can you post the HTML of the show/hide all button/link?
    Greet,
    Willam

  • Safari/Youtube/iTunes/App Store All Not Working

    Hello,
    I have an iPhone 3GS and today all of the software that required the use of the internet just stopped working.
    Safari, YouTube, iTunes, and the AppStore all do not work. I click on one of these four icons, it pops up for about five seconds, then it goes right back to the home screen.
    I tried shutting off my phone. Didn't work.
    I tried reconnecting it to iTunes itself. Didn't work.
    I reset my network connections. Didn't work.
    I erased my History, Cache, and Cookies. All that did was make it so that when I click on Safari, my Bookmarks come up. The internet still doesn't work.
    A friend of mine has a theory that these "apps" aren't working because of the snow/rain/ice storm I'm currently in the middle of and that once it blows over, my internet should work again.
    My WiFi and 3G work.
    I'd like to avoid resetting my phone to it's orginal settings if that's possible.
    My most recent update is the 4.2.1 update.
    To any and all who can help or offer some suggestions, thank you very much.

    Sleuth wrote:
    I tried both resetting it by itself and while it was connected to iTunes. It didn't work.
    Thank you for your help though.
    You tried resetting all settings on the device by going to Settings > General > Reset > Reset all settings?
    There is no reset in iTunes, are you stating that you did a restore? If you did a restore, did you restore as a new device or from your backup?
    What you describe sounds like an issue in the settings of your device. If you have not already, restore as a new device.

  • Clear Block All not working

    Hi,
    I have a calculation script that fixes on some sparse dimension members and then runs a Clear Block ALL command.
    This script works in dev environment, but does not work in prod.
    I copied the application from prod to dev and executed the script and data was cleared. But the same script does not work in prod.
    Any help is appreciated.
    Regards

    Hi vs,
    When you fix any dense Member/Dimension then "ClearBlock All" will only clear data not blocks, but in case when you fix sparse dimnesion/Member it will clear all blocks,
    so please recheck you dimensions which you have fixed in FIX Statement.
    Thanks,
    Avneet

  • HT5361 Reply all not working

    Reply All is not working internally.  We have a Mac OS X Verstion 10.9.4, mail version 7.3 on the office computer.  If an email comes in from a client and has all of my colleagues included in the email and I hit Reply All, it does not include my colleagues in the return message.  Why?

    I wonder if they put the combination of addresses in the To: field instead of the CC: field.  That might confuse the Mail application.  You can always copy/paste the addresses to the CC field.  Preferably, you want to use BCC anyway instead of CC, since a virus on one PC could add every member on the CC list to an spam e-mail spoof bot that adds everyone to a big spam e-mail list.  Use View menu to add the BCC field.  BCC= Blind Carbon Copy.

  • Select all not working in TABLE menu

    Hi all,
    I am using normal table, displaying some values and selecting record i am copying to another table. If i select manually one record and i use CTRL to select multple records it is working.
    Table has menu option select and deselect all, if i use select all it is showing as selected but while copying giving error null objects.
    And anotherthing i observed here is if i select first record and i use select all menu option it is working??
    I have to do any setting for this? any ideas?
    Thanks,
    Venkat.

    I have used this functionality with out a problem. How do you copy ?
    you mean to say that after select_all, node->get_selected_elements( ) return 0 elements ?

  • Installer & software update all not working now along with safari & itunes

    hi all
    I've posted this under the safari beta for mac area (http://discussions.apple.com/thread.jspa?threadID=1148867&tstart=0) as well but as it relates to several issues, i wanted to put it here and see if anyone here at any ideas.
    yesterday i installed the new version of itunes and safari 3 beta. as i was half way through the safari installation i lost my wireless connection and had to then force quit the process. since then, my itunes, safari and software update and installer programs are not working.
    i've tried downloading previous versions of everything but when i go to install them the installer appears and then dissapears just as quickly. on top of that when i click on itunes from the dock, it bounces like it is about to load up and then stops and doesn't. finally, when i go to click on software update from System Preferences, I get an error message "Preferences Error, Could not load Software Update".
    this includes my trying to download and install the mac osx 10.4.10 combined update to 'fix' everything but as mentioned above the installer appears for a second and then dissapears again without doing anything.
    over to you all for any and all help.
    thanks in advance
    AT
    Any help would be greatly appreciated because whilst i am getting by using firefox, my little girls songs are on itunes and i need to get into them (anyone with kids will understand my pain).
    thanks
    AT

    If you downloaded the update from the phone, and using an older version of iTunes, yes that should do it.

Maybe you are looking for

  • Error while deploying a business process

    Hi all. Am new to Integration Server development. I got this error while deploying my business process. ERROR: <Feb 15, 2004 3:19:41 PM GMT+05:30> <Warning> <DRS> <BEA-002506> <The current ve rsion 6 for DataIdentifier DataIdentifierID: 1 does not ma

  • Weird battery issue

    Hello here, I have an iBook 12" G4 @1.2GHz which is around 2.5 years old. Now, it's about 2 weeks that the battery doesn't charge more than 44%, I tried to discharge it completely then recharge it but to luck, it keeps stopping charging at 44%. Any i

  • Unix standard input/output

    My issue is: how can I read from Unix standard input in Java when it is piped from another Unix program. For instance: `cat foo.txt | java MyProgram ?????' . Should I follow this way or should I do in another way? Thanks puccio.

  • Untrusted Applet Connection Restrictions

    Hi, There is a security rule that untrusted applets and WebStart applications may connect only to hosts from they was downloaded. But I could not find any strict definition of this rule. What does it mean "downloaded"? Different parts of an applet ma

  • Creating an ES using the ProComp model, implementation

    Dear, I succesfully created my Enterprise Service, at least the definition part, and am now ready to implement it in SPROXY. I'll probably just do an RFC to the R/3 system to retrieve some data and send that to the response of my Enterprise Service.