A question only experts can answer

Hi, all
I created a class "JoeTable" that extends JTable. It has 3 columns the first 2 columns use JComboBox editor. I meant for JoeTable to behave like this:
When the user clicks on one of the cells in the first 2 columns and change the value of the cell by using JComboBox, the TableModelListener added to JoeTable's TableModel will clear the 3rd cell out. My code went as below:
joeTableModel.addTableModelListener(new TableModelListener(){
public void tableChanged(TableModelEvent e)
if (getSelectedRow() == -1 || getSelectedColumn() == -1)
return;
if (e.getType() == e.UPDATE)
if (e.getColumn() == FIRSTCOLUMN
|| e.getColumn() == SECONDCOLUMN)
FilterTable.this.setValueAt(null, getSelectedRow(), THIRDCOLUMN);
return;
Now, when the user changes the value of one of the first 2 columns , the 3rd cell is cleared all right. The problem is, when the user click on one of the cells in the first 2 columns without changing its content, the tableChanged() method also catches an "UPDATE" event and clear the corresponding cell in the 3rd collumn. Does anyone know why? Any help would be highly appreciated.
Thanks
JimorJoe

this code block realy works
public class ThreeColumnTable extends JTable{
     public ThreeColumnTable(){
          super(5,3);
          int cols = getColumnCount();
          for(int i = 0; i < cols; i++){
               TableColumn col = getColumn(getColumnName(i));
               col.setPreferredWidth(30);
               if (i != 2)
                    col.setCellEditor(new ComboCellEditor());
               else
                    col.setCellEditor(new DefaultCellEditor(new JTextField()));
public class ComboCellEditor extends JComboBox implements ItemListener,
          TableCellEditor{
     private JTable table;
     private int row;
     private int col;
     public ComboCellEditor(){
          super();
          addItem("first item");
          addItem("second item");
          addItem("third item");
          addItemListener(this);
     public void itemStateChanged(ItemEvent e){
          if (e.getStateChange() == e.DESELECTED){
               table.setValueAt("",  row, 2);
               table.setValueAt(getSelectedItem(), row, col);
     public Object getCellEditorValue(){
          return getSelectedItem();
     public boolean isCellEditable(EventObject anEvent){
          return true;
     public boolean shouldSelectCell(EventObject anEvent){
          return true;
     public boolean stopCellEditing(){
          return true;
     public void cancelCellEditing(){
    public void addCellEditorListener(CellEditorListener l){
     public void removeCellEditorListener(CellEditorListener l){          
     public Component getTableCellEditorComponent(JTable table, Object value,
               boolean isSelected,
               int row, int col){
          this.row = row;
          this.col = col;
          this.table = table;
          return this;
}

Similar Messages

  • A real challenged task in BW - Only experts can solve it

    Hi BW experts,
    I get a new task, to create a cube for analyzing our products at the customers.
    The customers send us some files that contain some products details.
    For examples, let's say thta the products are computers and the files are:
    1. Operation system
    customer ID, product ID, OS name, OS version
    2. Firewall properties
    customer ID, product ID, FW property name, FW property value
    3. Browser details
    customer ID, product ID, browser name, browser version
    Each customer ID and product ID may have more than one record. In other words they not the key of the table.
    The questions that we would like to ask, are:
    1. How many many customers have OS name = Linux.
    2. Which customer have product ID = 111, and fw_property_name = zzz and browser name = Mozilla.
    3. How many customers have OS_name = windows AND
    browser_name = mozilla.
    Can you please assist of it?
    Best regards,
    Mohamad.

    Hi Philipp,
    Thank you for the replying.
    Please look at the example below;
    1. Operation system
    customer ID, product ID, OS name, OS version
    111 , comp01 , Window , XP
    2. Firewall properties
    customer ID, product ID, FW property name, FW property value
    111 , comp01 , FW_Protection_extent , Full
    111 , comp01, Is_AntiSpy_switched_on, true
    3. Browser details
    customer ID, product ID, browser name, browser version
    111 , comp01 , Internet Explorer , 7.0
    111 , comp01 , Mozilla , 2.0
    As your suggestion, the fact table should be like this:
    customer ID, product ID, OS name, OS version, FW property name, FW property value, browser name, browser version , KeyFigure(Fix value = 1)
    Therefore, we need to perform a JOIN between all the files above, and then load them to the cube. What we will get is;
    111,comp01,Window,XP,FW_Protection_extent,Full,Internet Explorer , 7.0 , 1
    111,comp01,Window,XP,FW_Protection_extent,Full,Mozilla , 2.0 , 1
    111,comp01,Window,XP,Is_AntiSpy_switched_on, true,Internet Explorer , 7.0 , 1
    111,comp01,Window,XP,Is_AntiSpy_switched_on, true,Mozilla , 2.0 , 1
    This will solve our issue, but the problem of this solution that if each file contains 1000 records, then the JOIN will give 100010001000 records. Therefore, it's not legitimate solution.
    Best regards,
    Mohamad

  • Several Questions Who Ever Can Answer

    I waited so long to get involved in this community because I was trying to research my answer on my own... there really needs to be an easier way.
    Ok so here are my questions;
    1. You can manually open the wizard by clicking Cloud on the menu and then clicking Setup Wizard.- where is all this?
    2. My photo's are awful on my droid razor - is there any way to make them better
    3. Sometimes when I go to make a phone call, it won't let me long in - it says something like "Unfortunately Contacts has stopped"  (I just tested it to see what it would say and viola.. it happens all the time annoying..just saying)
    So if anyone would be so kind to help me with these questions, I would appreciate it.

        BrendaCW,
    We're here to help with any concerns you have! We want to make sure your phone works awesome for you.
    1. Are you trying to set up the Cloud? Is it listed under your full apps list? If not, you would do a search for it in the Play Store and download the Verizon Cloud application.
    2. What issues are you having with your photos? Have you tried adjusting settings like the flash to see if they make any difference?
    3. How often does this error happen? When it does, if you try to open that again does it then work?
    AndrewT_VZW
    Follow us on Twitter @VZWSupport

  • Just a question hope someone can answer

    I have video playlists but apparently the videos in my play lists also show up under the movie tab in my iPod, the question is does it take up double the space becuase the videos are in the video playlists and under the movie tabs?

    No the menu and the playlist are just pointing you to the same file, in the same way that a song can show up under songs and artist etc.

  • Eclipse question if you can answer

    Just curious. where can i find the generated servlet code in eclipse? Like i have a j2ee project in eclipse name JSPEXAMPLE and then i have a jsp page which is in JSPEXAMPLE/WebContent/WEB-INF. i have this jsp code.
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
        pageEncoding="ISO-8859-1"%>
    <%@ page import = "java.util.Calendar" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>Insert title here</title>
    </head>
    <body>
    The server time is now
    <%
      Calendar now =Calendar.getInstance();
      int hour = now.get(Calendar.HOUR_OF_DAY);
      int minute = now.get(Calendar.MINUTE);
      if(hour<10)
           out.println("0" + hour);
      else
           out.println(hour);
      out.println(":");
      if(minute<0)
           out.println("0" + minute);
      else
           out.println(minute);
    %>
    </body>
    </html>I would like to see my generated servlet. i can't find it anywhere. Any ideas?

    It's nothing to do with Eclipse, your sevlet container compiles JSPs. Refer to the docs for whatever container you're using to see where it puts them, or Google it. I can't remember where Tomcat puts compiled JSPs, sorry!
    Be prepared to see some pretty ugly code though :-)

  • Is it possible to chat in polish with Adobe experts or contact them by phone in Poland ? I have a question that is not answered on Adobe website.

    Is it possible to chat in polish with Adobe experts or contact them by phone in Poland ? I have a question that is not answered on Adobe website.

    Ok, I made a fresh provider hosted application to test out Dragan's suggested solution.
    You can view the repository here:
    https://github.com/mattmazzola/providerhosted_01
    After comparing this new application and the old one, I realized I had a misunderstanding of how the SP.RequestExecutor expected urls to be constructed. I thought it was required to use the SP.AppContextSite() endpoint.
    I was incorrectly constructing a request to the appWeb with a url similar to the following:
    https://contoso-6f921c6addc19f.sharepoint.com/ProviderHostedApp/_api/SP.AppContextSite(@target)/contextinfo?@target=%27https%3A%2F%2Fcontoso-6f921c6addc19f.sharepoint.com%2FProviderHostedApp%27
    As you can see, the @target was set to the appWeb url but infact when making request to the appWeb using RequestExecutor you do no need to do this.  It is simply appweburl + "/_api/contextinfo".  It is only when making requests for
    resources existing on the hostWeb that you need use the AppContextSite and set the @target.
    I think the link to the solution I provided is more helpful, but I marked Dragan's reply as the answer to give him credit for helping me.

  • I need to reset my Apple ID (a Yahoo account). My problem is the Yahoo account is disabled and can't be recovered and I don't remember the answers to the security questions. How can I reset my password?

    I had to reset my IPhone device to the factory setting, but when I wanted to start using the IPhone, it requires the original Apple ID which I do not recall the password. I tried to reset the password by receiving it through my Yahoo account (Apple ID) I found out that the email has been disabled due to the long period I didn't use it and can not be recovered moreover I do not remember the answers to the security questions.
    I need help on how to reset my Apple ID password as I cant not use my IPhone any more.

    Alternatives for Help Resetting Security Questions and/or Rescue Mail
         1. If you have a valid rescue email address, then use this procedure:
             Rescue email address and how to reset Apple ID security questions.
         2. Fill out and submit this form. Select the topic, Account Security. You must
             have a Rescue Email to use this option.
         3. This is the only option if you do not already have a valid Rescue Email.
             These are telephone numbers for contacting Apple Support in your country.
             Apple ID- Contacting Apple for help with Apple ID account security. Select
             the appropriate country and call. Ask to speak to the Account Security Team.
         4. Account security issues almost always require you to speak directly to an
             Apple representative to securely establish your identity as the account holder.
             You can set it up so that Apple calls you, either immediately or at a time
             convenient to you.
                1. Go to www.apple.com/support.
                2. Choose Contact Support and click Contact Us.
                3. Choose Other Apple ID Topics and choose the appropriate topic for
                    your issue.
                4. Follow the onscreen instructions.
             Note: If you have already forgotten your security questions, then you cannot
             set up a rescue email address in order to reset them. You must set up
             the rescue email address beforehand.
    Your Apple ID: Manage My Apple ID.
                            Apple ID- All about Apple ID security questions.

  • Have questions? We have answers! Jan .11, 2011 Expert Day

    Thank you for coming to Expert Day – the event has now concluded.  
    To learn about future HP Expert Day events, click here.
    On behalf of the Experts, I would like to thank you for coming to the Forum to connect with us.  We hope you will return to the boards to share your experiences, both good and bad.
    We will be holding more of these Expert Days on different topics in the months to come.  We hope to see you then!
    +++++++++++++++
    Welcome!
    We are glad you came to Expert Day.  There are more than 150 experts available to share their insights with you.
    How the event will work:
    Our team of experts will be monitoring the printer and all in ones, notebook, and desktop boards and jumping into the conversation to tackle your toughest questions.
    You can easily recognize our experts out on the Forum.   If they have the label “Pro” under their names, they are HP employees. If they have the word “Expert” under their names, they are people that are very knowledgeable but who are not employed by HP.   
    If you have specific product questions, the more information you give us the better we will be able to assist you.  Having your exact model number, any error messages, what operating system version are you running, and any recent hardware or software changes will go a long way in helping us solve your problem.  The experts may need to get some more information from you so please subscribe to the conversation, and an online conversation will be born.
    While we do have experts from around the world, many of them are located on the west coast of the United States. As a result, you will likely see more replies during normal waking hours in the United States, however many of our experts are even planning on logging in to help you from their homes!
    Expert Day will also be taking place on the Commercial, Simplified Chinese, and Korean forums.
    So, please join the conversation. This is your chance to connect with the best and brightest minds at HP for free.  Whether you own a Photosmart printer, HP Envy notebook or an HP home desktop computer, there has never been a better opportunity to learn about your product.
    We look forward to hearing from you!
    I work for HP, supporting the HP Experts who volunteer their time and technical knowledge to help others.

    MemphisBelle wrote:
    Dear Mr. Matthews:   The time frame was noon on the 11th to noon on the 12th.  Yes, that's 24 hours, all right.  But wouldn't a lot of people have thought it would encompass workdays on the 11th and 12th?  (8  - 5,  etc)
    Had I known the clock started ticking at 1200  hours on the 11th and stopped at 1200 hours the 12th, I might have received some assistance.
    The "Expert Days" event are held a few times a year and bring in an extra hundred or more experts from HP and other areas.  While there are more experts on hand on these days (and more people here posting questions) the forums are open 24/7/365.  There are experts here every day answering questions.  But if you do not post a question you will not get a reply....
    Find an appropriate sub forum for your topic and look near the top of the page for suggestions on how to ask good questions.  Provide plenty of details of the issue including your computer or printer model, what operating system and what exactly the issue you have, including any error messages.
    Bob Headrick,  HP Expert
    I am not an employee of HP, I am a volunteer posting here on my own time.
    If your problem is solved please click the "Accept as Solution" button ------------V
    If my answer was helpful please click the "Thumbs Up" to say "Thank You"--V

  • Hello Experts, I have a question, how I can import "linq" file to ms sql?

    Hello Experts, I have a question, how I can import linq (OpenUIPlayersDB.linq) file to ms sql? Form Sample OpenUI applications?
    BR
    Lukas

    Lukas,
    The .linq file is just a sql script.  You can either change the extension to .sql and directly open and run in SQL Server Management studio or open the file directly.
    The script is designed to run against SQL server so if you are using another database type you may need to tweak the script (date/time formats, data types, column select statement).
    Also, last I checked the name of the table from the script (OpenUIPlayers) doesn't match the table name from the OpenUI-app.agxz export so you will also need to adjust either the script in the export or the name of the imported table once you finish loading it.
    --Bill

  • HT5312 How can. Reset my apple security questions when trying to answer them

    W does it not give me a option to reset my security questions in the iTunes Store before purchasing a app

    The option to send reset info, as described on the page that you posted from, only show if you have a rescue email address (which is not the same thing as an alternate email address) set up on your account.
    If you don't have a rescue email address (you won't be able to add one until you can answer 2 of your questions) then you will need to contact iTunes Support or Apple to get them reset.
    e.g. you can try contacting iTunes Support : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page, then Account Management , and then try Apple ID Account Security
    or try ringing Apple in your country and ask to talk to the Accounts Security Team : http://support.apple.com/kb/HE57
    When they've been reset you can then use the steps half-way down this page to add a rescue email address for potential future use : http://support.apple.com/kb/HT5312

  • Ok.  I hope someone can answer my question.  I am new to photoshop.  I need version cs4 in order to work with a designer and printer on some logo work. I've tried to download it but it just gives me individual files with no installer and nothing - includi

    ok.  I hope someone can answer my question.  I am new to photoshop.  I need version cs4 in order to work with a designer and printer on some logo work. I've tried to download it but it just gives me individual files with no installer and nothing - including the adobe "instructions" seems to work.  How can i get this software in a downloadable format? is it actually free - I'm assuming it is...  Hope someone knows the answer to these questions...

    The download itself is free and is valid for 30 days only.  After that, the software ceases to work.
    CS4 is pretty old, no longer sold and no longer supported by Adobe.  It's also not compatible with many modern OSes.
    Why do you have to work with such an obsolete version of Photoshop?
    What kind of "designer" uses it?

  • Where do I go to pick 3 security questions?  I can only find the option for one.

    I really want to redeem my code for my free movie, but it wants me to pick three security questions.  When I manage my id it only gives me the option for one.  Please help.

    Usually you will need to contact iTunes store support but this workaround may help:
    -On the device/computer that is asking you for the security questions go to "settings", > "store" > tap the Apple ID and choose view"Apple ID" and sign in.
    - Tap on payment information and add a credit/debit card of your preference then select "done", in the upper right corner
    - Sign out and back into iTunes on the device by going to "settings"> "store" > tap the Apple ID and choose "sign-out" > Tap "sign -in" > "use existing Apple ID" and you should be asked to verify your security code for the credit/debit card and NOT the security questions.
    - At this time you can remove the card by going back in to edit the payment info and selecting "none" as the card type then saving the changes by selecting "done". You should now be able to use your iTunes store credit without answering the security questions.

  • I can not r ember my answers to my questions so i can buy apps

    I can not get in to my account to buy apps i have anserd my QUESTION AND I CAN STILL NOT GET IN. WHAY DO YOU MAKE IT SO HARD? I HAD A PASSWORD THAT WORKED AND THEN YOU WOULD NOT LET ME USE IT????????? I HAVE A NEW I PAD AND I HAVE NOT A THING ON IT BECOUSE YOU WILL NOT LET ME ON MY ACCOUNT I AM VERY OVER IT
    VERY UP SET............ I HAVE 3 I PADS AND MY ONLY PROBLEN IS MY ACCOUNT THAT WILL NOT LET ME SPEND MY MONEY IT IS MY MONEY
    RAYLENE DAWN GORDON

    See Kappy's great User Tips.
    See my User Tip for some help: Some Solutions for Resetting Forgotten Security Questions: Apple Support Communities https://discussions.apple.com/docs/DOC-4551
    Send Apple an email request for help at: Apple - Support - iTunes Store - Contact Us http://www.apple.com/emea/support/itunes/contact.html
    Call Apple Support in your country: Customer Service: Contacting Apple for support and service http://support.apple.com/kb/HE57
     Cheers, Tom
    PS Don't type in all CAPS. It's considered SHOUTING and harder to read. Some helpers will not not when you use all caps.

  • Where do you go when no one can answer your question?

    Hi
    I have posted over 10 times the same question in various ways yet no one can answer in a way that works
    "Have asked about an error I keep getting when trying to sync. ("* -[NSCFDictionary setObject:forKey:]: attempt to insert nil value" )No replies after asking 8 times so I surrender. Is there any way to erase all the entries (I have over 6000) and re upload? Right now .Mac only can delete up to 50 or 1 page at a time. Is there another way to delete the address book?
    Thanks"
    The advanced tab reset doesn't update the .mac server version so the only way seems to be delete 50 at a time out of 6500 entries. How can I do an old school overwrite without confusing the computers as to which is which machine?
    Any place I can go from here?

    I looked back at the message Austin cited, and if I understand what you've posted above, you're not correcting the underlying issue.
    First, you have seriously corrupted Address Book records on your source computer. If you had replaced those corrupted records with what I assumed would have been the intact records from .Mac, you would likely have resolved the underlying problem. But, as I understand what you've posted above, you did the opposite: you replaced the records on .Mac with the corrupted records on your source computer. It's not clear that the .Mac record set is now corrupted, and it should not be, but—on the other hand—it might be.
    For the record, you should not have been able to successfully replace the record set on .Mac with corrupted data: it should have transferred only intact and valid data, or failed in an attempt to transfer corrupted records. The problem here is that there is not a one-to-one correlation between the Address Book schema and the .Mac schema for contact information, so it may have successfully passed the good data common to both environments, and not attempted to pass what incidentally are corrupted components.
    You may be able to locate and fix each reported record only by using a utility provided by John Morgan, called ABFinder II. Send a message to the address listed in my Public Profile, and I'll reply with a copy. That application will allow you to identify the person referred to as CE45BC4E-4423-11DB-94EC-00050271EFEF:ABPerson, for example. By looking at both the error message and that specific record, you can correct the data in the referenced filed in that record, or recreate the record and delete the original.
    You cannot synchronize successfully via .Mac—particularly across both the Mac OS X 10.3 and 10.4 mixed environment you have—until you either correct the underlying issue record by record, or do a wholesale replacement of the corrupted Address Book on your source computer from some other uncorrupted source: .Mac, a backup - something that does not contain the records with nil values.
    The particular circumstances of your issue are complex, and really not at all clear. I cannot tell you how the initial corruption occurred on a record by record basis, or even how to avoid it in the future. If you hope to fix it, you'll have to be patient and attempt to do so record by record if no intact, uncorrupted copy of your contact record set is available. There is no quick fix to save the existing data.
    And, Austin's right: there really is no one to talk to, though you could drag your source computer into an Apple Store and ask an Apple Genius to look at it, or go to an independent authorized dealer and ask someone familiar with such issues to look at it. You can find a service location by using this tool:
    http://www.apple.com/buy/locator/service.html

  • Remember only the icloud email address, forget the password, birthdate, and verification questions. How can i get the icloud email back?

    Remember only the icloud email address, forget the password, birthdate, and verification questions. How can i get the icloud email back?

    Go to https://getsupport.apple.com ; click 'See all products and services', then 'More Products and Services, then 'Apple ID', then 'Other Apple ID Topics' then 'Forgotten Apple ID security questions'.

Maybe you are looking for

  • How to Delete Rejected Payment Drafts?

    Hi All, How to delete rejected payment drafts from the SAP B1 system.I don't know if it is possible or not.If it is possible please give the solution for this. Regards, silpa.

  • Borderless Printing Help

    I really need some borderless printing help. I finally figured out with my printer, that the bottom margin is ridiculously offset so I need to use borderless printing to prevent the bottom footer from being cut off (HP 2610 printer, margins being rea

  • Please let me know that what is the operator in Thailand for my iPhone.

    Dear friendly, Please help me, I want to know that what is the operator in Thailand of my phone if you can check please tell me and for information of my iPhone as following. For operator in Thailand such as True Move, AIS, Dtac or Apple Thailand. iP

  • Permissions Repair Warning Explanation Please

    Hello Everyone, It's been a while since I last posted on the Apple forums. I just installed the Mac OSX 10.6.3 v1.1 Combo Update. After doing so, I launched Disk Utility and ran "Repair Permissions". At the very end of the permissions repair log, I f

  • Photoshop CC Image Assets Folder Question

    Can I move my Photoshop CC generated Image Assets folder away from the native file and keep it connected for updating?