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());
}

Similar Messages

  • 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..

  • 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);
    }

  • 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...

  • I have an iPhone 4 and am in Nepal. My phone was previously able to connect to wifi, but now is unable. I have an iPad and that is able to connect just fine. This problem is with every wifi hotspot I have tried so it is the phone not the modem.

    I have an iPhone 4 and am in Nepal. My phone was previously able to connect to wifi, but now is unable. I have an iPad and that is able to connect just fine. This problem is with every wifi hotspot I have tried so it is the phone not the modem.

    Try Settings > General > Reset > Reset Network Settings.

  • Another problem with JTable

    Hi,
    I have encountered a problem with JTable, i am trying to display some 15 columns and their values , one of the columns value is null, then the JTable is not displaying its value from this column(which is with null value) onwards.
    Can anybody assiss me in this matter.
    Regards
    khiz_eng

    I don't know If I can fix your problem, but
    I know just that it works on my PC.... It's very very
    slow... I don't know how to insert PageSetUp option... I have to study the problem.....
    However I don't think it's a hard problem....
    I want ask to you if you have found some problems when you are in Editing mode in a cell.....
    in the jdk1.2 version I could save while was in editing mode using the editingStopped method.
    It permit to update all data .... also the data in the cell I was editing.
    in the jdk 1.3 if I use this method It doesn't work properly... It maybe destroy the content object in the Cell..... because I'm able to print all the table except the editing cell (it throw an exception...)
    What's changed????
    I don't know...
    Can u help me?

  • A problem with JTable

    Hi !
    I have a problem with JTable - would like to use this component as a simple list of rows taken from a database : don't want to be able select or set a focus to a column - want only to be able select and set focus to a row ( just like in the menus). How to disable "focusability" for a cell with JTable ? Could You help me ?
    thnx in advance

    The Border is changed by the renderer, depending on whether the cell has focus or not. So you will need to create custom renderers without a Border. Something like:
    class NoBorderRenderer extends DefaultTableCellRenderer
         public Component getTableCellRendererComponent(
              JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column)
              super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
              setBorder(null);
              return this;
    }

  • Mouselistner is not working with jtable in the browser

    Hi
    I am having a problem with jTable.
    I added a mouselistener to table header to sort table but when i run that applet from my netbean ide it works fine but when i run that applet in my browser it doesn't work, i have tested, its not even generate mouseclick event .Please help me guys.
    I call this function after calling initComponents() method of JApplet.
    public void setTableAction()
    //set mouselistener to sort table on click of table header
    final JTableHeader head= jTable1.getTableHeader();
    head.addMouseListener(new java.awt.event.MouseAdapter()
    public void mouseClicked(java.awt.event.MouseEvent evt)
    Vector data= ((DefaultTableModel)jTable1.getModel ()).getDataVector();
    sortTable(data, head.columnAtPoint(evt.getPoint()));
    //set action map to change the default action performed for enter key pressed
    InputMap imap = jTable1.getInputMap(JTable.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
    KeyStroke enterKey = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0);
    KeyStroke tabKey = KeyStroke.getKeyStroke(KeyEvent.VK_TAB, 0);
    final Action oldAction= jTable1.getActionMap().get(imap.get(tabKey)); // get map to set enter key.
    imap.put(enterKey, "enter"); // set enter key
    Action newAction = new AbstractAction(){
    public void actionPerformed(ActionEvent e) {
    oldAction.actionPerformed(e);
    JTable table= (JTable)e.getSource();
    table.changeSelection(0,0,false,false);
    if(table.isCellEditable(0,0))
    String sTemp= (String)table.getValueAt(0,0);
    if(sTemp.length()>0) {
    if(bRenewItem)
    retrieveRcodeDetails("",sTemp);
    else
    processRCodeDetails(sTemp, e);
    }else
    table.editCellAt(0,0);
    jTable1.getActionMap().put("enter", newAction);
    jTable1.setPreferredScrollableViewportSize(jTable1.getPreferredSize());
    }

    Hi,
    I also am using the Bépo layout with an encrypted drive and encountered the same problem: the Return key does not work.
    It seems to work fine if you use the fr-bepo-latin9 keymap.
    # /etc/vconsole.conf
    KEYMAP=fr-bepo-latin9
    But I also looked at the files /usr/share/kbd/keymaps/i386/bepo/fr-bepo.map.gz and /usr/share/kbd/keymaps/i386/bepo/fr-bepo-latin9.map.gz (you can open gzipped files in vim directly). fr-bepo-latin9.map.gz defines keycode 28 (Return) but fr-bepo.map.gz does not.
    I modified fr-bepo.map.gz:
    # vim /usr/share/kbd/keymaps/i386/bepo/fr-bepo.map.gz # Append that line : "keycode 28 = Return".
    # mkinitcpio -p linux # Rebuild the initramfs.
    The Return key now works, but the Backspace (14, "Delete") and Shift (54) keys don’t work. I found that both the cf.map.gz (french canadian layout) and fr-bepo-latin9.map.gz files define those keycodes as well as other non-printing keys so I copied the following lines from fr-bepo-latin9.map.gz to fr-bepo.map.gz:
    keycode 1 = Escape Escape
    keycode 14 = Delete Delete
    keycode 15 = Tab Tab
    keycode 28 = Return
    keycode 29 = Control
    keycode 42 = Shift
    keycode 54 = Shift
    keycode 56 = Alt
    keycode 58 = Caps_Lock
    keycode 97 = Control
    It works! Don’t forget to rebuild the initramfs after you change the keymap file.
    # mkinitcpio -p linux
    I will send a message to the kbd and bépo projects mailing lists and report back.

  • Problem in Customising JTable's Functionality

    Problem Scenario :
    We are facing a problem related to JTables. In our GUI, we have used JTables and the data model that we are using for the table is a bit complicated. Complicated in the sense that we want different values(multiple) in each cell of a particular column in the table and we want to use JComboBox at that particular cell. For achieving this we have set the values in the JComboBox in its renderer class. But to set the user selected value in the particular cell JComboBox we initialized a new JComboBox in the renderer class. With this the GUI is working fine but it has raised a problem that if we renderer the component another JComboBox appears in the same cell. The problem is obvious as we are initializing a new JComboBox in the renderer class, but to solve our purpose we don�t have another way.
    With the kind of data model we are using is it possible to create a JTable with combo boxes in a particular cell having different option values in each cell?
    Could someone suggest a solution for this problem?
    Regards
    Prajkta Bonde
    [email protected]

    I have done it around 4 years back. Add filled JComboBox as table data.
    Attached sample code should help
    // Imports
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.table.*;
    class SimpleTableExample
              extends      JFrame
         // Instance attributes used in this example
         private     JPanel          topPanel;
         private     JTable          table;
         private     JScrollPane scrollPane;
         // Constructor of main frame
         public SimpleTableExample()
              // Set the frame characteristics
              setTitle( "Simple Table Application" );
              setSize( 300, 200 );
              setBackground( Color.gray );
              // Create a panel to hold all other components
              topPanel = new JPanel();
              topPanel.setLayout( new BorderLayout() );
              getContentPane().add( topPanel );
              // Create columns names
              String columnNames[] = { "Column 1", "Column 2", "Column 3" };
              Object dataValues[][] = new Object[10][3];
              for(int row=0;row<dataValues.length;row++) {
                   for(int col=0;col<dataValues[row].length;col++){
                        JComboBox tempBox = new JComboBox();
                        for(int data=0;data<10;data++){
                             tempBox.addItem("Row "+row+" Column "+col+" Data "+data);
                        dataValues[row][col]=tempBox;
              // Create a new table instance
              table = new JTable( dataValues, columnNames );
            comboBoxColumn(table.getColumnModel().getColumn(0));
            comboBoxColumn(table.getColumnModel().getColumn(1));
            comboBoxColumn(table.getColumnModel().getColumn(2));
              // Add the table to a scrolling pane
              scrollPane = new JScrollPane( table );
              topPanel.add( scrollPane, BorderLayout.CENTER );
        public void comboBoxColumn(TableColumn comboBoxCol) {
            comboBoxCol.setCellEditor(new TableComponentEditor());
            comboBoxCol.setCellRenderer(new TableComponentRenderer());
            //Set up tool tip for the sport column header.
            TableCellRenderer headerRenderer = comboBoxCol.getHeaderRenderer();
            if (headerRenderer instanceof DefaultTableCellRenderer) {
                 ((DefaultTableCellRenderer)headerRenderer).setToolTipText("Click the sport to see a list of service stations");
        } //end of method
        class TableComponentEditor extends DefaultCellEditor {
            * Constructor
            * @param none
            TableComponentEditor() {
                super(new JComboBox());
            * Called when table Cell is clicked
            * @param table
            * @param value - Object associated with the particular column for which it is called
            * @param isSelected -whether the particular cell is selected
            * @param row - The row to which cell belongs
            * @param column - The Column To which Cell Belongs
            public  Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) {
                cbo = (JComboBox)value;
                return cbo;
            *  getCellEditorValue
            * @return Object
            public Object getCellEditorValue() {
                return cbo;
            /***************CLASS VARIABLES***********************/
            private JComboBox cbo = null;
        class TableComponentRenderer  implements TableCellRenderer {
            public  Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column)  {
                return (JComboBox)value;
         // Main entry point for this example
         public static void main( String args[] )
              // Create an instance of the test application
              SimpleTableExample mainFrame     = new SimpleTableExample();
              mainFrame.setVisible( true );
    }

  • After I went to iOS 7.0.3 can't use hotspot with usb cable

    Hello All
    After upgrading to iOS 7 on my iphone 4 I can no longer use my personal hotspot with a usb cable (wifi connection works)
    When I go to system preferences>Network>Ethernet (Macbook Pro ...0S 10.6.8 )
    It says "cable unplugged " but it is plugged because I can charge and transfer data using this cable
    Here is what I've tried so far on my Macbook Pro with OSX 10.6.8 and my iphone 4
    Tried a  different cable  ..... did not work
    Made ethernet setting inactive and active again .. did not work
    Deleted Ethernet setup and  and created it again .. did not work
    Reset the iphone network settings twice did not work
    So what now ?
    I don't like the iOS 7 its slower and I am having another problem too
    Thanks All

    I am having the same problem. I have a normal iphone4 and when I upgraded to ios7, suddenly no one can hear me on calls. It works with speakerphone and on a headset, and I can play music normally. It has to be software, or else why would speakerphone work? My phone also functioned just fine before this upgrade and now my phone is useless as a phone.

  • I can't access my wi-fi at home but I can hotspot with my phone

    I just purchased a iPad 1st generation for my 5 year old because she destroyed her 3rd generation.  I can connect to my iPhone hotspot but not to my home wi-fi.  Can anyone help me?

    If it connects to your phone, and can access internet via the hot spot, the problem is with your home wifi.
    Reset the router
    If that doesn't work call your internet provider.

  • Plz tell me how to use JSpinner with JTable

    I have retrieve records from database but as the number of records(rows) are more than 1000 , i want to use JSpinner with JTable . plz solve my problem by giving the appropriate code for the same.

    hi
    check this links
    http://www.exampledepot.com/egs/javax.swing.table/CustRend.html
    http://java.sun.com/docs/books/tutorial/uiswing/components/table.html
    hope this will help you.. this explains exactly what you want.
    regards
    Aniruddha

  • Re: Using JScrollPane With JTable

    >
    myNamePane.setVisible(true);This is meaningless, a component becomes visible by default when you add it to a visible container
    if(e.getSource().equals(newStudent))
           JFrame newFrame = new JFrame("Please select a student");
           newFrame.setContentPane(myNamePane);
           newFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
           newFrame.setResizable(false);
           newFrame.pack();
           newFrame.setVisible(true);
         }Which brings us to the main issue, you need to add the JScrollPane to you frame
    newFrame.add(myNamePane);Read the tutorial: [Using Top-Level Containers|http://java.sun.com/docs/books/tutorial/uiswing/components/toplevel.html]

    Hello Rodney,
    Thanks for the information and the tutorial.. I've worked with containers before but never got around to reading that one, which has clarified a few things for me.
    Unfortunately however, my problem persists. I obviously can't set the content pane as the JScrollPane and add it to the Frame, so rather than setting the JScrollPane as the content pane (which I did previously), I added it to the frame as you suggested:
    if(e.getSource().equals(newStudent))
         JFrame newFrame = new JFrame("Please select a student");
    //     newFrame.setContentPane(myNamePane);
         newFrame.add(myNamePane);
         newFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         newFrame.setResizable(false);
         newFrame.pack();
         newFrame.setVisible(true);
    }But the same thing happens! All I see is a new, empty JFrame. I feel like my understanding of the JScrollPane may be flawed, but I'm really not sure :/
    Edit: In fact, it is most definitely a problem either with my JTable or my JScrollPane. I used the setPreferredSize() method to check if the JScrollPane was being displayed in the JFrame, and it is. There is no JTable in the pane however.
    Edit #2: The problem was, in fact, with my JTable. The ResultSet I was using was TYPE_FORWARD_ONLY, and I was trying to call studentNameSet.first(), which prevented the JTable from ever being created. Thanks for your help, Rodney. Although I do have one more question.. Do you know a better way for me to find the number of student names given that ResultSet? I can't iterate through it twice as I had done earlier, so now for testing purposes I've simply hardcoded the number in, but I'd rather have the program find the total number of entries dynamically.
    Edited by: Pheer on Jul 22, 2008 10:07 AM
    Edited by: Pheer on Jul 22, 2008 10:09 AM

  • Strange thing happens with JTable & JFormattedTextField

    hello,
    again a problem,
    in my Jtable i have different JFormattedTextField with a mask for a datefield, everything works fine, for that i made a formatteddateeditor which holds a JFormattedTextField an a renderer which extends a JFormattedTextField and implements the tablecellrenderer.
    Now here 's my problem, sometimes when i click on so a field, the mask (__/__/___) dispappears and i got a blank field with the cursor blinking,does anaybody knwo how to do solve this thing ???
    THX
    Tom

    Sounds like that field is editable. The renderer renders the display when a field is not
    being edited, a TableCellEditor is in charge when the field is edited, and the default
    editor is just a JTextField.
    : jay

  • Help please with Jtable

    HI
    I'm having problems
    I have a frame that has a textField, button, label.
    The button is used to diplay the Jtable which has the resultSet.
    My query is:
    String query = "SELECT personID, firstName, surname FROM Person where firstName = '" + jTxtTest.getText() + "'";
    If I enter Gita in the textField and press the button it should display the personID, firstName, surname where firtsname = Gita
    in the Jtable and also display Gita in the label.
    But it only display Gita in the Label but noting in the Jtable.
    What am i doing wrong?????
    public class Frame1 extends JFrame {
    JPanel contentPane;
    BorderLayout borderLayout1 = new BorderLayout();;
              String driver="sun.jdbc.odbc.JdbcOdbcDriver";
              String url="jdbc:odbc:myDatabase";
              String tempname = "";
              int tempcnt;
              JTabbedPane tabbedPane = new JTabbedPane();
              Object[] data = new Object[20];
              DefaultTableModel defaulttablemodel = new DefaultTableModel();
              JTable jtable = new JTable(defaulttablemodel);
    JPanel p1 = new JPanel();
    JTabbedPane jTabbedPane1 = new JTabbedPane();
    JPanel jPanel1 = new JPanel();
    JTextField jTxtTest = new JTextField();
    JButton jButton1 = new JButton();
    JLabel jLabel1 = new JLabel();
    /**Construct the frame*/
    public Frame1() {
    enableEvents(AWTEvent.WINDOW_EVENT_MASK);
    try {
    jbInit();
    catch(Exception e) {
    e.printStackTrace();
    /**Component initialization*/
    private void jbInit() throws Exception {
    setup();
    contentPane = (JPanel) this.getContentPane();
    this.setSize(new Dimension(554, 532));
    this.setTitle("Frame Title");
    jPanel1.setLayout(null);
    jTxtTest.setBounds(new Rectangle(53, 20, 208, 33));
    jButton1.setText("jButton1");
    jButton1.setBounds(new Rectangle(314, 19, 130, 36));
    jButton1.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(ActionEvent e) {
    jButton1_actionPerformed(e);
    jLabel1.setBounds(new Rectangle(462, 23, 82, 20));
    contentPane.add(jTabbedPane1, BorderLayout.CENTER);
    jTabbedPane1.add(jPanel1, "jPanel1");
    jPanel1.add(jTxtTest, null);
    jPanel1.add(jButton1, null);
    jPanel1.add(jLabel1, null);
    void setup()
                   setupMenuBar();
                   showpane1();
                   //contentPane.add(tabbedPane, BorderLayout.CENTER);
              //------------------------------------------------------------ End setup -----------------
              //============================================================ Start setupMenuBar ========
              void setupMenuBar()
                   MenuBar menuBar = new MenuBar();
                   Menu fileMenu = new Menu("File");
                             MenuItem fileExit = new MenuItem("Exit");
                                  fileExit.addActionListener(new MenuItemHandler());
                                  fileMenu.add(fileExit);
    MenuItem filePrev = new MenuItem("Preview");
                                  filePrev.addActionListener(new MenuItemHandler());
                                  fileMenu.add(filePrev);
                             menuBar.add(fileMenu);
                   setMenuBar(menuBar);
              //------------------------------------------------------------ End setupMenuBar-----------
              //============================================================ Start showpane1 =========
              void showpane1() // REPORTS TAB WITH JTABLE
                   p1.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(),"Student Reports 1"));
    p1.setBounds(new Rectangle(28, 70, 513, 429));
    try
                             Class.forName(driver);
                             Connection connection=DriverManager.getConnection(url);
                             Statement statement = connection.createStatement();
                             String query = "SELECT personID, firstName, surname FROM Person where firstName = '" + jTxtTest.getText() + "'";
                             ResultSet rs = statement.executeQuery(query);
    if (rs == null)
    System.out.println("cannot execute query");
                             ResultSetMetaData rmeta = rs.getMetaData();
                             int numColumns=rmeta.getColumnCount();
    for(int i=1;i<=numColumns;++i)
                                  if(i<=numColumns)
                                       defaulttablemodel.addColumn(rmeta.getColumnName(i));
                             while(rs.next())
                                  for(int i=1;i<=numColumns;++i)
                                       if(i<=numColumns)
                                            tempname = rs.getString(i);
                                            tempcnt=i-1;
                                            data[tempcnt] = tempname;
                                  defaulttablemodel.addRow(data);
                   catch(Exception ex)
         p1.add(new JScrollPane(jtable));
              //------------------------------------------------------------ End showpane1 ------------
              //=========================================================== START MenuItemHandler ======
              class MenuItemHandler implements ActionListener
                   public void actionPerformed(ActionEvent ev)
                        String s=ev.getActionCommand();
                        if(s=="Exit")
                        System.exit(0);
    else if (s=="Preview")
    /**Overridden so we can exit when window is closed*/
    protected void processWindowEvent(WindowEvent e) {
    super.processWindowEvent(e);
    if (e.getID() == WindowEvent.WINDOW_CLOSING) {
    System.exit(0);
    void jButton1_actionPerformed(ActionEvent e) {
    jLabel1.setText(jTxtTest.getText());
    jPanel1.add(p1);
    contentPane.repaint();
    }

    Hi,
    Seems u r new to progrmming.Well u used Jbuilder to write.U wrote good debug statments but forgot to write deubg statment or printstacktrace in excpetions.
    ok here is answer for ur problem.
    import javax.swing.*;
    import javax.swing.table.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.sql.*;
    public class Frame1 extends JFrame {
    JPanel contentPane;
    BorderLayout borderLayout1 = new BorderLayout();;
    String driver="org.gjt.mm.mysql.Driver";
    String url="jdbc:mysql://thienpo-app.thienpo.com/jps";
    String user="";
    String pass="";
    String tempname = "";
    int tempcnt;
    boolean firstTime=false;
    JTabbedPane tabbedPane = new JTabbedPane();
    Object[] data = new Object[20];
    DefaultTableModel defaulttablemodel = new DefaultTableModel();
    JTable jtable = new JTable(defaulttablemodel);
    JPanel p1 = new JPanel();
    JTabbedPane jTabbedPane1 = new JTabbedPane();
    JPanel jPanel1 = new JPanel();
    JTextField jTxtTest = new JTextField();
    JButton jButton1 = new JButton();
    JLabel jLabel1 = new JLabel();
    /**Construct the frame*/
    public Frame1() {
    enableEvents(AWTEvent.WINDOW_EVENT_MASK);
    try {
    jbInit();
    catch(Exception e) {
    e.printStackTrace();
    /**Component initialization*/
    private void jbInit() throws Exception {
    setupMenuBar();
    contentPane = (JPanel) this.getContentPane();
    this.setSize(new Dimension(554, 532));
    this.setTitle("Frame Title");
    jPanel1.setLayout(null);
    jTxtTest.setBounds(new Rectangle(53, 20, 208, 33));
    jButton1.setText("jButton1");
    jButton1.setBounds(new Rectangle(314, 19, 130, 36));
    jButton1.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(ActionEvent e) {
    jButton1_actionPerformed(e);
    jLabel1.setBounds(new Rectangle(462, 23, 82, 20));
    contentPane.add(jTabbedPane1, BorderLayout.CENTER);
    jTabbedPane1.add(jPanel1, "jPanel1");
    jPanel1.add(jTxtTest, null);
    jPanel1.add(jButton1, null);
    jPanel1.add(jLabel1, null);
    this.setVisible(true);
    //------------------------------------------------------------ End setup -----------------
    //============================================================ Start setupMenuBar ========
    void setupMenuBar()
    MenuBar menuBar = new MenuBar();
    Menu fileMenu = new Menu("File");
    MenuItem fileExit = new MenuItem("Exit");
    fileExit.addActionListener(new MenuItemHandler());
    fileMenu.add(fileExit);
    MenuItem filePrev = new MenuItem("Preview");
    filePrev.addActionListener(new MenuItemHandler());
    fileMenu.add(filePrev);
    menuBar.add(fileMenu);
    setMenuBar(menuBar);
    //------------------------------------------------------------ End setupMenuBar-----------
    //============================================================ Start showpane1 =========
    void showpane1() // REPORTS TAB WITH JTABLE
    p1.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(),"Student Reports 1"));
    p1.setBounds(new Rectangle(28, 70, 513, 429));
    try
    Class.forName(driver);
    Connection connection=DriverManager.getConnection(url,user,pass);
    Statement statement = connection.createStatement();
    String query = "SELECT personID, firstName, surname FROM Person where firstName = '" + jTxtTest.getText() + "'";
    System.out.println(" query"+query);
    ResultSet rs = statement.executeQuery(query);
    if (rs == null)
    System.out.println("cannot execute query");
    System.out.println(" query"+query);
    ResultSetMetaData rmeta = rs.getMetaData();
    int numColumns=rmeta.getColumnCount();
    if( !firstTime){
    for(int i=1;i<=numColumns;++i)
    if(i<=numColumns )
    defaulttablemodel.addColumn(rmeta.getColumnName(i));
    firstTime=true;
    while(rs.next())
    for(int i=1;i<=numColumns;++i)
    if(i<=numColumns)
    tempname = rs.getString(i);
    tempcnt=i-1;
    data[tempcnt] = tempname;
    defaulttablemodel.addRow(data);
    catch(Exception ex)
    System.out.println("***********************"+ex);
    p1.add(new JScrollPane(jtable));
    public static void main(String[] args){
         new Frame1();
    //------------------------------------------------------------ End showpane1 ------------
    //=========================================================== START MenuItemHandler ======
    class MenuItemHandler implements ActionListener
    public void actionPerformed(ActionEvent ev)
    String s=ev.getActionCommand();
    if(s=="Exit")
    System.exit(0);
    else if (s=="Preview")
    /**Overridden so we can exit when window is closed*/
    protected void processWindowEvent(WindowEvent e) {
    super.processWindowEvent(e);
    if (e.getID() == WindowEvent.WINDOW_CLOSING) {
    System.exit(0);
    void jButton1_actionPerformed(ActionEvent e) {
    jLabel1.setText(jTxtTest.getText());
    showpane1();
    jPanel1.add(p1);
    contentPane.repaint();
    sreeni,
    [email protected]

Maybe you are looking for

  • How to config NACE for printing debit memo request ?

    hi, I've tried to config with the transaction NACE for SAtype GV ( debit memo request ) In SPRO in config : GV     Deb.MemoReq. f.Ctrct     V10000     Order Output     ZBA0      but then I used the transaction VA02 to print document header, The statu

  • Unable to open .jar -files on VisipriseMfg.ear

    Hi, Any ideas what setting will be wrong because when I hit for example nc.ejb.jar in VisipriseMfg.ear, an error pop-up (Java Virtual Machine Launcher) exists: 'Failed to load Main-Class manifest attribute from....' Same problem in all .jar -files. A

  • NEF Nikon D5100 - displaying too dark in LR

    I just bought a Nikon D5100. While importing the NEF files, LR firstly shows the images with the correct exposition (equal to the ones previewed in camera), then two seconds after (after fully rendering the image) LR darkens the images, so that they

  • Failed logon attempts tracking without AUDIT_TRAIL

    Hello All, I would like to know if any other way than AUDIT_TRAIL=db and AUDIT CONNECT WHENEVER NOT SUCCESSFUL; any thing like enabling listener tracing or so ? i need to track source from where some one is trying to logon in system. Thanks and Regar

  • Getting Reason Code, Condition Type, and Condition Value in one report

    Hello there, I have got a Question for you all BW Gurus. I need the answer for this as soon as possible. I will assign points to all helpful answers. I am having a Sales cube, Delivery Cube, and a Conditions Cube which I built. Each cube is populated