Resizing a JList with variable row heights, not updating the "picture"

Firstly I would like to apologize for posting this Swing question here, but I was unable to find the Swing category, if someone could direct me to that I would be most grateful.
Ok, so in abstract what I am trying to do is have a JList with resizable rows to act as a row header for a JTable (exactly like the row headers in OO Calc or MS Excel).
What I have is a RowHeaderRenderer:
public class RowHeaderRenderer extends JLabel implements ListCellRendererand it has a private member:
private Vector<Integer>        _rowHeights            = new Vector<Integer>();which contains a list of all the variable row heights.
Then there is my getListCellRendererComponent method:
    public Component getListCellRendererComponent(    JList         list,
                                                      Object        value,
                                                      int           index,
                                                      boolean       isSelected,
                                                      boolean       cellHasFocus)
        // Make sure the value is not null
        if(value == null)
            this.setText("");
        else
            this.setText(value.toString());
        // This is where height of the row is actually changed
        // This method is fed values from the _rowHeights vector
        this.setPreferredSize(new Dimension(this.getPreferredSize().width, _rowHeights.elementAt(index)));
        return this;
    }And then I have a row header:
public class RowHeader extends JList implements TableModelListener, MouseListener, MouseMotionListenerand you may be interested in its constructor:
    public RowHeader(JTable table)
        _table = table;
        _rowHeaderRenderer = new RowHeaderRenderer(_table);
        this.setFixedCellWidth                        (50);
        this.setCellRenderer                        (_rowHeaderRenderer);
        // TODO: grab this value from the parent view table
        JScrollPane panel = new JScrollPane();
        this.setBackground(panel.getBackground());
        this.addMouseMotionListener                    (this);
        this.addMouseListener                        (this);
        this.setModel                                (new DefaultListModel());
        table.getModel().addTableModelListener        (this);
        this.tableChanged                            (new TableModelEvent(_table.getModel()));
    }and as you can see from my mouse dragged event:
    public void mouseDragged(MouseEvent e)
        if(_resizing == true)
            int resizingRowHeight = _rowHeaderRenderer.getRowHeight(_resizingRow);
            _rowHeaderRenderer.setRowHeight(_resizingRow, resizingRowHeight + (e.getPoint().y - _cursorPreviousY));
            _cursorPreviousY = e.getPoint().y;  
    }all I am doing is passing the rowHeaderRenderer the values the currently resizing row should be, which works fine. The values are being changed and are accurate.
The issue I am having is that while this dragging is going on the row does not appear to be resizing. In other words the "picture" of the row remains unchanged even though I change the values in the renderer. I tried calling:
this.validate();and
this.repaint();at the end of that mousedDragged method, but to no avail, neither of them worked.
Again, I verified that I am passing the correct data in the RowHeaderRenderer.
So, anyone have any ideas how I should get the image of the RowHeader (JList) to update after calling my MouseDragged event?
Thank you for your time,
Brandon

I was able to fix this some time ago. Here is the solution:
     public void mouseDragged(MouseEvent e)
          if(_resizing == true)
               int newHeight = _previousHeight + (e.getPoint().y - _cursorPreviousY);
               if(newHeight < _minRowHeight)
                    newHeight = _minRowHeight;
               _rowHeaderRenderer.setRowHeight(_resizingRow, newHeight);
               _table.setRowHeight(_resizingRow, newHeight);
          this.updateUI();
     }

Similar Messages

  • Problem with ios certificate server not updating the CRL

    Hi all,
    The background is that i'm currently setting up a DMVPN solution with the ipsec tunnels between the spokes created using certificates.
    I'm using a cisco 877 as the CA server (its running 12.4(6)T5) to provide the certificates to the spoke routers. This part is working fine - the spokes can request a certificate and get one issue all well and good.
    The problem is on the CA, the CRL lifetime is set to 24 hours but the CA is not updating the CRL so when the spokes look for the revocation list (as set in their trustpoint) they are reporting an error that the CRL is out of date and won't connect.
    If is do a '#sh crypto pki server' it lists a 'CRL NextUpdate timer. this has a timestamp that is 24 hours after the last certificate was revocked. The only way i can get the CRL to be re-generated is to revoke a certificate.
    So, my question is, have i missed something here? I thought the CA would automatically generat a new CRL file every 24hours.
    Can anyone help?
    thanks.

    Hi Mark (?)
    this seems to match this bug:
    CSCsy95838    IOS CA: CRL not updated, update timer no started
    However it does not mention if 12.4(6)T5 is affected, only that it was found in 12.4(15)T3 and resolved in 12.4(15)T10 and other more recent releases.
    I would suggest trying the latest 12.4(15)Tx, 15.0(1)Mx or 15.1(4)Mx release if you can.
    I supposed you've though of it, but just in case: as a workaround you can disable the CRL check on all the DMVPN routers, obviously they will still allow connections from routers with a revoked spoke.
    As a (temporary?) replacement for a CRL, you could use a "certificate ACL" with which you can kind of create a "manual local CRL" :
      crypto pki certificate map certACL 10
       serial-number ne
       serial-number ne
       etc.
      crypto pki trustpoint myTP
       match certificate certACL
    (note the "ne" stands for "not equal" so you are permitting any certificate whose serial number is not listed)
    Obviously you would have to configure (and maintain!) this on each router participating in the DMVPN so this is cumbersome, but I suppose if you don't often revoke certs it might be an option.
    hth
    Herbert
    If this post answers your question, please click the "Correct Answer" button

  • When I sync my iPad with iTunes it does not update the play count?  Is there a setting I need to change?

    When I sync my iPad with iTunes it does not update my play counts.  Is there a way to make this happen?

    Are you using iTunes Match by chance?  I had no problems whatsoever with play counts synching between any of my devices until I started using iTunes Match.  I turned it off and magically my play counts synced.  Once. Hasn't happened again though. 

  • Syncing my iPad with my iMac will not update the apps software

    Whenever I sync my iPad Air 2 to my iMac the updated apps on the iMac will not update the apps in the iPad. I have rebooted the iMac and iPad, tried different cords, and checked all settings. All other things in the iPad sync properly.

    Are you using iTunes Match by chance?  I had no problems whatsoever with play counts synching between any of my devices until I started using iTunes Match.  I turned it off and magically my play counts synced.  Once. Hasn't happened again though. 

  • When I sink my phone with itunes it will not update the data on the phone?

    I added some CD's to my itunes library and was trying to sync them on to my iphone 5 and they will not sync. I have tried everything,

    Why not?
    Any errors?
    What is selected to sync?

  • How to insert a table with variable rows in smart form

    Hi all,
    How to insert a table with variable rows in smart form?
    Any help would be appreciated.
    Regards,
    Mahesh.

    Hi,
    Right click the mouse->create->table
    If you want 5 columns, you need to declare 5 cells in one line type of the table
    Click on Table -> Details, then do the following
    Line Type 1 2 3 4 5
    L1 2mm 3mm etc
    Here specify the width of the columns as many as you want..
    then in the header/main area of the table, click create Table Line, Rowtype is L1, automatically 5 cells will come,In each cell create a text element, display the variable to be printed there.

  • Contact sheet with variable rows/columns

    I'm interested in an InDesign Contact Sheet script/plug-in that is capable of creating a contact sheet with variable rows and columns, allowing amages to be placed at 100%. For example, say I have 20 images all of various dimensions. I'd like to place each one on an ID page at 100% while fitting as many on a single page as possible. So if one of the images was 8in x 10in then it would be the only image on the page, assuming a page size of 8.5 x 11. If smaller images were included in the same batch though, they would be placed as many across and as many down as could fit. Any images larger than the select page size would scale to fit on the page.
    All of the existing solutions I've found so far force you to choose the number of rows and columns and then images are scaled to meet those requirements.
    Does anyone know if such a solution is out there?

    A stand-alone app that can do the same thing, essentially create scatter proofs, may work as well. If anyone knows of such a thing I'd be interested to hear.

  • Automatic Row Processing (DML) process is not updating the record

    Hi all,
    I have an application which was working fine last week and tested and backuped to new application. This Monday, one of the form in that application is not updating the data all of a sudden. I debug that by having page 0 variable and assign the value from the column variable to page 0 variable. Whatever value I changed to the column variable was getting updated to page 0 variable. But it is not updated in the database. So, I changed the success message of the "Automatic Row Processing (DML) process" and I can see the success message on the page, but the column value does not get updated. But when I go back and checked my backup application, that page is working fine. For now, I copy that from the backup application, but I would like to know why this is happening?
    Thanks
    SHY

    Hi Scott,
    Thank you very much for your response. Because of the database complexity, I can't create/import the application on the apex.oracle.com. I am just wondering why this is happening. One of my coworker said same thing happened to her in one of her project and it gets resolved once she restart the server. I am not able to restart the server to check and see if this resolved as the application is on the client server. Do we need to clean up any log file? Thanks.
    SHY

  • When i take a picture with my iphone and then forward the picture in an email (regardless of picture size) it will not send - any thoughts????? Thanks.

    When I take a picture with my iPhone and then forward the picture to an emaila ddress (regardless of picture size) it will not send the email with the pciture enclosed - any thoughts on how to fix ?????
    Thanks -

    The collum to the right listed similar problems.  The solution appears to be that under smtp outgoing settings the user name and password are listed as optional.  I have not plugged in the information and it seems to be working.  However from my office it always allowed the relaying.  The true test will be when I try to respond later from the road.
    Thank you for your help.

  • I just lost my iphone5 in a foreign country. Was not able to register it with icloud and have not installed the findmy iphone app. How can i wipe out my data remotely without these setups? Please help!

    I just lost my iphone5 in a foreign country. Was not able to  previously register it with icloud and have not installed the findmy iphone app. How can i wipe out my data remotely without these setups? Is there any good app i can use to track it? Please help!

    No, nothing you can do to track it if you did not take any measures before the loss.

  • Can you share files in the cloud with people who are not on the team?

    Just wondering if you can share files with people that are not on the team. The paid for team members.

    They have not upgraded to iOS 5

  • The located assembly's manifest definition with name 'openfoundation' does not match the assembly re

    Ok. been working on this for the better part of a day. I am having trouble with the .net web controls. trying to create a simple portlet that populates a text box with values from a 2nd text box when a button is selected. both text boxes are in the same portlet.
    without using the <httpModules> entry in the web.config file the portlet works fine, but it does pop you out of the portal.
    setup: working in a Dev. environment with portal and portlets on the same box.Portal version is 5.0.2.EDK version is 5.0.2.
    error:
    The located assembly's manifest definition with name 'openfoundation' does not match the assembly reference.Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.IO.FileLoadException: The located assembly's manifest definition with name 'openfoundation' does not match the assembly reference.Source Error:An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.Assembly Load Trace:The following information can be helpful to determine why the assembly 'openfoundation' could not be loaded.=== Pre-bind state information ===
    LOG: DisplayName = openfoundation, Version=2.0.9.3152, Culture=neutral, PublicKeyToken=d0e882dd51ca12c5
    (Fully-specified)
    LOG: Appbase = file:///c:/inetpub/wwwroot/netTest
    LOG: Initial PrivatePath = bin
    Calling assembly : dotnetportlet, Version=3.5.0.1, Culture=neutral, PublicKeyToken=null.
    ===
    LOG: Publisher policy file is not found.
    LOG: No redirect found in host configuration file (C:\WINNT\Microsoft.NET\Framework\v1.1.4322\aspnet.config).
    LOG: Using machine configuration file from C:\WINNT\Microsoft.NET\Framework\v1.1.4322\config\machine.config.
    LOG: Post-policy reference: openfoundation, Version=2.0.9.3152, Culture=neutral, PublicKeyToken=d0e882dd51ca12c5
    LOG: Attempting download of new URL file:///C:/WINNT/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET Files/nettest/9e6689f5/a0d2f067/openfoundation.DLL.
    LOG: Attempting download of new URL file:///C:/WINNT/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET Files/nettest/9e6689f5/a0d2f067/openfoundation/openfoundation.DLL.
    LOG: Attempting download of new URL file:///c:/inetpub/wwwroot/netTest/bin/openfoundation.DLL.
    WRN: Comparing the assembly name resulted in the mismatch: Minor Version
    Stack Trace:[FileLoadException: The located assembly's manifest definition with name 'openfoundation' does not match the assembly reference.]
       Plumtree.Remote.Portlet.PortletContextFactory.CreatePortletContext(HttpRequest req, HttpResponse resp) +0
       Com.Plumtree.Remote.Transformer.Condition.GatewayedStandardCondition.UseFilter(HttpContext ctx)
       Com.Plumtree.Remote.Transformer.FilterManager.UpdateFilter(HttpContext ctx)
       Com.Plumtree.Remote.Transformer.PTTransformer.BeginRequestHandler(Object sender, EventArgs e)
       System.Web.SyncEventExecutionStep.System.Web.HttpApplication+IExecutionStep.Execute() +60
       System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +87
    Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET Version:1.1.4322.947
    ************************************************************Is there any step by step instructions for setting up and using the .net web controls in Plumtree????
    There doesn't seem to be any information in one spot as to setting up the environment to use the .Net Web Controls. I have had to piece together information from multipule threads to get this far. I.E. there was nothing in any documentation that I have read that required the installation of the VJ# lib's. (that error took me the first half of the day to resolve :-) )
    Thanks for any help,
    Greg************************************************************

    Also, when reviewing the Plumtree_.NET_Web_Controls_InstallLog.log there were 5 nonfatal erros. These error's were:
    Install File: E:\plumtree\ptwc\2.0\bin\assemblies\edk.dll Status: ERROR Additional Notes: ERROR - java.io.FileNotFoundException: E:\plumtree\ptwc\2.0\bin\assemblies\edk.dll (The process cannot access the file because it is being used by another process)
    Install File: E:\plumtree\ptwc\2.0\bin\assemblies\jsregistry.dll Status: ERROR Additional Notes: ERROR - java.io.FileNotFoundException: E:\plumtree\ptwc\2.0\bin\assemblies\jsregistry.dll (The process cannot access the file because it is being used by another process)
    Install File: E:\plumtree\ptwc\2.0\bin\assemblies\log4net.dll Status: ERROR Additional Notes: ERROR - java.io.FileNotFoundException: E:\plumtree\ptwc\2.0\bin\assemblies\log4net.dll (The process cannot access the file because it is being used by another process)
    Install File: E:\plumtree\ptwc\2.0\bin\assemblies\openfoundation.dll Status: ERROR Additional Notes: ERROR - java.io.FileNotFoundException: E:\plumtree\ptwc\2.0\bin\assemblies\openfoundation.dll (The process cannot access the file because it is being used by another process)
    Install File: E:\plumtree\ptwc\2.0\bin\assemblies\Plumtree.WCFilter.dll Status: ERROR Additional Notes: ERROR - java.io.FileNotFoundException: E:\plumtree\ptwc\2.0\bin\assemblies\Plumtree.WCFilter.dll (The process cannot access the file because it is being used by another process)
    When installing the Web Control's do you need to stop any services? I didn't see anything in the install notes about doing this?

  • This test checks whether the length of the environment variable "PATH" does not exceed the recommended length.

    when i am going to Install 11gR2 then thsi error shows how to solve it plz give me guidance
    This test checks whether the length of the environment variable "PATH" does not exceed the recommended length.
    Expected Value:     1023
    Actual Value:          0

    HELLO iSHAN SHAH
    JUST EXPLAIN US YOUR PROBLEM IN DEPTH.
    TELL US YOUR HARDWARE AND SOFTWARE CONFIGURATION.
    ALSO TELL US IN WHICH STEP OF INSTALLATION , THIS ERROR RAISED.
    THANKS
    HARSH SHAH

  • Hello Please help me   I have worked erased     IPhone exists with me     But did not finish the process erased     What is the solution??

    Hello
    Please help me
    I have worked erased
    IPhone exists with me
    But did not finish the process erased
    What is the solution??

    Post in your native language, the above make not sense.

  • Help export the graphic with transparent background and not braking the quality

    hi I'd like some help please if its possible.
    I've created a monitor graphic in Fireworks that looks like iMac and I would like to export it with transparent background.
    the jpeg format looks great with no damage to the graphic at all but I can't have transparent background, although I changed the canvas fill to none. the png-8 format can apply transparent background, but damages the graphic.
    Here are the previews
    1st - the png-8 format
    2nd - thejpeg format
    A ny ideas on how I can export the graphic with transparent background and not braking the quality??

    Fireworks questions are best answered at this link:
    <http://forums.adobe.com/community/fireworks/fireworks_general>
    Good luck.

Maybe you are looking for