Problem faced with Jtable

I have a row added to JTable.I am trying to edit column 2 in it.Now i keep my cursor in the same column which is being edited (i.e the focus remains in the column being edited) & click on Cancel Button
By means of this button i clear the Jtable.i.e delete the row which is added to it.
Now i add 1 more row to this Jtable.
The same column of the newly added row displays the contents which had been edited previously.
Eg : Row consists of 3 columns Col. 1 : Name
Col 2 : Roll No
Col 3 : Place .
Assume that i add a row with name pradeep Roll No. 2 & Place - Mumbai.
I edit col. 2 having roll no. 2 & make it 3.Keeping the focus here only i click on cancel.
This row has been thus deleted.Now i add a new row..which has name : Manish Roll No : 5 & Place : Mumbai.But Column 2 shows 3 instead of 5.
I have tried Jtable..repaint();
jtable.updateUI();
jtable.lostFocus();
jtable.getCellEditor().stopCellEditing();
however still this happens...is there any way to make jtable lose focus externally.....or any other way to handle this.

It's the same what i have explained, though it's not real stuff..the idea is the same....yet i have clarified things below also...i have an textfield wherein i enter the main code.I click on enter & the details related to this code get added to the grid.Like in the example given be4...Let's assume i enter 1 i.e the code in the textfield & click on enter.The details related to 1 are Name : Pradeep Roll No. : 2 & Place : Mumbai.(Note that Name,Roll No & Place are column names)
This gets added to the grid.Now i change the Roll No. which is currently 2 to 3.My focus is in this column.For some reason i don't need this record & click on cancel button.
Now i enter 2 in the Textfield & click on enter. The details expected to be seen in the added row are Name : Manish , Roll No. 5 & Place Mumbai.But what is seen instead of this is Name : Manish , Roll No. 3 & Place : Mumbai.Also the focus is already in column 2.
When we edit a column the code added changes the column data & then calls
jTable.getCellEditor().cancelCellEditing().
The code on clicking cancel calls
jtable.repaint();
jtable.updateUI()
if (jtblBarCodeDetails.isEditing()) {
jtblBarCodeDetails.getCellEditor().stopCellEditing();
well.....that is it..

Similar Messages

  • Any body please can solve my problem that iam facing with JTable

    Dear sir,
    Iam doing an educational product using Swing as front end in that
    iam using JTables. And back end iam using sqlserver. With jtable iam
    facing very serious problem the problem is actually iam entering the values
    in all the columns after that iam pressing the save button its not
    saving but if i click on any of the columns and try to save its saving.
    please anybody can solve my problem.Please if a piece of code is there ill
    be very thankful to you. my mailid is [email protected]
    regards
    surya

    The problem is, the cellEditor does not know that editing has stopped and therefore has not updated the model (where the data actually resides). When you click off the cell to another cell, the first cell knows it must be done editing because you are leaving it. If you click a button (or anything other than another cell), the cell being edited has no knowledge of this. You need to call stopCellEditing() on the cell editor and your problem will be solved. To do this, put the following method into your code and call it when you click the button to clear, save or whatever you need to do.
    public void ceaseEditing() {    int row = this.getEditingRow();
      int col = this.getEditingColumn();
      if (row != -1 && col != -1)
        this.getCellEditor(row,col).stopCellEditing(); 
      }Hope this helped...

  • Problem hotspot with Jtable

    i am sorry may english, my English is not very good, my natural language is Spanish.
    I am using jtable, i beginning it with elements null and i fill it after. But when i am going to fill it i get the next error
    Java VM: Java HotSpot(TM) Client VM (1.4.0-b92 mixed mode)
    # Error ID: 434F444523414348450E43505000BE
    # Problematic Thread: prio=7 tid=0x0AB83010 nid=0x7f8 runnable
    but i use -server for running, then i don`t get the error.
    somebory can help me.

    here is the complete class.
    I call first the method
    iniciaTablaVector(
    boolean puede_editar,
    boolean puede_sortear,
    boolean puede_seleccionar)
    after i get the data from the database and add them into the vectors i call
    the method
    asignaDatosTabla(java.util.Vector vector_campos_usar,
    java.util.Vector vector_campos_usar_i,
    java.util.Vector vector_datos,
    java.util.Vector vector_datos_campos)
    package version01;
    * TITULOS: Programas Boca
    * DESCRIPCION Programas Generales
    * DERECHO RESERVADO Derechos reservado 2001
    * COMPANIA Sistemas Boca
    * @AUTORES Jos� Alberto Felipe y Jos� Luis Marte
    * @VERSION 1.0
    public class ManejoTablaVector02 //extends javax.swing.JTable
    javax.swing.JTable vista_tabla;
    miModeloTabla mimodelotabla;
    private boolean DEBUG = true;
    private boolean PUEDE_SEL_COLUMNA = false;
    private boolean PUEDE_SEL_FILA = true;
    private int fila_sel;
    java.awt.Container frame_usar;
    ManejoParametros manejoparametros;
    java.util.Vector vector_columnas, vector_campos_usar,vector_campos_usar_i;
    java.util.Vector vector_datos,vector_datos_campos ;
    javax.swing.JComponent[] campos;
    java.util.Vector vector_campos;
    java.util.TreeMap map_campos;
    ManejoPantalla manejopantalla;
    javax.swing.ListSelectionModel modelo_fila_sel;
    boolean puede_editar;
    boolean puede_sortear;
    boolean puede_seleccionar;
    //Object[] valores_largo;
    //Class[] clase_columnas;
    java.util.Vector valores_largo;
    java.util.Vector clase_columnas;
    public ManejoTablaVector02(java.awt.Container frame_usar,
    ManejoParametros manejoparametros,
    // java.util.Vector vector_datos,
    // java.util.Vector vector_datos_campos,
    // java.util.Vector vector_campos_usar,
    // java.util.Vector vector_campos_usar_i,
    javax.swing.JComponent[] campos,
    java.util.Vector vector_campos,
    java.util.TreeMap map_campos)
    this.frame_usar = frame_usar;
    this.manejoparametros = manejoparametros;
    /* this.vector_campos_usar = vector_campos_usar;
    this.vector_campos_usar_i = vector_campos_usar_i;
    if (manejoparametros.datos_leidos_tablas == null)
    manejoparametros.datos_leidos_tablas = new java.util.Vector();
    if (manejoparametros.datos_leidos_campos == null)
    manejoparametros.datos_leidos_campos = new java.util.Vector();
    // this.vector_datos =
    // manejoparametros.datos_leidos_tablas;
    // this.vector_datos_campos =
    // manejoparametros.datos_leidos_campos;
    this.campos = campos;
    this.vector_campos = vector_campos;
    this.map_campos = map_campos;
    // obtieneEncabezadoTabla();
    // asignaDatosCamposIniciales();
    // obtieneColumnasTabla();
    //public javax.swing.JTable iniciaTablaVector(
    public void iniciaTablaVector(
    boolean puede_editar,
    boolean puede_sortear,
    boolean puede_seleccionar)
    this.puede_editar = puede_editar;
    this.puede_sortear = puede_sortear;
    this.puede_seleccionar = puede_seleccionar;
    // Instead of making the table display the data as it would normally with:
    // JTable vista_tabla = new JTable(dataModel);
    // Add a sorter, by using the following three lines instead of the one above.
    //va TableSorter sorter = new TableSorter(dataModel);
    vista_tabla= new javax.swing.JTable();
    /*Desabilita el manejo de columna de la tabla para manejarlo manual*/
    vista_tabla.setAutoCreateColumnsFromModel(false);
    manejopantalla = new ManejoPantalla();
    obtieneColumnasTabla();
    this.vector_datos =
    manejoparametros.datos_leidos_tablas;
    this.vector_datos_campos =
    manejoparametros.datos_leidos_campos;
    iniciaVectorDatos();
    mimodelotabla = new miModeloTabla();
    /* mimodelotabla = new miModeloTabla(
    manejoparametros,
    vector_columnas,
    vector_datos,
    vector_datos_campos,
    campos,
    vector_campos,
    map_campos,
    manejopantalla);
    vista_tabla.setModel(mimodelotabla);
    configuraColumna(vista_tabla);
    asignaEscuchadores();
    // asignaAnchoColumnas(vista_tabla, mimodelotabla);
    // asignaEscuchadores();
    // Crear a modelo de tabla.
    class miModeloTabla extends javax.swing.table.AbstractTableModel
    java.util.Vector vector_columnas;
    java.util.Vector vector_campos_usar,
    vector_campos_usar_i;
    java.util.Vector vector_datos,vector_datos_campos;
    javax.swing.JComponent[] campos;
    java.util.Vector vector_campos;
    java.util.TreeMap map_campos;
    ManejoPantalla manejopantalla;
    ManejoParametros manejoparametros;
    public miModeloTabla(ManejoParametros manejoparametros,
    java.util.Vector vector_columnas,
    java.util.Vector vector_datos,
    java.util.Vector vector_datos_campos,
    javax.swing.JComponent[] campos,
    java.util.Vector vector_campos,
    java.util.TreeMap map_campos,
    ManejoPantalla manejopantalla)
    this.manejoparametros = manejoparametros;
    this.vector_columnas = vector_columnas;
    // this.vector_campos_usar = vector_campos_usar;
    // this.vector_campos_usar_i = vector_campos_usar_i;
    this.vector_datos = vector_datos;
    this.vector_datos_campos = vector_datos_campos;
    this.campos = campos;
    this.vector_campos = vector_campos;
    this.map_campos = map_campos;
    this.manejopantalla = manejopantalla;
    // javax.swing.table.TableModel dataModel =
    // new javax.swing.table.AbstractTableModel()
    // These methods always need to be implemented.
    /* Para asignar los anchos de la columna
    Se pueden asignar por el la columna que tenga mas tama�o
    public final Object[] valores_largo = {"Angela", "Andrews",
    "esto es mas que una prueba","prueba",
    "prueba","prueba","prueba","prueba","N"};*/
    class miModeloTabla extends javax.swing.table.AbstractTableModel
    public int getColumnCount()
    return vector_columnas.size();
    public int getRowCount()
    return vector_datos==null ? 0 : vector_datos.size();
    public Object getValueAt(int row, int col)
    int total_columna = ((java.util.Vector)
    (vector_datos.elementAt(row))).size() + 1;
    if (total_columna > col)
    return ((java.util.Vector)
    (vector_datos.elementAt(row))).elementAt(col);
    }else
    return null;
    // The default implementations of these methods in
    // AbstractTableModel would work, but we can refine them.
    public String getColumnName(int columna)
    String indice_str =(String)
    ((Object[])vector_columnas.elementAt(columna))[1];
    int indice_vector_campos = Integer.parseInt(indice_str);
    return (String)((Object[])
    vector_campos.elementAt(indice_vector_campos))[3];
    public Class getColumnClass(int columna)
    // {return getValueAt(0,columna).getClass();}
    String indice_str =(String)
    ((Object[])vector_columnas.elementAt(columna))[1];
    int indice_vector_campos = Integer.parseInt(indice_str);
    return (Class)obtieneTipoColumna(
    (String)((Object[])
    vector_campos.elementAt(indice_vector_campos))[29]);
    public boolean isCellEditable(int fila, int columna)
    if (puede_editar)
    String indice_str =(String)
    ((Object[])vector_columnas.elementAt(columna))[1];
    int indice_vector_campos = Integer.parseInt(indice_str);
    if (((String)
    ((Object[])
    vector_campos.elementAt(
    indice_vector_campos))[18]).equals("true"))
    return true;
    else
    return false;
    }else return false;
    /* public void setValueAt(Object aValue, int fila, int columna)
    if (puede_editar)
    ((java.util.Vector)
    (vector_datos.elementAt(fila))).elementAt(columna) = aValue;
    fireTableCellUpdated(fila, columna);
    // public static void main(String[] args) {
    // new TableExample3();
    //final de clase
    public void asignaDatosTabla(java.util.Vector vector_campos_usar,
    java.util.Vector vector_campos_usar_i,
    java.util.Vector vector_datos,
    java.util.Vector vector_datos_campos)
    this.vector_campos_usar = vector_campos_usar;
    this.vector_campos_usar_i = vector_campos_usar_i;
    this.vector_datos = vector_datos;
    this.vector_datos_campos = vector_datos_campos;
    // asignaDatosCamposIniciales();
    // mimodelotabla.fireTableDataChanged();
    // configuraColumna(vista_tabla);
    // javax.swing.table.TableModel modelo = vista_tabla.getModel();
    mimodelotabla.fireTableDataChanged();
    // vista_tabla.repaint();
    vista_tabla.requestFocus();
    javax.swing.ListSelectionModel listseleccion = vista_tabla.getSelectionModel();
    listseleccion.setLeadSelectionIndex(0);
    vista_tabla.setSelectionModel(listseleccion);
    //javax.swing.ListSelectionModel lsm =
    // (javax.swing.ListSelectionModel)e.getSource();
    // asignaEscuchadores();
    public void iniciaVectorDatos()
    java.util.Vector vectornulo;
    manejoparametros.datos_leidos_tablas.clear();
    if (!vector_columnas.isEmpty())
    for(int i=0;i<30;i++)
    vectornulo = new java.util.Vector();
    for (int j = 0;j<vector_columnas.size();j++)
    vectornulo.addElement(null);
    vector_datos.addElement(vectornulo);
    private void asignaEscuchadores()
    vista_tabla.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
    if (puede_seleccionar) { // true by default
    modelo_fila_sel = vista_tabla.getSelectionModel();
    modelo_fila_sel.addListSelectionListener(
    new javax.swing.event.ListSelectionListener() {    
    public void valueChanged(
    javax.swing.event.ListSelectionEvent e)
    javax.swing.ListSelectionModel lsm =
    (javax.swing.ListSelectionModel)e.getSource();
    int fila_sel = lsm.getMinSelectionIndex();
    // DEBO BUSCAR UNA FORMA DE DETERMINAR SI EL VECTOR DE CAMPOS TIENE DATOS
    if (!vector_datos_campos.isEmpty())// !=null)
    manejopantalla.asignaDatosPantalla(
    (java.util.TreeMap)
    vector_datos_campos.elementAt(fila_sel),
    campos,
    vector_campos);
    /*Aqui funcionan para cambiar los campos de arriba de la forma
    que esta abajo
    ((javax.swing.JTextField)campos[0]).setText(
    (String)vista_tabla.getValueAt(fila_sel,0));
    ((javax.swing.JTextField)campos[1]).setText((String)vista_tabla.getValueAt(fila_sel,1));
    //v if (lsm.isSelectionEmpty()) {
    //v System.out.println("No rows are selected.");
    //v } else {
    //v int selectedRow = lsm.getMinSelectionIndex();
    //v System.out.println("Row " + selectedRow
    //v + " is now selected.");
    //v }
    } else {
    vista_tabla.setRowSelectionAllowed(false);
    vista_tabla.addMouseListener(new java.awt.event.MouseAdapter() {
    public void mouseClicked(java.awt.event.MouseEvent e) {
    fila_sel = vista_tabla.getSelectedRow();
    if (e.getClickCount() ==2)
    asignaDatosSeleccionados(fila_sel);
    salirPrograma();
    // System.out.println("FILA SEL --> " + fila_sel);
    /*Aqui va chequeo de seleccion
    ((javax.swing.JTextField)campos[0]).setText((String)vista_tabla.getValueAt(fila_sel,0));
    ((javax.swing.JTextField)campos[1]).setText((String)vista_tabla.getValueAt(fila_sel,1));
    vista_tabla.addKeyListener(new java.awt.event.KeyAdapter()
    public void keyPressed(java.awt.event.KeyEvent e)
    // char c = e.getKeyChar();
    int keycode = e.getKeyCode();
    if (keycode == 10)
    fila_sel = vista_tabla.getSelectedRow();
    asignaDatosSeleccionados(fila_sel);
    salirPrograma();
    // System.out.println("FILA SEL --> " + fila_sel);
    public void configuraColumna(javax.swing.JTable tabla)
    int tamano;
    for (int i=0;i<vector_columnas.size();i++)
    String indice_str =(String)
    ((Object[])vector_columnas.elementAt(i))[1];
    int indice_vector_campos = Integer.parseInt(indice_str);
    /*Aqui se asigna en render de cada celda esto permite
    fijar el font de las celdas, el borde, fijar, estado
    colores,etc. Debo crear uno propio para tener mas control*/
    javax.swing.table.DefaultTableCellRenderer
    renderer = new javax.swing.table.DefaultTableCellRenderer();
    /*Debo agregar un campo en el archivo de configuracion para
    saber como voy alinear el campo (derecha,izquierda,centro)*/
    renderer.setHorizontalAlignment(renderer.LEFT);
    //javax.swing.JLabel.LEFTNTER_ALIGNMENT);
    // renderer.setText((String)((Object[])
    // vector_campos.elementAt(
    // indice_vector_campos))[3]);
    if (!UtilitariosGenerales.isCampoBlanco(((String)((Object[])
    vector_campos.elementAt(
    indice_vector_campos))[26])))
    tamano = Integer.parseInt(((String)((Object[])
    vector_campos.elementAt(
    indice_vector_campos))[26]));
    }else
    tamano = 10;
    /*Debo crear mi propio tipo de editor de celdas, para formatear
    los datos debo llamarlo aqui, ahi tomo en cuenta el tipo de
    datos que voy a usar (JCombo, JcheckBox, JTextField)*/
    javax.swing.table.TableCellEditor editor;
    if (
    /* ((String)((Object[])
    vector_campos.elementAt(indice_vector_campos))[2]).equals("JCheckBox")
    ((String)((Object[])
    vector_campos.elementAt(indice_vector_campos))[29]).equals("Boolean")
    javax.swing.JCheckBox checkbox = new javax.swing.JCheckBox();
    editor = new javax.swing.DefaultCellEditor(checkbox);
    else
    javax.swing.JTextField jtextfield = new javax.swing.JTextField();
    editor = new javax.swing.DefaultCellEditor(jtextfield);
    javax.swing.table.TableColumn columna = new
    javax.swing.table.TableColumn(
    i,tamano,renderer,editor);
    tabla.addColumn(columna);
    public void obtieneColumnasTabla()
    vector_columnas = new java.util.Vector();
    int indice_vector;
    String[] informacion_columna;
    for (int i=0;i<vector_campos.size();i++)
    if (!
    ((String)((Object[])vector_campos.elementAt(i))[2]).equals(
    "JTable"))
    continue;
    informacion_columna = new String[2];
    informacion_columna[0] = (String)((Object[])vector_campos.elementAt(i))[3];
    informacion_columna[1] = String.valueOf(i);
    vector_columnas.addElement(informacion_columna);
    public Object obtieneTipoColumna(String tipo_columna)
    String[] arreglo_tipo = {"String","Long","Integer","Double","Boolean"};
    int i = java.util.Arrays.binarySearch(arreglo_tipo,tipo_columna);
    switch (i)
    case 0:
    return String.class;
    case 1:
    return Long.class;
    case 2:
    return Integer.class;
    case 3:
    return Double.class;
    case 4:
    return Boolean.class;
    default:
    return String.class;
    class FormattedCellRenderer extends javax.swing.table.DefaultTableCellRenderer
         protected java.text.Format m_format;
         public FormattedCellRenderer(java.text.Format format) {
              m_format = format;
         public java.awt.Component getTableCellRendererComponent(
    javax.swing.JTable table,
              Object value, boolean isSelected, boolean hasFocus,
              int nRow, int nCol)
              return super.getTableCellRendererComponent(table,
                   value==null ? null : m_format.format(value),
                   isSelected, hasFocus, nRow, nCol);
    class FormattedCellEditor extends javax.swing.DefaultCellEditor
         public FormattedCellEditor(final javax.swing.JFormattedTextField
                   formattedTextField) {
              super(formattedTextField);
    System.out.println(delegate);
              formattedTextField.removeActionListener(delegate);
              delegate = new EditorDelegate() {
                   public void setValue(Object value) {
                        formattedTextField.setValue(value);
                   public Object getCellEditorValue() {
                        return formattedTextField.getValue();
              formattedTextField.addActionListener(delegate);
              formattedTextField.setBorder(null);
    public void asignaDatosSeleccionados(int fila)
    if (fila >=0 && fila < vector_datos.size())
    manejoparametros.isSeleccionada = true;
    java.util.TreeMap map_datos_sel = new java.util.TreeMap();
    int indice_vector;
    int total_tabla=-1;
    int total_campos = -1;
    for (int i=0;i<vector_campos_usar.size();i++)
    // String[] arreglo_campo_usar = new String[2];
    // arreglo_campo_usar = (String[])vector_campos_usar.elementAt(i);
    // indice_vector = Integer.parseInt(arreglo_campo_usar[0]);
    /*AQUI DEBO CLASIFICAR SI ES FIJO O ES DE LA TABLA*/
    if (!
    ((String)((Object[])vector_campos_usar_i.elementAt(i))[2]).equals(
    "JTable"))
    if (!UtilitariosGenerales.isCampoBlanco(
    ((String)((Object[])vector_campos_usar_i.elementAt(i))[28]) ) &&
    !((String)((Object[])vector_campos_usar_i.elementAt(i))[40]).equals(
    "true"))
    if (!map_datos_sel.containsKey(
    ((Object[])vector_campos_usar_i.elementAt(i))[28]))
    total_campos++;
    Object valores = ((java.util.TreeMap)
    vector_datos_campos.elementAt(fila)).get(
    ((Object[])vector_campos_usar_i.elementAt(
    i))[28]);
    map_datos_sel.put( ((Object[])vector_campos_usar_i.elementAt(i))[28],
    valores);
    // ((java.util.Vector)
    // vector_datos_campos.elementAt(fila)).elementAt(total_campos) );
    // continue;
    for (int i =0;i<vector_campos.size();i++)
    if (
    ((String)((Object[])vector_campos.elementAt(i))[2]).equals(
    "JTable"))
    total_tabla++;
    if (!UtilitariosGenerales.isCampoBlanco(
    ((String)((Object[])vector_campos.elementAt(i))[28]) ))
    if (!map_datos_sel.containsKey(
    ((Object[])vector_campos.elementAt(i))[28]))
    map_datos_sel.put( ((Object[])vector_campos.elementAt(i))[28],
    ((java.util.Vector)
    vector_datos.elementAt(fila)).elementAt(i) );
    manejoparametros.fila_seleccionada = fila;
    manejoparametros.map_datos_seleccionados = map_datos_sel;
    public void obtieneDatosSeleccionados_ant(int fila)
    if (fila >=0 && fila < vector_datos.size())
    manejoparametros.isSeleccionada = true;
    java.util.TreeMap map_datos_sel = new java.util.TreeMap();
    int indice_vector;
    int total_tabla=-1;
    for (int i=0;i<vector_campos_usar.size();i++)
    // String[] arreglo_campo_usar = new String[2];
    // arreglo_campo_usar = (String[])vector_campos_usar.elementAt(i);
    // indice_vector = Integer.parseInt(arreglo_campo_usar[0]);
    /*AQUI DEBO CLASIFICAR SI ES FIJO O ES DE LA TABLA*/
    if (!
    ((String)((Object[])vector_campos_usar_i.elementAt(i))[2]).equals(
    "JTable"))
    continue;
    else
    total_tabla++;
    if (!UtilitariosGenerales.isCampoBlanco(
    ((String)((Object[])vector_campos_usar_i.elementAt(i))[28]) ))
    if (!map_datos_sel.containsKey(
    ((Object[])vector_campos_usar_i.elementAt(i))[28]))
    map_datos_sel.put( ((Object[])vector_campos_usar_i.elementAt(i))[28],
    ((java.util.Vector)
    vector_datos.elementAt(fila)).elementAt(total_tabla) );
    int total_campos = -1;
    for (int i=0;i<vector_campos.size();i++)
    if (!UtilitariosGenerales.isCampoBlanco(
    ((String)((Object[])vector_campos.elementAt(i))[28]) ) &&
    !((String)((Object[])vector_campos.elementAt(i))[2]).equals(
    "JEncadena"))
    if (!map_datos_sel.containsKey(
    ((Object[])vector_campos.elementAt(i))[28]))
    total_campos++;
    String valores = (String)((java.util.TreeMap)
    vector_datos_campos.elementAt(fila)).get(
    ((Object[])vector_campos.elementAt(
    i))[28]);
    map_datos_sel.put( ((Object[])vector_campos.elementAt(i))[28],
    valores);
    // ((java.util.Vector)
    // vector_datos_campos.elementAt(fila)).elementAt(total_campos) );
    manejoparametros.fila_seleccionada = fila;
    manejoparametros.map_datos_seleccionados = map_datos_sel;
    public void salirPrograma()
    try
    if (frame_usar instanceof javax.swing.JDialog)
    ((javax.swing.JDialog)frame_usar).setName("botones");
    ((javax.swing.JDialog)frame_usar).dispose();
    }else
    ((javax.swing.JFrame)frame_usar).setName("botones");
    ((javax.swing.JFrame)frame_usar).dispose();
    }catch (Exception ex)
    System.out.println(ex.toString());
    }

  • Problems Faced with Partitions in Oracle 9i.

    I have a doubt regarding the partitions in Oracle 9i can you please help me regarding this?
    Create table t1
    ( x number,
    y number,
    z number);
    insert into t1 values (1,1,1);
    insert into t1 values (2,2,2);
    insert into t1 values (3,3,3);
    Create table t2
    x number,
    y number,
    z number
    partition by range(x)
    partition p1 values less than(2),
    partition p2 values less than(3),
    partition p3 values less than(4),
    partition p4 values less than(maxvalue)
    alter table t2 exchange partition p1 with table t1;
    SQL> alter table t2 exchange partition p1 with table t1;
    alter table t2 exchange partition p1 with table t1
    ERROR at line 1:
    ORA-14099: all rows in table do not qualify for specified partition
    WHAT DOES THIS ERROR MESSAGE MEAN? I AM NOT ABLE TO UNDERSTAND THIS? WHAT NEED's TO BE DONE TO RESOLVE THIS?
    alter table t2 exchange partition p1 with table t1 WITHOUT VALIDATION;
    SQL> SELECT * FROM T2;
    X Y Z
    1 1 1
    2 2 2
    3 3 3
    SQL> SELECT * FROM T2 PARTITION(P1);
    X Y Z
    1 1 1
    2 2 2
    3 3 3
    SQL> SELECT * FROM T2 PARTITION(P2);
    no rows selected
    SQL> SELECT * FROM T2 PARTITION(P3);
    no rows selected
    (i) Why i am facing this error ORA-14099: while partitioning? Can you please brief me about this ?
    (ii) why there is not data's in the PARTITIONS p2 &p3 after the partitions is exchanged WITHOUT VALIDATION options?
    what is going with this method?
    (iii) Also can you please explain me with an example how to partitions a table having milliion of records with EXCHANGE PARTITION Options with MULITPLE partition segment's (say partition based on status id column with 6 differnt values i am thinking to use list partitions using status_id as partition key) ?
    Also i have tried the below approch is this a right approch? please correct me if i am wrong.
    Create table t1
    ( x number,
    y number,
    z number);
    insert into t1 values (1,1,1);
    insert into t1 values (2,2,2);
    insert into t1 values (3,3,3);
    commit;
    Create table t2
    x number,
    y number,
    z number
    partition by range(x)
    partition p1 values less than(2),
    partition p2 values less than(3),
    partition p3 values less than(4),
    partition p4 values less than(maxvalue)
    SQL> insert into t2 select * from t1;
    3 rows created.
    SQL> commit;
    Commit complete.
    SQL> SELECT * FROM T2 PARTITION(P1);
    X Y Z
    1 1 1
    SQL> SELECT * FROM T2 PARTITION(P2);
    X Y Z
    2 2 2
    SQL> SELECT * FROM T2 PARTITION(P3);
    X Y Z
    3 3 3
    SQL> SELECT * FROM T2 PARTITION(P4);
    no rows selected
    EXPLAIN PLAN
    FOR SELECT * FROM T2 WHERE X = 1
    | Id | Operation | Name | Rows | Bytes | Cost | Pstart| Pstop |
    | 0 | SELECT STATEMENT | | 1 | 9 | 2 | | |
    | 1 | TABLE ACCESS FULL | T2 | 1 | 9 | 2 | 1 | 1 |
    Now my question is what is problem instead of using EXCHANGE PARTITION why caun't we follow this above approch?
    to partition a non-partitioned table?
    Thanks,
    Rajesh.

    The value of 3 should obviously should go into the partition P3.Then why are you putting it into p1?
    Your command,
    <tt>    alter table t2 exchange partition <b>p1</b> with table t1;</tt>
    will swap partition p1 with the contents of table t1, leaving you with partition p1 containing the three values that were in t1. At first it told you there were rows in t1 that did not belong in that partition, but you used FORCE so it put them in anyway.
    btw there are notes in the FAQ about how to use ** tags to format your posts.
    ~Edited by: William Robertson on Oct 15, 2008 6:49 AM~                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Problem facing with file upload in webdynpro

    hi
    this is sathya, i very thank ful  to your answers, coming to my problem
    i have written the code for file upload action method, in this below code there is no syntax problem.
    but there is a run time error , i.e convt_no_number
    kindly rectify that.
      data:  lt_final type table of zalvtab,
             ls_final type zalvtab,
             "t_table1 TYPE STANDARD TABLE OF str_itab,
             "fs_table TYPE str_itab,
             i_data TYPE STANDARD TABLE OF string,
             lo_nd_zalvtab TYPE REF TO if_wd_context_node,
             lo_el_zalvtab TYPE REF TO if_wd_context_element,
             l_string TYPE string,
             l_xstring TYPE xstring,
             fields TYPE string_table,
             lv_field TYPE string.
      DATA : t_table TYPE if_main=>elements_sel_node,
             data_table TYPE if_main=>elements_sel_node.
    " get single attribute
        wd_context->get_attribute(
           EXPORTING
           name =  `upload`
           IMPORTING
             value = l_xstring ).
      CALL FUNCTION 'HR_KR_XSTRING_TO_STRING'
        EXPORTING
          in_xstring = l_xstring
        IMPORTING
          out_string = l_string.
        SPLIT l_string  AT cl_abap_char_utilities=>newline INTO TABLE i_data.
    " Bind With table Element.
       LOOP AT i_data INTO l_string.
        SPLIT l_string AT cl_abap_char_utilities=>horizontal_tab INTO TABLE fields.
        READ TABLE fields INTO lv_field INDEX 1.
        ls_final-ebeln = lv_field.
         READ TABLE fields INTO lv_field INDEX 2.
        ls_final-ekorg = lv_field.
         READ TABLE fields INTO lv_field INDEX 3.
         ls_final-bukrs = lv_field.
         READ TABLE fields INTO lv_field INDEX 4.
         ls_final-ebelp = lv_field.
          READ TABLE fields INTO lv_field INDEX 5.
         ls_final-menge = lv_field.
         READ TABLE fields INTO lv_field INDEX 6.
         ls_final-netpr = lv_field.
         READ TABLE fields INTO lv_field INDEX 7.
         ls_final-aedat = lv_field.
         READ TABLE fields INTO lv_field INDEX 8.
         ls_final-waers = lv_field.
         READ TABLE fields INTO lv_field INDEX 9.
         ls_final-description = lv_field.
          APPEND ls_final  TO lt_final.
      ENDLOOP.
      lo_nd_zalvtab = wd_context->get_child_node( 'sel_node' ).
    lo_nd_zalvtab->bind_table( lt_final ).

    Hi Sathya,
             I guess you are trying to upload data from excel file(XLS format).
             If it is correct then you cannot do this in webdynpro, first you save the excel file as tab delimited.
             Open your excel file->save as->other formats->give file type as TEXT(Tab delemited).
             Now use this file to upload. It should work perfectly.

  • Problem facing with Transient in View Object

    Hi Friends,
    I had created a new table in the database and create an Entity Object for that table,
    i had add this entity object in one of the View Object and when i was trying to add attributes from Available List to the Selected List.
    The Attributes are changing to Transient and that particular attribute Mapped to column got unchecked, even tho i check it manually it is turning unchecked automatically when i click on Apply Button.
    * In Entity Object Attributes are checked with >Persistent and Queryable and Type is NUMBER Updatable checked to Always.
    Can you please suggest me where am i going wrong, i had done me best to solve this problem.
    Please help me out from this problem.
    Thanks in advance,
    Rahul

    Rahul,
    Your question is related to ADF Business Components, not to JHeadstart.
    Please use the JDeveloper forum for this question.
    Thank you,
    Steven Davelaar,
    JHeadstart team.

  • Problem faced with setContentType

    Initially i am sorry for posting this here as this is not a Swings topic.
    I am facing a prob. of the foll. type :
    I have a string with me which has some content for eg strA =
    To:
    123/456
    239.
    Items Qty.
    2 8
    Thanks,
    ABC.
    Lets suppose the content is as above.I am using setContentType(strA,"text/plain").I can use text/html but there is a certain requirement due to which i have used plain text & the final format is as I have printed above.
    I am mailing this text.
    My prob. is that i receive the same format thru Microsoft Outlook ,hotmail & yahoo accounts.
    But am facing a prob. with the format when i receive it thru Outlook Express.
    The text gets typed without any alignment.,spaces ....
    What could be the reason & is there any way to solve this.Is my MIME type wrong?

    \n...is the only tag i have used...i have avoided even \t........
    basically the string spaces r maintained by means of spaces.....
    as no tags were wanted to be kept...as i said this is plain text......
    but even the spaces r not taken properly...........the text get's printed the way it wants to .......in outlook express...i believe that text/plain cud be replaced by something else but that is what i don't know....

  • Problem facing with iphone camera

    Hi Guys
    I am using iphone 4 from last 3 years, from last 6 months i am not able to use camera of my phone. When I try to open cam shutter it keep shut. I am not able to option shutter. Can you guys help me to sort out this problem..
    Regards
    Parveen

    Basic troubleshooting from the User's Guide is reset, restart, restore (first from backup then as new).  Try each of these in order until the issue is resolved.

  • Problems faced with VL10D transaction in sap

    Hi,
       I am using BADI to generate error message for VL10D transaction.The error message is generated properly.But it is exiting the transaction.The user wants that it should come back to the initial screen of the VL10D transaction.
       I have tried to do this with warning messages displayed as error message.But it is not working properly.The delivery is getting
    created with errors.
        Please help me out. <removed by moderator>
    Thanks and regards,
    Raka.
    Edited by: Thomas Zloch on Sep 28, 2011 1:06 PM

    Hi
    Combine your BADI as a warning message and with older userexits (see Note 198137 - VL10: Customer-specific enhancements / user exits). Use the include LV50R_VIEWG06 and set cf_subrc = 1 for the deliveries that you must not create because they hava an error.
    I hope this helps you
    Regards
    Eduardo

  • Problem facing with BC-Set activation while doing servicedesk configuration

    Hi All,
    I have installed Solution Manager 4.0,And i applied all the latest service pack (both abap and java service packs).I try to activate some BC-sets(ex: Service_desk_change_request_32A,Service_desk_change_request_32F2).When try to activiation it is giving  Runtime errors like DATA_LENGTH_0
    and Exception CX_SY_RANGE_OUT_OF_BOUNDS
    Can some one help how to activiate the BC-Sets in the process of configuring the Service desk userin the SolutionManager system.
    regards
    srujan

    Hi JP,
    The BC sets in note 898614 are in IMG activity "Activate Service Desk BC Set". I put this together for myself just to track what the heck is going on while I configured this.
    Cofiguration of Basic Settings:
    SAP Solution Manager Implementation Guide
    ..SAP Solution Manager
    ....Configuration
    ......Basic Settings
    ........Standard Configuration of Basic Settings
    ..........Solution Manager
    ............Activate Maintenance Optimizer BC Set
    ................SOLMAN40_MOPZ_TTYP_SLMO_000
    ................SOLMAN40_CHARM_PROXYFACT_001
    ............Activate Service Desk BC Set
    ..............This task refers to the BC sets in note 898614:
    ................SOLMAN40_SDESK_BASICFUNC_000
    ................ZSOLMAN40_SDESK_ACT_ADVCLOSE_001
    ................ZSOLMAN40_SDESK_ACTIONLOG_001
    ................ZSOLMAN40_SDESK_TPI_ACT_AST_001
    ..............Then note 898614 says apply BC sets in note 931196:
    ................ZSOLMAN40_SDESK_TEXTTYPES_001 << This errors out
    ................SOLMAN_CORPF_TEXTTYPES_001 << Should I?
    For me activating BC Set ZSOLMAN40_SDESK_TEXTTYPES_001 gets the error:
    COMV_TEXT_CUST No data found for writing activation links for object COMV_TEXT_CUST.
    Also, I think I may have blown it by not doing the piece lists. I have heard differently whether to do it or not and in which client and how to get it form dev to prod.
    Also, I could be wrong but I thought SERVICE_DESK_CHANGE_REQUEST_32A was from SolMan 3.2.
    Please post if you get it all figured out.
    Good luck,
    David

  • Selection Problem with JTable

    Hello,
    i have a selection problem with JTable. I want to allow only single cell selection and additionally limit the selection to the first column.
    I preffered the style from MS Outlook Express where you can select the email accounts to edit.
    It is a table like this:
    Account name  |   Type  |   ...
    --------------|---------|---------------------
    Hotmail       |   POP3  |
    GMX           |   IMAP  |The selection should be only avaibable at 'Hotmail' or 'GMX' - not at 'POP3', 'IMAP' or as complete row selection.
    Please help me!
    Thanks.
    Warlock

    Maybe this will helpimport java.awt.*;
    import javax.swing.*;
    public class Test3 extends JFrame {
      public Test3() {
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        Container content = getContentPane();
        String[] head = {"One", "Two"};
        String[][] data = {{"R1-C1", "R1-C2"}, {"R2-C1", "R2-C2"}};
        JTable jt = new JTable(data, head);
        jt.getColumnModel().setSelectionModel(new MyTableSelectionModel());
        content.add(new JScrollPane(jt), BorderLayout.CENTER);
        jt.setCellSelectionEnabled(true);
        jt.setRowSelectionAllowed(false);
        jt.setColumnSelectionAllowed(false);
        setSize(300, 300);
        setVisible(true);
      public static void main(String[] arghs) { new Test3(); }
    class MyTableSelectionModel extends DefaultListSelectionModel {
      public void setSelectionInterval(int index0, int index1) {
        super.setSelectionInterval(0, 0);
    }

  • HT201210 In the attempt of updating the latest itune software, i am faced with the problem of not being able to be connected to itunes with my ipod touch that is blocked living the USB cable and the itune icons on my touch sceen. Can some one help me out

    In the attempt of updating my ipod touch, i am  faced with the problem of not being able to be connected to the itunes in my computer (windows xp ) because my ipod touch got blocked up, leaving the icon of USB cable and itunes on my touch screen. I am asked to restore my ipod first, but i have tried using all the examples stated and still can't help. Please please, can some one help me out ? Ones  in the process of trying, i see an error code: 1656 and most of the time nothing. Thanks

    See if placing the iPod in Recovery mode will allow a restore via iTunes
    Next try DFU mode
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings
    You can also try another computer to help determine if you have a computer or iPod problem.

  • I am facing with the problem "plugin-container.exe has encountered a problem and needs to close. Please suggest how to fix the problem.

    I am using desktop computer with windows XP. Sometimes, I am facing with the problem "plugin-container.exe has encountered a problem and needs to close". After showing this event, the browser disappears automatically.

    See if there are any Crash Reports ID's saved.
    Type '''about:crashes''' in the Location Bar and hit Enter.
    Then open each Crash Report and once the report is loaded completely, copy and paste the URL of each report into the the '''''Post as Reply''''' box in this thread.
    IMO, seeing that you are using WinXP, you might be better off with the older Flash 10.3.183.90 version. Flash 11.0 and later have "improvements" that don't work on WinXP - only Vista and later. Adobe did continue to support and provide security updates for Flash 10.3 until a few months before WinXP went EOL back in April of this year.

  • My iphone 5 is problem facing like that. when i switch off my iphone5 then plugh for charge with data cable or charger adapder or only data cable with no power connect phone is starting why? means on my phone Why? any one can explane this matter please. s

    my iphone 5 is problem facing like that. when i switch off my iphone5 then plugh for charge with data cable or charger adapder or only data cable with no power connect phone is starting why? means on my phone Why? any one can explane this matter please. switched off my phone but on without power button . what is the problem?
    Thanks
    s.m slim

    all iphone is same like that

  • Hi , unfortunately i faced with a problem that i couldent open my audio note so i thought if i delet it and transfer the application from itunse from my pc i can have my files...but all of them deleted from both application and also from wifi address... I

    Hi , unfortunately i faced with a problem that i couldent open my audio note so i thought if i delet it and transfer the application from itunse from my pc i can have my files...but all of them deleted from both application and also from wifi address... Is it any solution for recovery the filew? I missed lots of important files , plz help me
    Tnx alot

    Hey Eric,
    Thanks for taking the time. Unfortunately no that does not solve it. Same as swipe it will get me there and it will show separate programs spaced out. The issue I am having is that all my open word files are bunched up in a pile on top of each other. I can see the edges of each one but I want them to be separated from each other enough that I can visually identify what file is what.
    Again, thanks for trying, it is appreciated.

Maybe you are looking for

  • How can I initiate dual boot install from a CMD window...?

    Laptop hardware meets sys req for Win 10 and currently runs 8.1 Samsung RV-511-S01UK i3 380M @ 2.53Ghz 6GB RAM Discrete Nvidia 315M 1GB dedicated VRAM Having first tried 10 inside a VM... and it looks ok.... time to try it on real hardware instead of

  • Installed iTunes 10.2.1 for Windows (64-bit), Error 7 Windows 998

    Hello After updating iTunes 10.2.1 for Windows (64-bit)I am getting the dreaded iTunes was not installed correctly, Please reinstall iTunes. With error 7 (Windows error 998) popups. Tried already all the known uninstall/install/repair suggestions. Tr

  • Creating template file using ireport while generating PDF(jasperreports)

    Hi, I need to create a PDF report with multiple pages.the layout is as follows. each page has text on the left and bar graph/pie chart on the right along with some more text below and a table below at the end of the page. and so on for all the other

  • How to display data from Database individually??? Anyone can help ?

    HI, i i had select a row of data from database using , /* Query * From Table RESOURCEORDER where po = selected no and project = selected project */      public ResultSet getAllData() throws SQLException      getConnection();      Statement stmt = con

  • CS3 hand tool geeking out

    I've just switched to CS3 and have noticed that at times when I try to use my hand tool it tends to geek out. To be specific it seems to look as if the image is breaking up as I attempt to drag with the hand tool. It's impossible to see what I'm look