JTable - programmatically setting the left column and top row

I have a JTable in a JScrollPane. I would like to be able to programmatically scroll the table so that a certain column is shown as the left most column in the table, and/or a certain row is shown as the first visible row in the table.
This is to allow a user to enter a value for the column or row that the want to be on the left or top of the viewport (ie, it is up to the user how they want to move the initially see the table).
Any help would be much appreciated,
Cheers, Sean

Here is one way to do it:
1) use the getCellRect(row,column,false) to get a rectangle for the cell you wish to display in the upper left corner
2) use the getVisibleRect() method to get the viewport
3) set the viewport x and y coordinate to be the same as the cell x,y coordinate
4) use the scrollRectToVisible method to scroll to the desired area
For example:
Rectangle cellRect=myTable.getCellRect(5,10,false);
Rectangle vis=myTable.getVisibleRect();
vis.x=cellRect.x;
vis.y=cellRect.y;
myTable.scrollRectToVisible(vis);
Caveat: posted code has not been tested!
;o)
V.V.

Similar Messages

  • Home sharing won't appear in the left column on iTunes for PC

    I have 2 macs that sharing works and that I have acces of home sharing in the left column.
    I just reinstalled XP and running iTunes 10.5.3 on my PC and everything is setted up like my macs but home sharing won't appear in the left column and I don't see the PC's library on my macs.
    Everything is turned on with the same email account.
    Is there a probleme on PC...

    FORGOT TO MENTION everything worked fine last week before I reinstalled XP

  • How do I get the Device link back into the left column so I can update to iOS 5. Don't know what I did with it.

    The Device link on my iTunes is missing. How do I get it back into the left column?

    Top Sites, you mean? You can instruct Safari to open these in the General section of the preferences.

  • Shuffle no longer syncs the playlists correctly and I cannot "see" the shuffle at all.  There is no "device" folder in the left column.  This may have occured after an Apple I-Tunes software update, but I am not sure. Software or hardware??

    Shuffle no longer syncs the playlists correctly and I cannot "see" the shuffle at all.  There is no "device" folder in the left column.  This may have occured after an I-Tunes software update, but I am not sure.  Is this likely a software issue or is the shuffle not working correctly?

    Shuffle no longer syncs the playlists correctly and I cannot "see" the shuffle at all.  There is no "device" folder in the left column.  This may have occured after an I-Tunes software update, but I am not sure.  Is this likely a software issue or is the shuffle not working correctly?

  • HT1386 I installed Snow Leopard and have the latest version of iTunes. However, when I connect my iPhone, it charges and iPhoto opens, but iTunes doesn't seem to recognize the iPhone. It simply doesn't appear in the left column. What gives?

    I installed Snow Leopard and have the latest version of iTunes. However, when I connect my iPhone 4S, it charges and iPhoto opens, but iTunes doesn't seem to recognize the iPhone. It simply doesn't appear in the left column. What gives?

    http://support.apple.com/kb/TS1591

  • My albums and slideshows disappeared from the left column when I ejected a Canon camera after a download.  My version of iPhoto '08 (V7.1.5(378)) had just crashed when I first connected the Canon camera to download.  I restarted iPhoto.....

    My albums and slideshows disappeared from the left column when I ejected a Canon camera after a download.  My version of iPhoto '08 (V7.1.5(378)) had just crashed when I first connected the Canon camera to download.  I restarted iPhoto.....successfully downloaded 22 photos, and ejected Canon camera, upon which albums & slideshows highlighted blue and disappeared from the left column.  The photos still seem to be under the EVENTS and PHOTOS in the LIBRARY.  Any thoughts?

    Restore from your back up.

  • Why can't anyone tell me how to remove all those little "!" in the left column all at once or at least sort them so I can mark them and then delete them?

    Why can't anyone tell me how to remove all those little "!" in the left column all at once or at least sort them so I can mark them and then delete them?

    This happens if the file is no longer where iTunes expects to find it. Possible causes are that you or some third party tool has moved, renamed or deleted the file, or that the drive it lives on has had a change of drive letter. It is also possible that iTunes has changed from expecting the files to be in the pre-iTunes 9 layout to post-iTunes 9 layout,or vice-versa, and so is looking in slightly the wrong place.
    Select a track with an exclamation mark, use Ctrl-I to get info, then cancel when asked to try to locate the track. Look on the summary tab for the location that iTunes thinks the file should be. Now take a look around your hard drive(s). Hopefully you can locate the track in question. If a section of your library has simply been moved, or a drive letter has changed, it should be possible to reverse the actions.
    Alternatively, as long as you can find a location holding the missing files, then you should be able to use my FindTracks script to reconnect them to iTunes.
    If, on the otherhand, you've been cleaning up your media from Explorer rather than iTunes and just want to eliminate the now broken links, use Tunes Folder Watch with its option to check for dead tracks on startup.
    tt2

  • Under the settings app there's the general column and under the accessibility section the is a setting called black over white does that drain your battery any more than the normal setting

    Under the settings app there's the general column and under the accessibility section the is a setting called black over white does that drain your battery any more than the normal setting

    Wow. I have not seen that question nor a discussion. I agree with James. I don't think it will, and if the power drain is different, maybe it'll be less and not more.
    With a 10 hour battery, you have plenty of time to test it and see. If the battery depletes fast, just go back to the other way.
    If you do try it, let us know what you discover.
    Thanks ! !

  • Looking for a way to programmatically set the visible portion of the front panel when a subVI opens

    I am looking for a way to programmatically set the visible portion of the front panel when a subVI opens.  Haven't found any posts that relate, but I'm not sure how to ask the right question.  To be clear, I want to write a helper VI to go through a list of subVIs to make sure the background images are all in the same place when their respective subVIs open.  I hate manually playing with scroll bars before I save each of the VIs...  I'm figuring I need to find the top/left location of the background image (know how to do this already) and then set a VI FP property to  these values or some offset, but I can't find the relevant property. FP:run-timeposition:custom looked promissing, but only affects the location of the window, not the area of the front panel the window is displaying.
    Solved!
    Go to Solution.

    Cool.  Getting closer.  The way I implemented your suggestion affects the subVI only if it is open.  I can use this to do what I'm after, perhaps putting the code into each subVI.  Maybe open all subs, run the helper, and save.    Seems like I'm missing the elegant version...
    My proof of concept code:

  • On calendar with ipad in day screen, when i sync with macbook pro i get a alert (time)in the left column on the ipad.

    when i'm on the calendar for the ipad, when i  sync with my macbook pro from what was put on that computer, when it transfers over to the ipad on the left column of the day screen, i always get an alert column-I dont get an alert column when i use the calendar in the ipad
    How can I delete the alert column on the ipad?
    Thx Randy

    If you can't boot in the usual way, try a safe boot. During startup, you’ll see a progress bar, and then the login screen, which appears even if you normally log in automatically. You must know your login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin. If you have more than one user account, you must be logged in as an administrator to carry out these instructions. Safe mode is slower than normal, and some things won’t work at all. Note: If FileVault is enabled on some models, or if a firmware password is set, or if the startup volume is on a software RAID, you can’t boot in safe mode. If you're able to boot, launch the Console application in any of the following ways: ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.) ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens. ☞ Open LaunchPad. Click Utilities, then Console in the icon grid. Select the most recent panic log under the heading System Diagnostic Reports on the left. If you don't see that heading, select   View ▹ Show Log List   from the menu bar. Post the entire contents of the panic report — the text, please, not a screenshot. In the interest of privacy, I suggest you edit out the “Anonymous UUID,” a long string of letters, numbers, and dashes in the header and body of the report, if it’s present (it may not be.) Please don't post shutdownStall, spin, or hang reports.

  • After the latest update I can no longer see my iPhone listed on the left column - how do you get to where you can pick

    After the latest itunes update I can no longer see my iPhone listed on the left column. How can I get to the section where I can pick & choose apps etc to be synced?
    Also I had to get a new iPhone & so I backed up the night before to the cloud & my computer. When I tried to restore from back up with the new phone my back up wasn't there - shouldn't it be automatic via wifi from the cloud?
    What am I doing wrong?

    Your iphone is shown at the top of the page.
    You can also simply click View>Show Sidebar and it will look about the same as it did before.

  • How to Programmatically Set the limit (max, min input) of a control inside a cluster?

    I want to programmatically set the limit (max, min input) of a control inside a cluster. (see attached VI).
    The max, min value will be read from a file. The input of the control must be within the range defined by the max and min value.
    Can anyone tell me how to do it?
    Thanks a lot for your kind help.
    Xiaogang

    Accessing the properties of a cluster (or array) is not a trivial operation until you have done it once. It's a two step (at least) process : first, ask for a reference (array of...) to the objects contained in the cluster, then tell LV what kind of object you are adressing.
    See the attachment.
    Chilly Charly    (aka CC)
             E-List Master - Kudos glutton - Press the yellow button on the left...        
    Attachments:
    How to set limit[1].vi ‏52 KB

  • Trying to programmatically set the data-source for a Crystal reports report.

    I've got the following existing procedure that I need to add to in order to programmatically set the data-source (server, database, username, and password) for a Crystal reports report.
     I added the connectionInfo parts, but can’t figure out how to attach this to the existing
    this._report object.
    This is currently getting the connection data from the report file, but I now need to populate this connection data from a 'config.xml' text file.
    Am I trying to do this all wrong?
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using CrystalDecisions.CrystalReports.Engine;
    using WGS.Reports.Reports;
    using CrystalDecisions.Shared;
    using WGS.Reports.Forms;
    namespace WGS.Reports
    public class ReportService
    ReportClass _report;
    ParameterFields paramFields;
    ConnectionInfo connectionInfo; // <- I added this
    public ReportService()
    public void DisplayReport(string reportName, int allocationNo)
    if (reportName.ToLower() == "allocationexceptions")
    this._report = new AllocationExceptions();
    PrepareConnection(); // <- I added this
    PrepareAllocationExceptionReport(allocationNo);
    this.DisplayReport();
    private void PrepareConnection() // <- I added this
    //test - these will come from the config.xml file
    this.connectionInfo = new ConnectionInfo();
    this.connectionInfo.ServerName = "testserv\\test";
    this.connectionInfo.DatabaseName = "testdb";
    this.connectionInfo.UserID = "testuser";
    this.connectionInfo.Password = "test";
    this.connectionInfo.Type = ConnectionInfoType.SQL;
    private void PrepareAllocationExceptionReport(int allocationNo)
    this.paramFields = new ParameterFields();
    this.paramFields.Clear();
    ParameterField paramField = new ParameterField { ParameterFieldName = "@AllocationNo" };
    ParameterDiscreteValue discreteVal = new ParameterDiscreteValue { Value = allocationNo };
    paramField.CurrentValues.Add(discreteVal);
    paramFields.Add(paramField);
    private void DisplayReport()
    frmReportViewer showReport = new frmReportViewer();
    showReport.ReportViewer.ReportSource = this._report;
    showReport.ReportViewer.ParameterFieldInfo = paramFields;
    showReport.ShowDialog();
    showReport.Dispose();
    Any help would be much appreciated.

    Hi Garry,
    Please post SAP Crystal Reports questions in their own forums here:
    SAP Crystal Reports, version for Visual Studio
    We don't provide support for this control now. Thanks for your understanding.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How do you set the left hand margin when writing emails. Some characters disappear off of the left side of the page because the margin is so close to the edge

    When writing emails the left hand margin is so close to the edge of the page that some characters disappear from view on the left hand of the page. How can I set the left hand margin to not be so close to the left edge of the page?

    Oy. You beat your head for hours and finally concede to asking for help, only to solve it two minutes later. Here's the answer.
    In the inspector, on the Layout tab, there's a checkbox that reads, "Show Thumbnail Track".
    UNCHECK that box and the gutter goes away.

  • How to programmatically set the real-time CVI startup DLL?

    Dear NI Support Engineer:
    I'm part of a team of software engineers working on a real-time aerospace app at Honeywell (Coon Rapids, MN campus).  We're using LabWindows/CVI 9.0 and three LabView 8.6 real-time modules.
    Up until now, we've been using the CVI debugger to launch our real-time apps or just copying the app DLL to C:\ni-rt\cvi on the real-time box and setting it as the default startup DLL.
    What we need to do now is create our own directory structure at the root of C: on the real-time box (which, by the way, is using the Reliant file system).
    In fact, we have created directory ug7500 at the root of C: on the realtime box, and two subdirectories (one for data and one for results) directly under directory ug7500.  We'd like to place all of our app DLLs in the ug7500 directory and have the ability to change the default startup DLL programmatically.
    We've been using your LabWindows/CVI Real-time File Copy Utility to set the startup DLL whenever we're not using the debugger.  That was just fine for the first stage of our development.
    At this stage, however, we need be able to set the startup DLL programmatically.  We have not been able to find out how to do this from reading the real-time module documentation.
    Can you either point us at some documentation on programmatically setting the default startup DLL, or e-mail us the instructions, or give us a phone call and explain what steps we must take.
    Thank you very much.
    Vic
    763-957-4168

    Hello All,
    For the reference of anyone else trying to do this, you can modify the INI file to change the startup DLL. Using the INI instrument that ships with CVI (C:\Program Files\National Instruments\CVI90\toolslib\toolbox), you can find the StartupDLLs tag and replace the last value with your startup DLL, such as:
    #include "inifile.h"
    #include <cvirte.h>
    static int status;
    static IniText myINIFile;
    int main (int argc, char *argv[])
     if (InitCVIRTE (0, argv, 0) == 0)
      return -1;    /* out of memory */
     myINIFile = Ini_New (0);
     status = Ini_ReadFromFile (myINIFile, "c:\\ni-rt.ini");
     status = Ini_PutRawString (myINIFile, "LVRT", "StartupDLLs", "c:\\NI-RT\\system\\cvi_lvrt.dll;c:\\ni-rt\\system\\nidevldp.dll;nisysapirpc.dll;niorbp.dll;c:\\ni-rt\\system\\mxsemb.dll;c:\\ni-rt\\system\\nipxism.dll;c:\\NI-RT\\cvi\\myStartup.dll;");
     status = Ini_WriteToFile (myINIFile, "c:\\ni-rt.ini");
     return 0;
    Right now, there are some caveates with using CVI 9.0 to manipulate an INI file to be used on an RT target. The INI functions currently add line breaks automatically for large tag values and adds quotes around the values. For many INI files this is ok (such as TestStand INI files), but it will not work on an RT target. To remove these features, modify the following lines of the inifile.c file located in the same directory as the INI instrument:
    1. On line 38, change the default value of INI_NUM_CHARS_PER_LINE from 80 to a large number such as 8000.
    2. Comment out line 953 (newEntry->addMarkerQuotes = addMarkerQuotes;
    Now you should be able to programmatically change the INI file of your target machine and, therefore, change the startup DLLs.

Maybe you are looking for

  • Tables / Procedures not shown in SQL Developer.

    Hi, I recently downloaded SQL developer 1.5 and installed it. The created few connections to the various environments I use. Though this version does not work with 8i it works with 10g The problem I' facing is that, under connections- the tables, pro

  • Set environment variable in oracle 10g application server control rel3

    hi all, i am trying to connect to emc centera through 10g rel3 , here i am getting error . error name is: com.filepool.fplibrary.FPLibraryException: Error loading FPLibrary or one of its dependencies at com.filepool.fplibrary.FPPool.<init>(Unknown So

  • Pattern for multi-server environment

    Hi All, Here's our scenario: 1) We have a network whose nodes are all server-capable. 2) A dedicated server is not possible. 3) Only one node can act as a server at any one time. 4) The nodes are actually operators' terminal (eg, with data entry/edit

  • Error when creating WM inventory record

    Hi All, When I try to create an inventory record using Txn LX15 and batch input session I get the following error in the error log in the batch input session "Number of allowed bins exceeded after storage bin P1-06A" This error is for transaction LI0

  • How to take OIM Managed server Thread Dump

    Hi All, how can i take the oim managed server thread dump I used wlst command for this lyk follows kill -3<pid> ./wlst.sh connect("weblogic","password","t3://hostname:port") threadDump() but it is giving Admin server dump, i want oim managed server t