How do I make a JTable's header sorting actually change the actual table?

How do I make a JTable's header sorting actually change the actual table?
Currently, I'm using
table.setAutoCreateRowSorter(true);to allow the user to sort the table.
However, I want to be able to load something based on the selected row's index. The problem is that when the table is rearranged, the change appears to only be local, in other words, the actual table isn't changing.
For instance:
index 0 "A"
index 1 "B"
index 2 "C"
Sorted in reverse gives me
"C"
"B"
"A"
But C is still index 2 (instead of 0).
Thanks in advance.

Cross posted and answered in the Swing forum.
[http://forums.sun.com/thread.jspa?threadID=5353865]
I see this is not your first incidence of cross posting. In future, please post a question once only.
db

Similar Messages

  • How do I make one account's home folder visible to the other?

    How do I make one account's home folder visible to the other? Also, when I begin to delete an account, it asks if I want to either delete its home folder, keep it in the users folder, or save it in a disk image. I want to be able to see it from my remaining account once I delete it, so if I leave it in the users folder, would I be able to see all the files (right now I can't

    Use terminal to add ACL to the account,
    at the prompt:
    sudo chmod -R +a "<user> allow list,addfile,search,delete,add_subdirectory,delete_child,readattr,writeattr,readextattr, writeextattr,readsecurity,file_inherit,directoryinherit" /User/<user_name> #yep, all that goes on one line!#
    #Replace <user> with the user name that you want to have file/folder privileges#
    #Replace <user_name> with the account you want to process#
    example:
    sudo chmod -R +a "sue allow list,add_file, .... deletechild,readsecurity,file_inherit,directoryinherit
    /User/joe
    #sue now gets full access to joe's files and folders#
    to remove:
    sudo chmod -R -a "sue allow list,add_file, .... deletechild,readsecurity,file_inherit,directoryinherit
    /User/joe
    You can add as many users as you want! Just lather, rinse repeat. That is how I share my itunes
    directory with the ones I want to share it with.
    That's the simplest way. ACL permissions overrule posix permissions.

  • How can i make my scrollpane in a way that at the opening of a frame it doe

    How can i make my scrollpane in a way that at the opening of a frame it does not scroll down automatically?
    code is below
    import java.awt.*;
    import javax.swing.*;
    import javax.swing.*;
    import java.awt.event.*;
    import java.net.*;
    import javax.swing.JOptionPane.*;
    import java.io.*;
    import javax.swing.colorchooser.*;
    import javax.swing.filechooser.*;
    import javax.accessibility.*;
    import javax.swing.border.*;
    import java.sql.*;
    public class Signup extends JFrame
         JLabel p1,p2,p3,p4,p5,p6,uid,upass,cpass,fname,sname,hint,sl,ed,age,adr,cit,zip;
         JTextField uname,fnamet,snamet,hintt,adrt,adrt1,city,zipcode;
         JPasswordField upassw,cpassw;     
         JComboBox sex,education,agegr;
         Signup()
         Container c=getContentPane();
         c.setLayout(null);
         c.setBackground(Color.white);
         /** JPanel c = new JPanel();
         c.setBackground(Color.white);
         int v = ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS;
         int h = ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED;
         JScrollPane jsp = new JScrollPane(c, v, h); ***/
    p1=new JLabel("Create Your Icafe!ID",10);
         p2=new JLabel("Personal Information");
         p3=new JLabel("User Address");
         p4=new JLabel("Tell Us About Your Hobbiess (Optional) ");
         p5=new JLabel("Tell us something about what you like. This will help us choose the kind of content to display on           your pages.");
         p6=new JLabel("--------------------------------------------------------------------------------");
    uid=new JLabel("User Id");
         upass=new JLabel("Password");
         cpass=new JLabel("Confirmation Password");
         fname=new JLabel("UserName");
         sname=new JLabel("SurName");
         hint=new JLabel("Hint Question");
    sl=new JLabel("Sex");
         ed=new JLabel("Education");     
         age=new JLabel("Age Group");     
         adr=new JLabel("Address");
    cit=new JLabel("City");
    zip=new JLabel("ZipCode");
         uname=new JTextField(10);
         uname.requestFocus();     
         uname.setToolTipText("UserName");
    upassw=new JPasswordField(10);
         upassw.setToolTipText("Password");
         upassw.setEchoChar('*');
         cpassw=new JPasswordField(10);
         cpassw.setToolTipText("Confirmation Password");
         cpassw.setEchoChar('*');
         fnamet=new JTextField(10);
         fnamet.setToolTipText("FullName");
         snamet=new JTextField(10);
         snamet.setToolTipText("SurName");
         hintt=new JTextField(10);
         hintt.setToolTipText("Hint Question");     
    String[] gender={"[Select one]","Male","Female"};
         sex = new JComboBox(gender);          
    String[] edu={"[Select one]","S.S.C","Inter","Graduate","Post Graduate"};
         education= new JComboBox(edu);     
    String[] ageg={"[Select one]","0 - 15","16 - 35","36 - 70","70 - 100"};
         agegr= new JComboBox(ageg);     
    adrt=new JTextField(15);
         adrt.setToolTipText("Address");
         adrt1=new JTextField(15);
         adrt1.setToolTipText("Address");
         city=new JTextField(15);
         city.setToolTipText("City");
    zipcode=new JTextField(15);
         zipcode.setToolTipText("ZipCode");
         p1.setBounds(200,70,160,30);
         uid.setBounds(350,100,160,30);
         uname.setBounds(400,100,160,30);
         upass.setBounds(335,140,160,30);
         upassw.setBounds(400,140,160,30);
         cpass.setBounds(260,180,160,30);
         cpassw.setBounds(400,180,160,30);
         p2.setBounds(200,220,160,30);
         fname.setBounds(330,260,160,30);
         fnamet.setBounds(400,260,160,30);
         sname.setBounds(335,300,160,30);
         snamet.setBounds(400,300,160,30);
    hint.setBounds(315,340,160,30);     
    hintt.setBounds(400,340,160,30);
         sl.setBounds(370,380,160,30);     
         sex.setBounds(400,380,160,30);
         ed.setBounds(335,420,160,30);     
         education.setBounds(400,420,160,30);
    age.setBounds(330,460,160,30);
    agegr.setBounds(400,460,160,30);
    p3.setBounds(200,500,160,30);
         adr.setBounds(340,540,160,30);
         adrt.setBounds(400,540,160,30);
         adrt1.setBounds(400,580,160,30);
         cit.setBounds(370,620,160,30);
         city.setBounds(400,620,160,30);
    zip.setBounds(590,620,160,30);
    zipcode.setBounds(640,620,160,30);
         Font font = new Font("SansSerif",Font.BOLD, 12);
         setFont(font);
         c.add(p1);
    c.add(uid);
         c.add(uname);     
         c.add(upass);
         c.add(upassw);
    c.add(cpass);
         c.add(cpassw);
    c.add(p2);
    c.add(fname);     
         c.add(fnamet);
    c.add(sname);
    c.add(snamet);
         c.add(hint);
    c.add(hintt);     
    c.add(sl);
    c.add(sex);
    c.add(ed);
         c.add(education);
    c.add(age);
         c.add(agegr);
    c.add(p3);
    c.add(adr);
         c.add(adrt);
         c.add(adrt1);
    c.add(cit);
    c.add(city);
    c.add(zip);
    c.add(zipcode);
         setResizable(false);
         //int a=DO_NOTHING_ON_CLOSE;
         //setDefaultCloseOperation(a);
         show();
         setSize(800,500);
    // Border raisedBorder = new BevelBorder(BevelBorder.RAISED);     
         setContentPane(c);     
    public static void main (String arg[])
         try{
         UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
         }catch(Exception s)
         Signup swu=new Signup();

    just try the following:
    jsp.getVerticalScrollbar().setValue(0);after inserting and adding all your components. this will set the vertical scrollbar up to the very first line.
    regards

  • HT201363 How can I make an Apple ID without credit card if the "none" tab is not visible to me?

    How can I make an Apple ID without credit card if the "none" tab is not visible to me?
    Help me out please

    Hello, aligt9p. 
    Thank you for visiting Apple Support Communities. 
    To create an Apple ID without a credit card, there is a specific series of steps that have to be processed in order to allow the payment to be set as none on creation of the account.
    Creating an iTunes Store, App Store, iBooks Store, and Mac App Store account without a credit card
    http://support.apple.com/kb/HT2534
    Why can’t I select None when I edit my payment information?
    http://support.apple.com/kb/TS5366
    If the specific steps have not been processed, a credit or debit card will be required to complete the setup the account.
    However, it can be removed and payment method changed to none as long as there is not an outstanding balance.
    iTunes Store: Changing account information
    http://support.apple.com/kb/ht1918
    Cheers,
    Jason H. 

  • How do I make attachments I receive in mail appear at the top of my messages?  Sometimes they are imbedded all the way at the bottom of an on going discussion and I don't even realize that there is an attachment.

    How do I make attachments I receive in mail appear at the top of my messages?  Sometimes they are imbedded all the way at the bottom of an on going discussion and I don't even realize that there is an attachment.

    If someone sends you an attachment, it's going to show up where they attached it in their message to you.
    Messages with attachments show a paper clip icon in two places, in the middle column of the Mail window, next to the senders name, and next to the sender's name at the top of the message itself.
    One way to make messages with attachments show more clearly is to create a Mail Rule, like this:
    By setting a colored background to the messages that contain attachments, they'll stand out pretty clearly in the message list.
    Note that there are several different types of attachments in the dropdown menu (where you see Document and PDF above). Keep pressing the plus sign to add different attachment types to your rule so that all will stand out on your list of messages.

  • In windows 7, how do I make firefox start automatically when I turn on the pc.?

    In windows 7, how do I make firefox start automatically when I turn on the pc

    That worked, thanks. When I turn on the pc, I almost always go to the internet before anything else, so this eliminates one step. It doesn't seem to save any time, however, but it is easy. If anyone else wants to try this, it looks like it's very easy to undo if you change your mind.

  • I have created a spreadsheet on numbers for ipad with a list of customers as a drop down menu. How can i make their address appear underneath when i select the customer?

    I have created a spreadsheet on numbers for ipad with a list of customers as a drop down menu. How can i make their address appear underneath when I select the customer?
    iselect the customer?

    Hi bazza,
    We won't be able to put the address from a formula into the same cell that you enter the customer's name. We can put the address in the cell under the customers name.
    First let's take James advice and concatenate the address in the address table.
    Here is the formula in G2
    =CONCATENATE(B2&"
    ",C2&"
    ",D2&"
    ",E2)
    It shows this way because after I clicked on B2 and typed [&"] (no brackets) I typed option-return
    This gives you your new line. Then I typed the closing ". I repeated this for the rest of the address.
    Next we want to bring this to your order sheet. I prefer using the two formulas OFFSET and MATCH instead of VLOOKUP.
    base tells OFFSETwhere to start counting from. Click A1.
    row-offset is for the row. we will use MATCH() -1 to give us the row.
    What MATCH does is give you the row number where something is found and you can specify an exact match. I usually construct the MATCH formula first and then cut and paste it into OFFSET. MATCH looks like this: MATCH(A2,Table 1::A,0). A2 is what we are looking for, Table 1A::A is where we are looking (the entire column A), and 0 means we want an exact match. Can you see it inside the OFFSET formula? Notice that we had to subtract 1 from its result.
    column-offset tells OFFSET which column A=0 so we want 6.
    we ignore "rows", "colomns" we don't need them.
    If this seems like too much, just break it down into small pieces.
    quinn

  • How can i make it so every time i save something the date is included in the title?

    how can i make it so every time i save something the date is included in the title?

    More information would be helpful. Are you doing this in an application? If so, what application.

  • HT4914 If my phone's memory is full, mostly due to music, how can I make it to where my IPad holds all the music and remove all of it from my phone without losing any of it??

    If my phone's memory is full, mostly due to music, how can I make it to where my IPad holds all the music and remove all of it from my phone without losing any of it? I recently got an iPad so I now use that as my main source as opposed to my Dell. Yes, I have a Dell that failed me. Miserably.

    Sync your music from your computer to your iPad.  Then delete the music from your iPhone.

  • How do I make drag sources disappear after being moved to the correct drop target in Captivate 7

    How do I make drag sources disappear after being moved to the correct drop target in Captivate 7

    Thank you so much. I could have searched a very long time and not found that. It is counter-intuitive to me that I would set the behavior for the drag source on the properties for the drop target.

  • How do I make an area of my clip colour and the rest B&W?

    I heard about masking but how do I make an area of my clip colour and the rest B&W?

    The filter you can use is Desaturate with Amount=100 in Image Control.
    If you want to apply it to a fixed area within your clip, put a copy of the clip in V2 on top of the priginal (supposing your clip is in V1), apply Desaturate and use Crop in Motion tab of the viewer to define the edges of the rectangle; you can also use Edge Feather to smooth the borders.
    If the portion you want black&white is actually a selected person or object in the clip then you must apply Chroma Keyer or 4/8 Point Matte to isolate that portion before applying Desaturate.
    I hope I was clear...
    Piero

  • How to return a record's column head given a record of a table.

    Hi:
    Do you know how to return a record's column head given a record of a table.
    For example, in a table with 3 columns "ID", "Education", "Age".
    Give you the record "Bachelor", how can you use a SQL to return the correspondent column head "Education"?
    Thanks for the big help.

    Have a look at http://java.sun.com/j2se/1.4.2/docs/api/java/sql/ResultSetMetaData.html.
    import java.sql.*;
    import java.util.*;
    ResultSet rs = stmt.executeQuery("SELECT * FROM testTable");
    ResultSetMetaData rsmd = rs.getMetaData();
    // loop through rsmd.getColumnCount() {
         String columnName = getColumnName(i);
         // run a query SELECT * FROM testTable WHERE columnName='Bachelor'
         // if rs !=null return columnName and break out of the loop
    }

  • I have two accounts to my computer as administrator. How can I make it so both accounts have access to the same folders and programs? grateful for answers. Martin

    I have two accounts to my computer as administrator. How can I make it so both accounts have access to the same folders and programs? grateful for answers. Martin

    Obvious question: If you want to have access to the same folders andapplications, why have two accounts? The point of different accounts is that you don't have access to the other person's data.
    Any application in the HD/Applications folder is available in all accounts.
    Sharing data between accounts depends on the material being shared. So, if you can provide more details we maybe able to help you better.
    Regards
    TD

  • When sending attachment in email the image is so large it takes up the screen, how do i make it normal, when sending attachment in email the image is so large it takes up the screen, how do i make it normal

    when sending attachment in email the image is so large it takes up the screen, how do i make it normal, when sending attachment in email the image is so large it takes up the screen, how do i make it normal

    In the Mail app, open the help menu. You will find your answer under "add attachments"

  • Running Time Machine for the first time, how that I make sure that some information I have in the external drive does not get erase in the prosess

    Running Time Machine for the first time, how that I make sure that some information I have in the external drive does not get erase in the prosess

    1. Quit iPhoto
    2. Copy the iPhoto Library from your Pictures Folder to the External Disk.
    3. Hold down the option (or alt) key while launching iPhoto. From the resulting menu select 'Choose Library' and navigate to the new location. From that point on this will be the default location of your library.
    4. Test the library and when you're sure all is well, trash the one on your internal HD to free up space.
    Note: This is now your Library. It's not a Back Up, and you need another disk for backing up.
    Regards
    TD

Maybe you are looking for

  • My iMessaging won't work on my new iPhone due to "network connection". Why can't I sign in?

    I try to log into it and it says: "iMessage Activation- Could not sign in. Please Check your network connection and try again." I'm connecting to my houses Wi-Fi and can make calls and regular texts. How can I fix this?

  • Has anyone found the answer to the "can't connect to wireless" problem?

    Since 10.5 I have not been able to connect to either our home wireless network or the city free wireless network. Our other systems running 10.4 connect perfectly. We also have 2 PCs which work fine. I installed 10.4 in a seperate drive in my system

  • Decimal Problem in fields

    Hi, In Export invoice we are entering currency in USD.When we enter the value it accepts 3 decimal places.But it is stored as 2 decimal places in table. Eg.2.059 USD in invoice screen but in table 20.59 USD. What is the problem?where we can rectify t

  • Insert error from dreamveaver to outlook

    when i insert image to office out look using Dreamweaver some line and pictures are not centered as i designed please answer

  • Transport Request Implementation Log

    Hi Gurus, I have a Transport Request implemented in the production server. I want to know by whom that TR was implemented. It's one of my TR and I know all the attributes related to it. Only thing I want to know is who has implemented that TR in prod