Making JTable columns 2- n scrollable, not the first column, how?

Id like for my JTable's first column to always be visible, and columns 2->n to be scrollable. The table also follows the sortable table model found from the swing examples...so if the user sorts any of the columns, all the other columns should sort accordingly.
is there anyway i can separate the first column with the others, so that i can put them in their own scrollpanes (first column just scrolls up/down, and 2->n can scroll either way)?

I only glanced at the example at the posted link... if memory servers, the trick was to create one JTable but with two different TableModels. To link the two models, you can simply make the getValueAt method in the fixed model call the getValueAt method of the non-fixed model. It's a bit tricky for beginner, but doable.
;o)
V.V.

Similar Messages

  • Search for the first column in a table?

    I have numerous tables that I've setup up with Paragraph, Cell and Table styles. They are linked to Excel files. Every time they are updated everything updates perfectly, except one column. All the columns are right justified, but the first column and because of the Paragraph styles it right justifies everything.
    I'm trying to figure out if there is a way to search and change all the text in every first column of a table and have them be left justified. The text in the left column has up to 4 different styles on alternating lines or I would just setup a Character style and highlight and change manually.
    Any ideas would be greatly appreciated.
    I am using version CS6 and if there is a way of doing this using the Multi/Find Change plugin, I do have and use that, but I think that is just to run multiple searchs, in a particular order.
    Peter

    @Peter – that can be done by scripting.
    See the following code snippet in ExtendScript (file suffix *.jsx, plain text file), that would change all text in every cell of every first column of every table in your active document to left align:
    app.documents[0].stories.everyItem().tables.everyItem().columns[0].cells.everyItem().texts[0].justification = Justification.LEFT_ALIGN;
    Uwe

  • (JTable) How can i get the first columns cell in a selected row?

    Hello. I am trying to figure out how i can get the first columns cell within a selected row no matter what cell is selected in that row. I have a class that extends AbstractTableModel which represents the table. Now i have another class that extends DefaultSelectionModel. Each model is added to the JTable via setModel(TableModel dataModel), setSelectionModel(ListSelectionModel newModel). Now i don't understand what i have to return from getMaxSelectionIndex(). Any ides? Thanks.
      class xTableModel extends AbstractTableModel{
         private static String[] cols;
         private Object[][] data;
            public void setTableModel(Object data[][], String[] cols){
             this.cols = cols;
             this.data = data;
            public String getColumnName(int col){
             return cols[col];
            public int getRowCount() {
             return data.length;
            public Object getValueAt(int row, int col) {
             return data[row][col];           
            public void setValueAt(Object value,int row,int col){
             data[row][col]=value;
            public int getColumnCount(){
             return cols.length;
    class ColumnListenerModel extends DefaultListSelectionModel{
         public int getMaxSelectionIndex(){}

    int row = table.getSelectedRow();
    Object data = table.getValueAt(row, 0);

  • WPF: How to make the first column does not show row separator and Left column separator in DataGrid?

    Our WPF application uses DataGrid.
    One of request is that first column of DataGrid does not show row separator and also does not show Left column separator. So it looks like the first column does not belong to the DataGrid. However, when select a row, the cell of first column still get selected.
    How do we make it? Thx!
    JaneC

    Hi Magnus,
    Thanks for replying our question and provide your solution!
    Your solution works by setting "HorizontalGridLinesBrush" and "VerticalGridLinesBrush" to {x:Null} in the DataGrid style and modify "CellStyle" in first column as following:
    <DataGridTextColumn MinWidth="32"
    Binding="{Binding CellName}"
    CanUserReorder="False"
    CanUserSort="False"
    Header="Cell}"
    IsReadOnly="true" >
    <DataGridTextColumn.CellStyle>
    <Style TargetType="DataGridCell">
    <Setter Property="IsEnabled" Value="False"></Setter>
    <Setter Property="Template">
    <Setter.Value>
    <ControlTemplate TargetType="{x:Type DataGridCell}">
    <Border BorderThickness="0" BorderBrush="{x:Null}"
    Background="{Binding Background, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}" Margin="-1">
    <Grid Background="{TemplateBinding Background}" VerticalAlignment="Center" Height="42">
    <ContentPresenter VerticalAlignment="Center"/>
    </Grid>
    </Border>
    </ControlTemplate>
    </Setter.Value>
    </Setter>
    </Style>
    </DataGridTextColumn.CellStyle>
    </DataGridTextColumn>
    We found another way to achieve it by using DataGridRowHeader. The good way to use DataGridRowHeader is that we do not need to make the first column ReadOnly (click on first column does not select whole row anymore). Select RowHeader in a row will select
    whole row. Move scroll bar horizontally, the row header still keep in visible area.
    <Style TargetType="{x:Type DataGridRowHeader}" x:Key="dataGridRowHeaderStyle">
    <Setter Property="VerticalContentAlignment" Value="Center" />
    <Setter Property="HorizontalAlignment" Value="Center" />
    <Setter Property="Height" Value="42" />
    <Setter Property="SeparatorBrush" Value="{x:Null}" />
    <Setter Property="FontSize" Value="16" />
    <Setter Property="Template">
    <Setter.Value>
    <ControlTemplate TargetType="{x:Type DataGridRowHeader}">
    <Grid>
    <Border x:Name="rowHeaderBorder"
    BorderThickness="0"
    Padding="3,0,3,0"
    Background="{Binding Background, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"
    BorderBrush="{x:Null}">
    <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
    VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
    SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
    </Border>
    </Grid>
    </ControlTemplate>
    </Setter.Value>
    </Setter>
    </Style>
    <DataGrid>
    <DataGrid.RowHeaderStyle>
    <Style TargetType="DataGridRowHeader" BasedOn="{StaticResource dataGridRowHeaderStyle}">
    <Setter Property="Content" Value="{Binding CellName}" />
    <Setter Property="Width" Value="35"/>
    </Style>
    </DataGrid.RowHeaderStyle>
    </<DataGrid>
    JaneC

  • Making the second gmail account the primary login when TB starts not the first one.

    Hi I added an additional gmail account but can seem to change log-in so it is the second/new account that I log into when I open TB not the first account?

    The mail account listed at the top of Folder Pane and top one in Account Settings is the default mail account.
    To set a different default mail account:
    'Tools' > 'Account Settings'
    or
    'Menu icon' > 'Options' > 'Account Settings'
    * Select the account name you want as default
    * Click on 'Account Actions'
    * Select: Set as Default'
    * Click on OK

  • Why is my ping so high in the first column only when i do a tracert?

    When i do a tracert my ping is really high in the first column only on each hop and then it drops to a respectable level. Does anyone know why it is like this on my 4G LTE device? On my dsl when i do the same ping test its pretty even across on each hop. This is what im seeing when i do a ping test on my 4G LTE device.
    tracert www.yahoo.com
    Tracing route to ds-any-fp3-real.wa1.b.yahoo.com [98.139.183.24]
    over a maximum of 30 hops:
      1     9 ms     3 ms     3 ms 
      2  1101 ms    34 ms    38 ms  193.sub-66-174-20.myvzw.com [66.174.20.193]
      3   169 ms    55 ms    52 ms  49.sub-69-83-13.myvzw.com [69.83.13.49]
      4    52 ms    56 ms    54 ms  194.sub-69-83-13.myvzw.com [69.83.13.194]
      5   179 ms    58 ms    57 ms  101.sub-66-174-17.myvzw.com [66.174.17.101]
      6   168 ms    57 ms    60 ms  TenGigE0-0-1-0.GW14.BOS4.ALTER.NET [152.179.2.97
      7   181 ms    58 ms    57 ms  0.ge-0-3-0.XL3.BOS4.ALTER.NET [152.63.17.130]
      8   170 ms    59 ms    58 ms  0.ae3.BR1.NYC1.ALTER.NET [152.63.18.222]
      9   177 ms    67 ms    59 ms  ae11.edge2.NewYork.Level3.net [4.68.62.41]
    10     *        *        *     Request timed out.
    11     *        *        *     Request timed out.
    12     *        *        *     Request timed out.
    13   192 ms    49 ms    60 ms  ae-4-90.edge4.NewYork1.Level3.net [4.69.155.210]
    14   185 ms    51 ms    60 ms  YAHOO-INC.edge4.NewYork1.Level3.net [4.28.130.82
    15   380 ms    73 ms   129 ms  ae-5.pat2.bfz.yahoo.com [216.115.96.67]
    16   339 ms    69 ms   146 ms  ae-4.msr2.bf1.yahoo.com [216.115.100.73]
    17   215 ms   152 ms    80 ms  xe-5-0-0.clr2-a-gdc.bf1.yahoo.com [98.139.128.11
    18   289 ms   217 ms   217 ms  et-17-1.fab6-1-gdc.bf1.yahoo.com [98.139.128.47]
    19   187 ms    87 ms    79 ms  po-14.bas2-7-prd.bf1.yahoo.com [98.139.129.227]
    20   474 ms   314 ms   294 ms  ir2.fp.vip.bf1.yahoo.com [98.139.183.24]
    Trace complete.

    hi there
    see you never got an answer from vzw
    take it you still have the high ping or no ping  in my cases
    your doing better then i
    seems the lte is getting bad with this problem over time as my connection times out causing half loaded web pages  and lots of buffering in video playback
    i have had 3 tickets in the past 3 month to try and get this fixed  but they say cant find anything wrong
    and noone else is having the problem here are a few things that seems to have helped me out
    1  increase your TTL  time till live 
    this tells your computer to wait a bit longer before giving up and requesting that a packet of info be resent
    2 in your computers network settings and reg you can change packet size to a smaller number and add a stop bit to the packet with a time stamp on each packet back in the old days  this was what v 90 modems did to get v92 speeds and did help with noisy copper wire dial up and seems to help here too
    http://www.dslreports.com/drtcp
    is a tool that will help you change your computer setting and reg
    use drtcp and the results from this page
    http://www.dslreports.com/tweaks
    xp win 7 win 8 this will help.  vista did it right and dynamically change these settings on the fly and all of step 2 is unnecessary
    remember your original settings write them down so you can go back to them should you have problems
    also make a restore point and backup your reg before tinkering with windows os
    send a private message to me if you need more help  or get a computer savvy friend to help you out if you need
    3  if your signal noise is under 4G  -100bd the lower the better,  there is a way to set your android to lte only  mode.
    more likely to lose data and voice in weak signal areas but great if tethering or hotspotting at home
    dail *#*#4636#*#* this is a back door to your android software and is open source code by android os  not vzw
    and will not unlock your phone voiding warranties. be warned though if you set things wrong in here
    you can make more problems  be very sure what you change  and do one thing at a time so you remember and can  dial in again and change it back should you disable something you need. fyi each time you dial in the number it resets to vzw default setting and may look like it did not save setting but it doz. till you dial in again.
    good luck
    ron
    ps im not a vzw rep in any way other then a fellow customer not getting answers.

  • How do I increase the width of the first column in the Terminal ls -l command?

    I am now running 10.9.x, but I've experienced the problem described in the question over the last several iterations of OS X.
    I use bash as my interactive shell. When I display the "ls -l" command in Terminal the output is often very difficult for me to scan, because the columns in which are displayed the several fields of the records for the listed files are misaligned (different left-hand first-letter starting points for left-aligned text-valued fields; different right-hand low-digit alignment of numerical fields).
    When I look more closely at the mess displayed in my Terminal window, it appears that the cause of the problem may be that no minimum width, or an inadequate minimum width, has somewhere been set or defined for the first column of each record, containing the file's "mode" string (permissions, etc.); for all records in which this string is of equal length, the succeeding columns for all fields in those records are themselves aligned.
    It has not always been thus for me in the Terminal with OS X, or else I might not dream that the world could be a better place in this one respect. But if I launch an interactive csh-shell instead of bash in Mavericks today, the columns of the ls -l command there align no better.
    I've found no help in the Unix man pages for the ls command. There is a COLUMNS environment  variable whose value is supposed to be used by the ls command to set the width of every column displayed, but this is not what I want to do, and in my shell "ls -l" seems to ignore the exported variable anyway.
    There is also an LS_COLWIDTHS environment variable that is described as setting column widths on a field-by-field basis, at least for some fields, but the the mode column is not included among those whose width is supposed to be adjustable, and my shell seems to ignore the value of this variable as well.
    I've looked in my rather simple ~/.profile and ~/.bashrc files for anything that I might plausibly suspect of producing or perpetuating this behavior, but there is nothing there. Any suggestions about how to remedy this problem?
    Randy Miller

    John,
    I would like you to perform a safe boot. On reboot, press and hold the shift key at the chime, until the grey horizontal bar appears. After you type in your password, press and hold the shift key again, then click the right arrow to login, and release the shift key when your desktop appears. Move the contents of your local ~/Library/Caches into the Trash. Reboot normally. Empty your Trash.
    Re-evaluate your Terminal behavior. If it now works ok, great. Otherwise, here are a sequence of screen shots of my Terminal preferences for comparison. I can use both Courier fonts without formatting issues. Click to enlarge. I use the free IR Black Terminal theme as a personal choice in OS X 10.9.4. In my ~/.bashrc file (triggered from ~/.bash_profile), I export TERM=xterm-256color, and invoke /usr/bin/tput init. Click on the following images to enlarge.

  • All the data getting exported in the first column of csv while exporting

    Hi All,
    In 11.5.10.2, I have a page with advanced table region. Am using OA Framework's export button to export the results.
    But, problem is, All the results are getting exported in the first column of the output .csv file. Why such a behavior?
    Profile Option of 'Export MIME Type' value is text/text-separted-values.
    Any ideas would be of timely help. Thanks.
    Regards, Soorya

    From OAF standpoint, it just exports the data. Data interpretation is completely dependent on client machine and excel setups.
    Please check the Data-->Text to Columns wizard where we can specify the delimiter(s) on excel.
    Not sure if this can be set up in Apps, so that we need not change on every end-user machine.
    Hope this helps.
    -- Thanks

  • "Pie chart in pivot view  showing only the first column's results" in obiee

    Hi,
    In my pivot view(pie chart view+pivottable),i'm getting only the first column's result in pie chart..
    I have added a column named *'A*' in rows and '*moneyspent*' in measuresfield and the '*period*' in the columnsfield in the pivot view.I'm calculating the sum of
    the rows and columns..
    I'm not getting the sum valueof moneyspent in the pie chart..instead i'm getting only the first column of period in the pivot table in the pie chart.
    can anyone tell how can i get the sum value of pivot table in pie chart?
    Thanks in advance..

    Hi Prash,
    let me try to give you an example based on the paint sample:
    Use Markets.Region, Products.Brand, 'Sales Measures'.Units
    choose a pivot view to display the result: region goes into the rows-section, Brand goes into the columns-section and Units into the measures-section
    In the columns-section add a total using the 'add total' at 'Measure Labels' level
    the result is a total column on the right side of the pivot.
    looking like this:
    Units
    Brands
    Region Enterprise Magicolor Mccloskey Valspar Units Total
    Central 1032.....
    Eastern 1485......
    Southern 824.....
    Western 580
    What I am looking for is a new column 'Units Total pct'.
    If I duplicate the measure to show the values in percent, I'll get a second column per Brand (showing the absolute and percentage values) - that's what I don't want
    Regards
    Andy

  • How to get keep one column as a key and the other columns as a array list

    Hello,
    I am really new to Java...I am trying to read a text file containing different columns separated by comma and then create a hash map for the first column (key) and then rest as a array list for the key.I am not able to create the hash map and the corresponding key.Could someone help me in this regard.
    The text document is :
    AcctNo,AcctMngr,AcctType,ProdList,Volume,AcctPrice,Returns
    12345,Vikram,2,MSFS:IBM:XYZ:MAN,28000,4500,1.25
    53278,Anand,1,PLYS:AIX:YET:WON,85000,8500,2.32
    94005,Vincent,3,UTIL:FLY:YEL:WIN,67000,5600,3.21
    45000,Abhishek,2,WENS:KYL:MEN:ABS,34000,9800,4.21
    76000,Chris,3,MENS:IBM:ROC:QUE,25000,2500,2.15
    67000,Kiran,4,FORS:ITI:MOC:REM,32000,3500,1.54
    87000,Rohit,2,MSNF:IIT:HOT:ROC,54000,5400,4,23
    45600,Sathyan,3,HELP:FOR:PRO:GRA,65000,3400,2,1.98
    84600,Vinay,4,PLZE:TES:ROC:WEN,76000,7300,3,4.32
    65000,Venkat,2,HETT:WEL:SEE:RED,89000,9800,1,3.23
    and the code which i have so far is
    import java.io.*;
    import java.util.*;
    class SearchHash {
    public static void main (String args[]) {
    int i=0;
    int j=0;
    Object newKey = new Object();
    Object newValue = new Object();
    Map map1 = new HashMap();
    ArrayList a1 = new ArrayList();
    String val;
    try {
    BufferedReader br1 = new BufferedReader ( new FileReader ( new File ("progress.txt")));
    String s="";
    s = br1.readLine();
    while (s!=null) {
    StringTokenizer st = new StringTokenizer (s ,",");
    int k=0;
    while (st.hasMoreTokens()) {
    while (k<=6) {
    val= st.nextToken();
    if (k==0) {
    newKey = val;
    else{
    newValue = val;
    a1.add(newValue);
    k = k+ 1;
    map1.put(newKey,a1);
    map1.put(newKey,a1);
    a1.clear();
    s = br1.readLine();
    // System.out.println(map1);
    }catch (Exception e) {
    System.out.println("Exception Raised : " + e);
    Thanks.,...

    Array? Don't live in object denial. Define a class (Account?) and parse each line as an Account object. Then you put them into a Map<Integer, Account> by their account number.

  • Disabling validations if the first column is empty in an editable table

    Hi ,
    I'd want to disable validations if the first column in an editable table is empty - coz we'd assume that the user does not want to enter any data in the new row. How can this be done ?

    Hi Viren,
    It is correct that the first line for every Master Data is an empty row, if I am not wrong it derives from SEM settings.
    1.If you have some rows with 0CUST_SALES without any attribute it is because you are uploading this MAster Data with a source that does not consider compound objects: it is surely a Transactional DataSource (you do not upload Attributes). So for every Transactional record for which you do not upload also compound objects the system creates a record in your Master Data that is not correct.
    2. If you do not have Distr Channel update in Inventory Cube I think you must re-upload all your request starting from PSA. If you have deleted your PSA you can create a DataSource on your cube and feed once again your cube with its same data (built Update Rules that start from Cube and end in the same Cube). Make an upload of all your request and the delete all previous request.
    Ciao.
    Riccardo.

  • How do you print the numbers next to the first column

    In Numbers I can't figure out how to print the numbers next to the first column to the left. Say I have 350 people on a list and I want to print the sheet with the numbers next to the people's name, how do I do that. Excel automatically does it. However, I cannot find the option to print and include the numbers from the standard Numbers worksheet. Thanks for your assistance.

    In excel it is actually in the page setup dialog. under the "sheet" tab. Numbers doesn't have one table per page (excel is basically one large table of cells). So printing header and column labels doesn't really work in numbers, because those labels don't show up until you click inside the tables. If you notice when you do that they abstruct the view of everything else that might be near the edge of the table.
    The other posters response is the best way to do it. you can get column Numbers (but not letters) by using the column command in an extra row at top also. Thre is a way if you really want column letters, but it ain't pretty. Let us know if you want that too.
    Jason

  • How to show Summary label it in the first column of the sheet?

    Hi Gurus,
    I am wondering if i could show the Label of summary items in the first column instead of showing it along with the Summary data. As with the long worksheets if the summary column is at far right it doesn't look good and not readable too.
    Thanks.

    Thanks NP,
    Its really not good in Discoverer. Actually what I'm saying is as follows:
    EMPID EMPNAME SALARY
    emp01 EMPNMaa 100000
    emp02 EMPNMbb 500000
    emp03 EMPNMcc 1000000
    Sum:------------------- 1600000
    But what Discoverer does right now is:
    EMPID EMPNAME SALARY
    emp01 EMPNMaa 100000
    emp02 EMPNMbb 500000
    emp03 EMPNMcc 1000000
    --------------------------- Sum:1600000
    It really looks bad & not al all a user friendly. The sum label comes always with value. I think Oracle should improve it.
    Thanks.

  • Emacs is displaying the first column of the line on the last column of the previous line

    The first column of my lines are being displayed on the last column of the previous line. This a very irritating glitch that I have no clue how to fix or even troubleshoot. (red bars were added using preview to hide personal info)
    I've downloaded MacPorts and reinstalled emacs:
    GNU Emacs 24.4.1
    Copyright (C) 2014 Free Software Foundation, Inc.
    GNU Emacs comes with ABSOLUTELY NO WARRANTY.
    You may redistribute copies of Emacs
    under the terms of the GNU General Public License.
    For more information about these matters, see the file named COPYING.
    I'm open to any suggestions on how to fix this graphical glitch.
    Much thanks
    Message was edited by: Conner_36

    Given that the Emacs for OS X works ok and the Emacs shipped with OS X works it would seem to be some issue with MacPorts and their version.
    Totally unfamiliar with MacPorts so have no idea how the program gets compiled,what libraries it is using and what if any config settings are needs or set so I'm afraid I won;t be much help there.  That you are on a MBP with a retina display may be part of the problem.
    So with the setup you have now, hardware and software including OS,  it was working and then just like that it stopped? Something much have changed around the time it stop working if you can think back to then it might help you resolve the problem.
    As you are doing programming can i assume you have Xcode and the command line tools installed? If not how do you compile your code? The reason I ask is compiling Emacs from there GNU source is not all that difficult. It might be worth trying that.
    One last thing given that the two other versions of Emacs displayed the file OK this strongly suggests the problem is not in your .emacs file or your environment however as I wrote I am not familiar with MacPorts so it is possible there is another config file messing you up. As a test for this create a new user or log in as the Guest user (this is best as you;re guaranteed the environment is clean) and look at the file in question in MacPorts Emacs. If it displays OK then there is something in your environment causing this, If it messes up  even in the new user then I'd say ditch MacPorts..
    regards
    <edit>
    Just to rule out init files  if you start emacs with the -q(minus que) flag the .emacs file is not read in, if you use  --no-site-file it will not load the site file if it exists.
    I'd try running the MacPorts emacs with those two flags to see f anything changes.

  • I have been considering buying Aperture 3 but the numerous, negative reviews are making me wary.  Should I buy the first version - Aperture 2.1.1 instead?

    I have been considering buying Aperture 3 but the numerous, negative reviews are making me wary.  Should I buy the first version - Aperture 2.1.1 instead? 
    I have a 2009 MacBook Pro running Snow Leopard.  I do not think I will upgrade to Lion because I was warned that it may conflict with some of my applications.
    There have been so many reviews that talk about how Aperture 3 is so slow and spends too much time searching for Faces and eventually crashes.  And, many reviews mention that you need to add to your RAM which I can't do right now, especially on a 3 year old computer.
    There are some copies Aperture 2 on Amazon.  Would that be a good place to buy a copy or a used copy?
    I would appreciate some good advice.  Thanks, Taf Schaefer

    Obviously you haven't read the reviews of Aperture 2
    FWIW I use Ap3 on both a 2010 MBP (8 gigs of Ram) and an 2008 iMac (4 gigs) and I have no crashing issues whatever. Remember, you can disable Faces if you don't want to use that feature.
    Elv07 wrote:
    I used to use iPhoto and I will probably revert to that (although it has fewer function like no RAW import etc.)
    Just an FYI: iPhoto supports exactly the same Raws as Aperture.
    Regards
    TD

Maybe you are looking for