Strange JTable update problems

I am having some strange issues with a JTable.
I have a custom AbstractTableModel that displays various properties of a list of Objects. I am using a java.util.Vector to store this list.
The user is given several JComboBox objects which contain filters for my table, when any of these filters are changed, a class that manages my Database is asked to return a Vector full of objects that match these filters.
I then set my table data Vector equal to this returned list and invoke fireTableStructureChanged() from my table model. This part works fine, the strange thing is, if the user has a table element selected and then they change the filters, the table will not update, it actually goes blank, but oddly enough the scroll bar on the scroll pane stays the same length as the old table.
When I invoke the exact same update method again (which just sets the Vector containing my data to a new value, and fires the event) the table will update this time.
I have tried calling MyJTable.getSelectionModel().clearSelection() in the hope that it will fix my problem, but it does not seem to do anything.
So is my problem some strange event or threading glitch, or an issue with JScrollPane mabye?
Thanks in advance for any help

Try using the DefaultTableModel to see if you have the same problem. If not then you know the problem is with your custom TableModel.
If you need further help then you need to create a "Short, Self Contained, Compilable and Executable, Example Program (SSCCE)",
see http://homepage1.nifty.com/algafield/sscce.html,
that demonstrates the incorrect behaviour, because I can't guess exactly what you are doing based on the information provided.
Don't forget to use the "Code Formatting Tags",
see http://forum.java.sun.com/help.jspa?sec=formatting,
so the posted code retains its original formatting.

Similar Messages

  • A Very Strange Post Update Problem

    Hi guys, new to the forum here, wondering if I could get some help with a most disturbing problem...
    Off the bat, I use a ppc Mac G5 running 10.4.11. I use this for Music production, and general music listening in my studio. For Audio I use pro tools HD 7.3 (as well as logic 8), with a digidesign 192 IO interface, and run most ofmy audio thru that. Now that we have that out the way... I normally dont agree to updates, as I would not like to upset a balance thats been working perfectly for me for some time, but 2 days ago, one of my assistants was using the computer and agreed to the latest update for Itunes, quicktime, and logic (but not the security update). Immedietly after the update finished (during which he said the quicktime update crashed), the system started going haywire, pro tools was shutting down, itunes wouldn't open, the like... Well after uninstalling and reinstalling itunes and quicktime, all order was restored, except for one AWFUL problem.. the sound coming out of any program BESIDES pro tools (itunes, logic, toast) is very strange, as if its coming thru very cheap speakers. I've run itunes through both the digi interface and the standard sound card (it has the same problem), and checked the EQ settings (flat), my sample and bit rates are straight... I have no idea! if anyone could offer some insight, It would be much appreciated! Thanks!!

    HI and Welcome to Apple Discussions...
    It's possible there's an underlying problem with your hard drive.
    Insert the installer disk and Restart, holding down the "C" key until grey Apple appears.
    Go to Installer menu (Panther and earlier) or Utilities menu (Tiger and later) and launch Disk Utility.
    Select your HDD (manufacturer ID) in the left panel.
    Select First Aid in the Main panel.
    *(Check S.M.A.R.T Status of HDD at the bottom of right panel. It should say: Verified)*
    Click Repair Disk on the bottom right.
    If DU reports disk does not need repairs quit DU and restart.
    If DU reports errors Repair again and again until DU reports disk is repaired.
    When you are finished with DU, from the Menu Bar, select Utilities/Startup Manager.
    Select your start up disk and click Restart
    Also, make sure you have sufficient drive space. Control or right click the MacintoshHD icon on your Desktop. Click "Get Info". Under the General tab you will see Capacity and Available. Make sure there is at least 10% available disk space, 15% is better.
    If the drive appears to be ok and you have enough available disk space, you could try the 10.4.11 combo update available here. http://www.apple.com/downloads/macosx/apple/macosx_updates/macosx10411comboupdat eppc.html
    Make sure and run Disk Utility and repair disk permissions BEFORE and AFTER the installation.
    Quit any open applications/programs. Launch Disk Utility. Select MacintoshHD in the panel on the left, select the FirstAid tab. Click: Repair Disk Permissions. When it's finished from the Menu Bar, Quit Disk Utility and restart your Mac.
    Carolyn

  • Jtable Update problem .. Please help !!!!!!!!

    Hi ,
    I am trying to get my updated Jtable, stored in a table of database over a previous table ......after updating it via drag n drop ....
    But even after I change the cell position to make the changes ... it still takes up the old value of that cell and not the new one while writing the data in the database table...
    Here is the code .... Please see it and tell me if it is possible :
    package newpackage;
    import java.sql.*;
    import java.util.Vector;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.Dimension;
    import java.text.*;
    import newpackage.ExcelExporter;
    import java.awt.Dimension;
    import javax.swing.border.*;
    import javax.swing.table.*;
    import java.awt.datatransfer.*;
    import java.awt.dnd.*;
    import java.awt.image.*;
    import java.io.*;
    import java.util.*;
    import java.awt.print.*;
    import java.awt.*;
    import java.io.*;
    import java.util.Random.*;
    import javax.swing.*;
    import java.text.*;
    import javax.swing.DefaultCellEditor;
    import javax.swing.JComboBox;
    import javax.swing.JTable;
    import javax.swing.table.DefaultTableCellRenderer;
    import javax.swing.table.TableColumn;
    public class tab7le extends javax.swing.JFrame {
        Vector columnNames = new Vector();
        Vector data = new Vector();
        Connection con;
    Statement stat;
    ResultSet rs;
    int li_cols = 0;
    Vector allRows;
    Vector row;
    Vector newRow;
    Vector colNames;
    String dbColNames[];
    String pkValues[];
    String tableName;
    ResultSetMetaData myM;
    String pKeyCol;
    Vector deletedKeys;
    Vector newRows;
    boolean ibRowNew = false;
    boolean ibRowInserted = false;
        private Map<String, Color> colormap = new HashMap<String, Color>();
        /** Creates new form tab7le */
        public tab7le() {
            populate();
            initComponents();
           public void updateDB(){
                     try{
            Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
          catch (ClassNotFoundException e){
                System.out.println("Cannot Load Driver!");
          try{
             String url = "jdbc:odbc:FAMS";
             con = DriverManager.getConnection(url);
             stat = con.createStatement();
             rs = stat.executeQuery("Select * from SubAllot");
             deletedKeys = new Vector();
             newRows = new Vector();
             myM = rs.getMetaData();
             tableName = myM.getTableName(1);
             li_cols = myM.getColumnCount();
             dbColNames = new String[li_cols];
             for(int col = 0; col < li_cols; col ++){
                dbColNames[col] = myM.getColumnName(col + 1);
             allRows = new Vector();
             while(rs.next()){
                newRow = new Vector();
                for(int i = 1; i <= li_cols; i++){
                   newRow.addElement(rs.getObject(i));
                } // for
                allRows.addElement(newRow);
             } // while
          catch(SQLException e){
             System.out.println(e.getMessage());
    String updateLine[] = new String[dbColNames.length];
          try{
             DatabaseMetaData dbData = con.getMetaData();
             String catalog;
             // Get the name of all of the columns for this table
             String curCol;
             colNames = new Vector();
             ResultSet rset1 = dbData.getColumns(null,null,tableName,null);
             while (rset1.next()) {
                curCol = rset1.getString(4);
                colNames.addElement(curCol);
             rset1.close();
             pKeyCol = colNames.firstElement().toString();
             // Go through the rows and perform INSERTS/UPDATES/DELETES
             int totalrows;
             totalrows = allRows.size();
             String dbValues[];
             Vector currentRow = new Vector();
             pkValues = new String[allRows.size()];
             // Get column names and values
             for(int i=0;i < totalrows;i++){
                currentRow = (Vector) allRows.elementAt(i);
                int numElements = currentRow.size();
                dbValues = new String[numElements];
                for(int x = 0; x < numElements; x++){
                   String classType = currentRow.elementAt(x).getClass().toString();
                   int pos = classType.indexOf("String");
                   if(pos > 0){ // we have a String
                      dbValues[x] = "'" + currentRow.elementAt(x) + "'";
                      updateLine[x] = dbColNames[x] + " = " + "'" + currentRow.elementAt(x) + "',";
                      if (dbColNames[x].toUpperCase().equals(pKeyCol.toUpperCase())){
                        pkValues[i] = currentRow.elementAt(x).toString() ;
                   pos = classType.indexOf("Integer");
                   if(pos > 0){ // we have an Integer
                      dbValues[x] = currentRow.elementAt(x).toString();
                      if (dbColNames[x].toUpperCase().equals(pKeyCol.toUpperCase())){
                         pkValues[i] = currentRow.elementAt(x).toString();
                      else{
                         updateLine[x] = dbColNames[x] + " = " + currentRow.elementAt(x).toString() + ",";
                   pos = classType.indexOf("Boolean");
                   if(pos > 0){ // we have a Boolean
                      dbValues[x] = currentRow.elementAt(x).toString();
                      updateLine[x] = dbColNames[x] + " = " + currentRow.elementAt(x).toString() + ",";
                      if (dbColNames[x].toUpperCase().equals(pKeyCol.toUpperCase())){
                         pkValues[i] = currentRow.elementAt(x).toString() ;
                } // For Loop
                // If we are here, we have read one entire row of data. Do an UPDATE or an INSERT
                int numNewRows = newRows.size();
                int insertRow = 0;
                boolean newRowFound;
                for (int z = 0;z < numNewRows;z++){
                   insertRow = ((Integer) newRows.get(z)).intValue();
                   if(insertRow == i+1){
                      StringBuffer InsertSQL = new StringBuffer();
                      InsertSQL.append("INSERT INTO " + tableName + " (");
                      for(int zz=0;zz<=dbColNames.length-1;zz++){
                         if (dbColNames[zz] != null){
                            InsertSQL.append(dbColNames[zz] + ",");
                      // Strip out last comma
                      InsertSQL.replace(InsertSQL.length()-1,InsertSQL.length(),")");
                      InsertSQL.append(" VALUES(" + pkValues[i] + ",");
                      for(int c=1;c < dbValues.length;c++){
                         InsertSQL.append(dbValues[c] + ",");
                      InsertSQL.replace(InsertSQL.length()-1,InsertSQL.length(),")");
                      System.out.println(InsertSQL.toString());
                      stat.executeUpdate(InsertSQL.toString());
                      ibRowInserted=true;
                } // End of INSERT Logic
                // If row has not been INSERTED perform an UPDATE
                if(ibRowInserted == false){
                   StringBuffer updateSQL = new StringBuffer();
                   updateSQL.append("UPDATE " + tableName + " SET ");
                   for(int z=0;z<=updateLine.length-1;z++){
                      if (updateLine[z] != null){
                         updateSQL.append(updateLine[z]);
                   // Replace the last ',' in the SQL statement with a blank. Then add WHERE clause
                   updateSQL.replace(updateSQL.length()-1,updateSQL.length()," ");
                   updateSQL.append(" WHERE " + pKeyCol + " = " + pkValues[i] );
                   System.out.println(updateSQL.toString());
                   stat.executeUpdate(updateSQL.toString());
                   } //for
             catch(Exception ex){
                System.out.println("SQL Error! Cannot perform SQL UPDATE " + ex.getMessage());
             // Delete records from the DB
             try{
                int numDeletes = deletedKeys.size();
                String deleteSQL;
                for(int i = 0; i < numDeletes;i++){
                   deleteSQL = "DELETE FROM " + tableName + " WHERE " + pKeyCol + " = " +
                                                ((Integer) deletedKeys.get(i)).toString();
                System.out.println(deleteSQL);
                   stat.executeUpdate(deleteSQL);
                // Assume deletes where successful. Recreate Vector holding PK Keys
                deletedKeys = new Vector();
             catch(Exception ex){
                System.out.println(ex.getMessage());
        public void populate()
            try
                //  Connect to the Database
                Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                Connection con = DriverManager.getConnection("Jdbc:Odbc:FAMS"," "," ");
                System.out.println("ok1");
                //  Read data from a table
                String sql;
                 sql = "Select * from SubAllot";
                 System.out.println("ok1");
                Statement stmt = con.createStatement();
                System.out.println("ok1");
                ResultSet rs = stmt.executeQuery( sql );
                System.out.println("ok1");
                ResultSetMetaData md = rs.getMetaData();
                System.out.println("ok1");
                int columns = md.getColumnCount();
                for(int i = 0;i<columns;i++){
                    columnNames.addElement(md.getColumnName(i+1));
                    System.out.println("ok2");
                while (rs.next())
                    Vector row = new Vector(columns);
                    for (int i = 1; i <columns+1; i++)
                        row.addElement( rs.getObject(i) );
                    data.addElement( row );
            catch(Exception e){
                e.printStackTrace();
                 public void dropmenu(JTable table,TableColumn subpref1) {
            //Set up the editor for the sport cells.
            JComboBox comboBox = new JComboBox();
          for (int i = 0;i<=20;i++)
           comboBox.addItem(i);
            subpref1.setCellEditor(new DefaultCellEditor(comboBox));
            //Set up tool tips for the sport cells.
            DefaultTableCellRenderer renderer =
                    new DefaultTableCellRenderer();
            renderer.setToolTipText("Click for combo box");
            subpref1.setCellRenderer(renderer);
                       abstract class StringTransferHandler extends TransferHandler {
            public int dropAction;
            protected abstract String exportString(final JComponent c);
            protected abstract void importString(final JComponent c, final String str);
            @Override
            protected Transferable createTransferable(final JComponent c) {
                return new StringSelection(exportString(c));
            @Override
            public int getSourceActions(final JComponent c) {
                return MOVE;
            @Override
            public boolean importData(final JComponent c, final Transferable t) {
                if (canImport(c, t.getTransferDataFlavors())) {
                    try {
                        String str = (String) t.getTransferData(DataFlavor.stringFlavor);
                        importString(c, str);
                        return true;
                    } catch (UnsupportedFlavorException ufe) {
                    } catch (IOException ioe) {
                return false;
            @Override
            public boolean canImport(final JComponent c, final DataFlavor[] flavors) {
                for (int ndx = 0; ndx < flavors.length; ndx++) {
                    if (DataFlavor.stringFlavor.equals(flavors[ndx])) {
                        return true;
                return false;
        class TableTransferHandler extends StringTransferHandler {
            private int dragRow;
            private int[] dragColumns;
            private BufferedImage[] image;
            private int row;
            private int[] columns;
            public JTable target;
            private Map<String, Color> colormap;
            private TableTransferHandler(final Map<String, Color> colormap) {
                this.colormap = colormap;
            @Override
            protected Transferable createTransferable(final JComponent c) {
                JTable table = (JTable) c;
                dragRow = table.getSelectedRow();
                dragColumns = table.getSelectedColumns();
                createDragImage(table);
                return new StringSelection(exportString(c));
            protected String exportString(final JComponent c) {
                JTable table = (JTable) c;
                row = table.getSelectedRow();
                columns = table.getSelectedColumns();
                StringBuffer buff = new StringBuffer();
                colormap.clear();
                for (int j = 0; j < columns.length; j++) {
                    Object val = table.getValueAt(row, columns[j]);
                    buff.append(val == null ? "" : val.toString());
                    if (j != columns.length - 1) {
                        buff.append(",");
                    colormap.put(row+","+columns[j], Color.LIGHT_GRAY);
                table.repaint();
                return buff.toString();
            protected void importString(final JComponent c, final String str) {
                target = (JTable) c;
                DefaultTableModel model = (DefaultTableModel) target.getModel();
                String[] values = str.split("\n");
                int colCount = target.getSelectedColumn();
                int max = target.getColumnCount();
                for (int ndx = 0; ndx < values.length; ndx++) {
                    String[] data = values[ndx].split(",");
                    for (int i = 0; i < data.length; i++) {
                        String string = data;
    if(colCount < max){
    Object val = model.getValueAt(target.getSelectedRow(), colCount);
    model.setValueAt(string, target.getSelectedRow(), colCount);
    model.setValueAt(val, dragRow, dragColumns[i]);
    colCount++;
    public BufferedImage[] getDragImage() {
    return image;
    private void createDragImage(final JTable table) {
    if (dragColumns != null) {
    try {
    image = new BufferedImage[dragColumns.length];
    for (int i = 0; i < dragColumns.length; i++) {
    Rectangle cellBounds = table.getCellRect(dragRow, i, true);
    TableCellRenderer r = table.getCellRenderer(dragRow, i);
    DefaultTableModel m = (DefaultTableModel) table.getModel();
    JComponent lbl = (JComponent) r.getTableCellRendererComponent(table,
    table.getValueAt(dragRow, dragColumns[i]), false, false, dragRow, i);
    lbl.setBounds(cellBounds);
    BufferedImage img = new BufferedImage(lbl.getWidth(), lbl.getHeight(),
    BufferedImage.TYPE_INT_ARGB_PRE);
    Graphics2D graphics = img.createGraphics();
    graphics.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.6f));
    lbl.setBorder(BorderFactory.createLineBorder(Color.LIGHT_GRAY));
    lbl.paint(graphics);
    graphics.dispose();
    image[i] = img;
    } catch (RuntimeException re) {
    class TableDropTarget extends DropTarget {
    private Insets autoscrollInsets = new Insets(20, 20, 20, 20);
    private Rectangle rect2D = new Rectangle();
    private TableTransferHandler handler;
    public TableDropTarget(final TableTransferHandler h) {
    super();
    this.handler = h;
    @Override
    public void dragOver(final DropTargetDragEvent dtde) {
    handler.dropAction = dtde.getDropAction();
    JTable table = (JTable) dtde.getDropTargetContext().getComponent();
    Point location = dtde.getLocation();
    int row = table.rowAtPoint(location);
    int column = table.columnAtPoint(location);
    table.changeSelection(row, column, false, false);
    paintImage(table, location);
    autoscroll(table, location);
    super.dragOver(dtde);
    public void dragExit(final DropTargetDragEvent dtde) {
    clearImage((JTable) dtde.getDropTargetContext().getComponent());
    super.dragExit(dtde);
    @Override
    public void drop(final DropTargetDropEvent dtde) {
    Transferable data = dtde.getTransferable();
    JTable table = (JTable) dtde.getDropTargetContext().getComponent();
    clearImage(table);
    handler.importData(table, data);
    super.drop(dtde);
    private final void paintImage(final JTable table, final Point location) {
    Point pt = new Point(location);
    BufferedImage[] image = handler.getDragImage();
    if (image != null) {
    table.paintImmediately(rect2D.getBounds());
    rect2D.setLocation(pt.x - 15, pt.y - 15);
    int wRect2D = 0;
    int hRect2D = 0;
    for (int i = 0; i < image.length; i++) {
    table.getGraphics().drawImage(image[i], pt.x - 15, pt.y - 15, table);
    pt.x += image[i].getWidth();
    if (hRect2D < image[i].getHeight()) {
    hRect2D = image[i].getHeight();
    wRect2D += image[i].getWidth();
    rect2D.setSize(wRect2D, hRect2D);
    private final void clearImage(final JTable table) {
    table.paintImmediately(rect2D.getBounds());
    private Insets getAutoscrollInsets() {
    return autoscrollInsets;
    private void autoscroll(final JTable table, final Point cursorLocation) {
    Insets insets = getAutoscrollInsets();
    Rectangle outer = table.getVisibleRect();
    Rectangle inner = new Rectangle(outer.x + insets.left,
    outer.y + insets.top,
    outer.width - (insets.left + insets.right),
    outer.height - (insets.top + insets.bottom));
    if (!inner.contains(cursorLocation)) {
    Rectangle scrollRect = new Rectangle(cursorLocation.x - insets.left,
    cursorLocation.y - insets.top,
    insets.left + insets.right,
    insets.top + insets.bottom);
    table.scrollRectToVisible(scrollRect);
    /** This method is called from within the constructor to
    * initialize the form.
    * WARNING: Do NOT modify this code. The content of this method is
    * always regenerated by the Form Editor.
    // <editor-fold defaultstate="collapsed" desc="Generated Code">
    private void initComponents() {
    jScrollPane1 = new javax.swing.JScrollPane();
    table = new javax.swing.JTable();
    jButton1 = new javax.swing.JButton();
    jButton2 = new javax.swing.JButton();
    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
    table.setModel(new javax.swing.table.DefaultTableModel(
    data, columnNames
    jScrollPane1.setViewportView(table);
    //populate();
    table.getTableHeader().setReorderingAllowed(false);
    table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    table.setCellSelectionEnabled(true);
    table.setDragEnabled(true);
    TableTransferHandler th = new TableTransferHandler(colormap);
    table.setTransferHandler(th);
    table.setDropTarget(new TableDropTarget(th));
    dropmenu(table, table.getColumnModel().getColumn(11));
    jButton1.setText("Update");
    jButton1.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(java.awt.event.ActionEvent evt) {
    jButton1ActionPerformed(evt);
    jButton2.setText("Ex");
    jButton2.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(java.awt.event.ActionEvent evt) {
    jButton2ActionPerformed(evt);
    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(
    layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addGroup(layout.createSequentialGroup()
    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addGroup(layout.createSequentialGroup()
    .addGap(92, 92, 92)
    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 605, javax.swing.GroupLayout.PREFERRED_SIZE))
    .addGroup(layout.createSequentialGroup()
    .addGap(347, 347, 347)
    .addComponent(jButton1)
    .addGap(115, 115, 115)
    .addComponent(jButton2)))
    .addContainerGap(73, Short.MAX_VALUE))
    layout.setVerticalGroup(
    layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addGroup(layout.createSequentialGroup()
    .addGap(47, 47, 47)
    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 354, javax.swing.GroupLayout.PREFERRED_SIZE)
    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addGroup(layout.createSequentialGroup()
    .addGap(58, 58, 58)
    .addComponent(jButton1)
    .addContainerGap(83, Short.MAX_VALUE))
    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
    .addComponent(jButton2)
    .addGap(65, 65, 65))))
    pack();
    }// </editor-fold>
    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {                                        
    updateDB(); // TODO add your handling code here:
    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {                                        
    try {
    String pathToDesktop = System.getProperty("user.home")+File.separator+"Desktop";
    pathToDesktop = pathToDesktop + "//Final Allotment.xls";
    ExcelExporter exp = new ExcelExporter();
    exp.exportTable(table, new File(pathToDesktop));
    JOptionPane.showMessageDialog(this,"File exported and saved on desktop!");
    catch (IOException ex) {
    System.out.println(ex.getMessage());
    ex.printStackTrace();
    } // TODO add your handling code here:
    * @param args the command line arguments
    public static void main(String args[]) {
    java.awt.EventQueue.invokeLater(new Runnable() {
    public void run() {
    new tab7le().setVisible(true);
    // Variables declaration - do not modify
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTable table;
    // End of variables declaration
    Please help !!!!!!!!
    Thanks in advance.....                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                

    Here is the code Do you expect people to read through 400 lines of code to understand what you are doing?
    Why post code with access to a database? We can't access the database.
    Search the forum for my "Database Information" (without the space) example class which shows you how to refresh a table with new data.
    If you need further help then you need to create a [Short, Self Contained, Compilable and Executable, Example Program (SSCCE)|http://homepage1.nifty.com/algafield/sscce.html], that demonstrates the incorrect behaviour.

  • Strange waveform update problem:Urgent!!

    I got a very strange problem with my waveform chart display, it can only display 2 plots on one waveform chart. I need to display 4 plots on one waveform chart at the same time, please give me some good ideas how to do this. The waveform chart reference is used. My program has been attached, please run it to see the problem, only zeros are displayed, if you only connect two data, the display is correct (you need to change subvi). LabVIEW8.5 is required.
    Attachments:
    Main.vi ‏16 KB
    Subvi.vi ‏17 KB

    Find the VIs
    Balaji PK (CLA)
    Ever tried. Ever failed. No matter. Try again. Fail again. Fail better
    Don't forget Kudos for Good Answers, and Mark a solution if your problem is solved.
    Attachments:
    SubviV1.vi ‏17 KB
    Main.vi ‏29 KB

  • Update problem - VBDATA table

    Dear All,
    We have update problems in our Quality systems, and also in every R/3 system that we create from a Production system copy.
    Sometime the UPD and UP2 work processes hung without apparent reason.
    In the SM50 I can see one or more of my update processes running for a lot of time (many hours) on the table VBDATA without perform any action.
    In the tcode SM12 I donu2019t see any kind of lock, and I donu2019t understand why only sometime this problem happens.
    Of course, from the SM13 I can see that during this problem the system is not able to perform any kind of update.
    As I told in the beginning of the message, I have the same problem in other two R/3 systems, both created with a system copy from the production system.
    The Production and the Developer systems seem not affected by this problem.
    Have you got any idea about the reason of the problem?
    Even if the Production systems is not directly affected, all the IT department is not able to work on the Quality system (or any other Test system), and the only workaround is to kill the UPD (or UP2) WPs affected.
    Thanks in advance,
    Federico Biavati
    My R/3 System is a 4.7 on SLES9 and Oracle 10.2.0.2

    Hello Siva,
    This is what I did:
    > Check how many entries do you have in VBDATA currently.
    More than 1.000 in every SAP systems that Iu2019m creating from Production
    > You might want to run the reorganize updates program to clear the old updates
    > that are pending/in error
    Good point!!
    After the reorganization (ST14 u2013 Reorganize update requests) the table VBDATA is empty.
    Iu2019ll check and Iu2019ll let you know if the problem is definitively solved.
    Thanks for you help,
    Federico

  • Chart x scale update problem

    LabVIEW  8.5.1
    Sweep Chart Problem
    The x scale values do not update until after the 2nd sweep.  The red line cursor gets to the end of the sweep and starts the next, but the scale numbers do not update until the next sweep starts.
    It appears to be a problem with the chart, since it happens with any vi with a sweep chart.  I've used versions 6 through 7 for years and never seen this.  I've only recently moved to a new job with a new machine and version 8.5.1., so I'm not sure what to try.
    I've included a simple example.
    Thanks much,
    JSC321
    Attachments:
    Chart Sweep Scale Update Problem.vi ‏32 KB

    You have a typical race condition!
    There is no data dependency between the property node and the while loop, so in your case the loop starts executing first and the property node starts slightly later, immediately erasing the first point. Execution order is not defined.
    All you need to do is add a data dependency, e.g. as with the error cluster in the image. This forces the property node to complete before the loop is allowed to start.
    (Execution order is enforced even if the wire value is not even used inside the loop )
    Try it!
    Message Edited by altenbach on 12-23-2008 11:08 PM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    HistoryRace.png ‏10 KB

  • Updating problem...I have a update that starts out going through but then does not finish just keep running

    also with the update problem it says software update and below the running bar it says connecting to the server

    Please do the following:<br><br>
    #Go to [http://www.mozilla.com/en-US/firefox/fx/?ref=logo Download Firefox 4.0.1] and download a fresh installation file to the desktop.<br><br>
    #Then go to Add/Remove Programs, scroll down to "Mozilla Firefox" and remove it, choosing to keep your bookmarks, customizations etc., (''don't checkmark the box'').<br><br>
    #Then reboot and delete the folder called "Mozilla Firefox" at this location: C:\Program Files\Mozilla Firefox<br><br>
    #Finally run the installation file you downloaded to the desktop earlier.<br>
    Your bookmarks, customizations etc., are maintained in a different location and will become available to you again once you complete the installation.

  • Strange JTable behaviour - everything is highlighted

    Hello all,
    im experiencing some strange JTable behaviour, and im not so sure why. When i run my program, the JTable appears, but all the cells are highlighted in advance. Also, i can now only select one cell at a time. I have set myTable.setSelectionModeListSelectionModel.SINGLE_INTERVAL_SELECTION);  myTable.setCellSelectionEnabled(true);and my renderer code is below. I call the renderer by using the setDefaultRenderer method with(Object.class,myRenderer).
    I have also changed isCellEditable to return true. If i dont use Object.class, and try to use my own custom class, the JTable is not all highlighted, but it doesnt seem to use myRenderer, and when i click on the header of Column A, all cells from column B and beyond become highlight, which is not normal behaviour. I thought the colum you selected should be highlighted.
    Sorry for the long post, i hope the above makes sense...this is really quite bizzare, and im not so sure why this is happening. Thanks for any advice you can give, regards, Rupz
    import javax.swing.*;
    import javax.swing.table.DefaultTableCellRenderer;
    import javax.swing.border.*;
    import java.awt.Component;
    import java.awt.Color;
    import java.awt.Rectangle;
    import java.util.*;
    import java.awt.*;
    public class MyTableCellRenderer extends DefaultTableCellRenderer{
         private Font cellFont;
         private LineBorder  selectBorder;
        private EmptyBorder emptyBorder;
         public MyTableCellRenderer() {
              super();
              setOpaque(true);
              emptyBorder  = new EmptyBorder(1, 2, 1, 2);
              cellFont = new Font("Times", Font.PLAIN, 10);
              setFont(cellFont);
              selectBorder = new LineBorder(Color.red);
         private boolean isHeaderCell(int row, int column){return column == 0;}
         public Component getTableCellRendererComponent (JTable myTable, Object value, boolean isSelected, boolean hasFocus, int row, int column){
              //super.getTableCellRendererComponent(myTable, value, isSelected, hasFocus,row, column);
              if (isSelected){
                   super.setForeground(myTable.getSelectionForeground());
                   super.setBackground(myTable.getSelectionBackground());
                   setBorder(selectBorder);
              else{
                   super.setForeground(myTable.getSelectionForeground());
                   super.setBackground(myTable.getSelectionBackground());
                   setBorder(emptyBorder);
         if (hasFocus) {
              setBorder(selectBorder);
              if (myTable.isCellEditable(row,column)) {
                   super.setForeground(UIManager.getColor("Table.focusCellForeground"));
                   super.setBackground(UIManager.getColor("Table.focusCellBackground"));
         else {setBorder(noFocusBorder);}
         setValue(value, isSelected, hasFocus, row, column);
    //      Color bDis = getBackground();
    //      boolean colourEquals = (bDis != null) && (bDis.equals(myTable.getBackground()) ) & myTable.isOpaque();
    //      setOpaque (!colourEquals);
         return this;
         public void setValue (Object value, boolean hasFocus, boolean isSelected, int row, int column){
              if (value instanceof myCell){
                   myCell foo = (myCell)value;
                   Object data = foo.getValue(row,column);
                   if (isHeaderCell(row, column)) {
                    //label cells are center aligned
                        setHorizontalAlignment(JTextField.CENTER);
                       }else {
                              if (data instanceof Number) {
                                  //numbers are right justified
                            setHorizontalAlignment(JTextField.RIGHT);
                              }else {
                                  //everything else is left justified
                            setHorizontalAlignment(JTextField.LEFT);
                          //value to display in table
                       setText((data == null) ? "" : data.toString());
               else {
                          //not cell object so render with toString of that object
                          setText((value == null) ? "" : value.toString());

    Hi VV!
    thanks for the reply - now the table isnt all highlight when loaded, but as for cell celection..thats a different matter. I did have myTable.setCellSelectionEnabled(true); but no, the cell behaviour is really, eally weird, quite hard to explain, but here goes.
    If i try to select cell D1 and D2 - D1 is selected, D2, E2,F2 and so on become selected. If i try to add D3 to the mix, the entire row 3 is selected, and as soon as i let go of the mouse button, the entire table except row 1 gets selected. really really weird. Below is my tableModel and what i do to the table. Thanks for your help,
    regards
    Rupz
    myTable.setModel(new myTableModel(this,40,40));
         // Create a row-header to display row numbers.
         // This row-header is made of labels whose Borders,
         // Foregrounds, Backgrounds, and Fonts must be
         // the one used for the table column headers.
         // Also ensure that the row-header labels and the table
         // rows have the same height.
         numRows = myTable.getColumnCount();
         numCols = myTable.getRowCount();
         TableColumn       aColumn   = myTable.getColumnModel().getColumn(0);
         TableCellRenderer aRenderer = myTable.getTableHeader().getDefaultRenderer();
         Component aComponent = aRenderer.getTableCellRendererComponent(myTable, aColumn.getHeaderValue(), false, false, -1, 0);
         Font  aFont       = aComponent.getFont();
         Color aBackground = aComponent.getBackground();
         Color aForeground = aComponent.getForeground();
         Border      border  = (Border)UIManager.getDefaults().get("TableHeader.cellBorder");
         FontMetrics metrics = getFontMetrics(cellFont);
          * Creating a panel to be used as the row header.
          * Since I'm not using any LayoutManager,
          * a call to setPreferredSize().
         JPanel pnl = new JPanel((LayoutManager)null);
         Dimension dim = new Dimension( 40,  rowHeight*numRows);
         pnl.setPreferredSize(dim);
         // Adding the row header labels
         dim.height = rowHeight;
         for (int ii=0; ii<numRows; ii++) {
           JLabel lbl = new JLabel(Integer.toString(ii+1), SwingConstants.CENTER);
           lbl.setFont(aFont);
           lbl.setBackground(aBackground);
           lbl.setForeground(aForeground);
           lbl.setBorder(border);
           lbl.setBounds(0, ii*dim.height, dim.width, dim.height);
           pnl.add(lbl);
         JViewport vp = new JViewport();
         dim.height = rowHeight*numRows;
         vp.setViewSize(dim);
         vp.setView(pnl);
         // Set resize policy and make sure
         // the table's size is tailored
         // as soon as it gets drawn.
         myTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
         Dimension dimScpViewport = myTable.getPreferredScrollableViewportSize();
         if (numRows>30) dimScpViewport.height = 30*rowHeight;
         else           dimScpViewport.height  = numRows*rowHeight;
         if (numCols>15)
           dimScpViewport.width = 15*myTable.getColumnModel().getTotalColumnWidth()/numCols;
         else
           dimScpViewport.width = myTable.getColumnModel().getTotalColumnWidth();
         myTable.setPreferredScrollableViewportSize(dimScpViewport);
         myTable.repaint();
    And the table model
    public class myTableModel extends DefaultTableModel {
         private MySpread mySpreadsheet;
         public myTableModel (MySpread aSpreadsheet){
              super();
              mySpreadsheet = aSpreadsheet;
         public myTableModel (MySpread aSpreadsheet, int rows,int cols){
              super(rows,cols);
    //                 for(int x = 0; x < rows; x++) {
    //                      myCell temp = new myCell(new Integer(x+1));
    //                  super.setValueAt(temp, x, 0);
            for(int x =0 ; x < rows; x++)
             for (int y = 0; y < cols; y++)
              // we initialize it here
              super.setValueAt(new myCell(rows,cols,("")),x,y);
         mySpreadsheet = aSpreadsheet;
         public boolean isCellEditable(int row, int column) {return true;}  
         

  • 10.5.7 update problems

    After installing the 10.5.7 update, Mail, iTunes and iPhoto will not run anymore. Anyone else having this problem?

    jjtopspin wrote:
    Before I came to these apple discussions re: update problems with 10.5.7, I tried to update this version yesterday and at the end of the download this message came up, the update "Mac OS X update" can't be saved. The digital signature for this package is incorrect. The package may have been tampered with or corrupted since being signed to Apple.
    I got the same message. The downloaded file that generated the message was only about 560 KB, indicating it was an incomplete download. I moved it to the trash & tried again. The second download attempt succeeded. I had a minor if nerve-wracking issue with the update (the blue looping screen reported in another topic in this forum) but after a forced shutdown & restart the update was completed successfully.
    I have since updated my two other Macs so all those listed in my profile are now running 10.5.7. All do so without any problems & in fact work better & more stably than ever before.
    I doubt that I'm unusual in this respect. Some users will have problems but I believe most won't, & for those that do most problems will turn out to be caused by something other than the update itself. So it has been for every previous Leopard update; I see no reason to think this one will be any different.

  • Cache update problem in Integration Directory

    Hi all,
    We have a cache update problem in our PI development server.
    If we try to edit, save and activate any of the ID objects, under Cache notifications>Central Adapter Engine> all these objects are displayed as gray items.
    We have tried:
    1. Clearing the SLD Data Cache.
    2. Did SXI_CACHE complete refresh.
    3. Did CPA cache refresh.
    4. Did a complete cache refresh of the server.
    5. Restarted the server.
    But still the problem has not bee resolved. Could you pls provide your inputs and resolution points.
    Thank you very much.
    regards,
    Jack Nuson

    HI Jack ,
    first try to manually update the cache from ID select on your cache notifiaction and click on delta cache refresh button and refresh button .IF it does not yied any result then
    Perform a full cache refresh using the URL
    http://<host>:<port>/CPACache/refresh?mode=full . If the cache refresh happens properly then your problem will get resolved other wise you have to see the cache log to view why it failed there it will show you the exact reason . You might need to restart your java server also if the problem persist .
    Regards,
    Saurabh

  • Twitter Update Problem

    Seems I have a Twitter Update problem. 1. I have no pirated software on my computer either from the App Store or anywhere else. 2. I did buy a set off templates for iWork through the App Store with my Bosses Apple ID (it's for work). Is that really the problem. That's ridiculous.  The apple ID is mine, as is much of the software, but it's a computer use for work. If this is true it makes the App Store a lot less useful.

    my apologies I was so annoyed. I didn't bother to state my issue. The issue is: Twitter is constantly asking to be updated. Even after it's updated. Even if it's deleted. I looked at the forums for a solution and found that people were having this problem who installed pirated app store apps.
    I am logged into the app store on my account. All but one of the apps on my machine that come from the app store are on my account. However there is one piece of software on my account that I purchased, by logging out and logging in with her ID, purchasing it, installing and logging out, and again logging in as myself. I don't have an issue with that app. However Twitter, which was installed under my username, constantly says it needs to be updated. Hope that makes it clearer.

  • HT4623 Update problem

    Hello
    How do i solve problem when i'am doing my update from 5.1 to 6.1.2 the massage (3194) occured. Please help me to solve this update problem.
    I'am using iphone 4

    See this support document http://support.apple.com/kb/ts4451

  • TS3694 im trying to restore my iphone and itunes doesnt allow it to restore without updating. problem is that i have the latest update on my iphone so why is it forcing me to wait for a 7hr update download when i already have the update and only need to r

    im trying to restore my iphone and itunes doesnt allow it to restore without updating. problem is that i have the latest update on my iphone so why is it forcing me to wait for a 7hr update download when i already have the update and only need to restore?

    Sadly, the iPhone 3G can not be upgraded beyond iOS 4.2.1.

  • Im trying to update, but all it does is backup my phone, My itunes is updated, BTW, I just went to Apple bar, i had previous problem with prior phone, now im having this update  problem with thyis new phone, someone HELP!!

    Im trying to update, but all it does is backup my phone, My itunes is updated, BTW, I just went to Apple bar, i had previous problem with prior phone, now im having this update  problem with thyis new phone, someone HELP!!

    Same here and this is driving me crazy. I can buy, but can't upgrade. Grrr.

  • Jelly Bean Update Problems on Xperia S Tablet

    I think we need a new topic for Jelly Bean update problems and fixes.
    Solved!
    Go to Solution.

    small fonts and icons blurry pixelated in notification or google agenda widget
    browser crashes a lot.
    Missing jelly bean home launcher
    Wifi disconnecting for no reason.
    Animations aren't smooth tough tablet is more responsive then android 4.0.3 release6b

Maybe you are looking for