JTable with ScrollPane update problem

hay i have a table and scrollpane is used as a container, at runtime i create new object of table and assign it to the scrollpane, but its still showing the old table,
I also tried to
updateUI();
repaint();
but it still showing the same old table,
I also debug and saw that the new table has been created n successfuly displaying the values at command prompt.
Can any one know whats wrong in it.

Dont be ferious budy, now this is a working example....
Problem is: I am changing the table object in jPanel2 but still jPanel2 is showing the same old table, I think there is a refresh kind of a problem
Be kool dude n tell where is the problem.
package tabletesting;
import java.awt.BorderLayout;
import javax.swing.JFrame;
import javax.swing.JPanel;
import java.awt.*;
import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ContainerEvent;
import java.awt.event.ContainerAdapter;
public class EmbededTable extends JFrame {
public EmbededTable() {
try {
jbInit();
} catch (Exception exception) {
exception.printStackTrace();
private void jbInit() throws Exception {
flag=1; // flag to alter between objects
getContentPane().setLayout(null);
jPanel1.setBorder(BorderFactory.createEtchedBorder());
jPanel1.setBounds(new Rectangle(28, 11, 320, 76));
jPanel1.setBackground(Color.pink);
jPanel1.setVisible(true);
// jPanel1 contain the buttons when press toggel the table in panel
     this.setSize(new Dimension(640, 600));
this.addContainerListener(new EmbededTable_this_containerAdapter(this));
jPanel1.setLayout(null);
jButton1.setBounds(new Rectangle(57, 2, 71, 29));
jButton1.setText("jButton1");
jButton1.addActionListener(new EmbededTable_jButton1_actionAdapter(this));
jPanel2.setBorder(BorderFactory.createEtchedBorder());
jPanel2.setBounds(new Rectangle(22, 133, 578, 304));
jPanel2.addContainerListener(new EmbededTable_jPanel2_containerAdapter(this));
jPanel2.setLayout(borderLayout1);
testTable(); // to initially populate the jPanel2 with the tabel
jButton2.setBounds(new Rectangle(191, 20, 93, 25));
jButton2.setText("jButton2");
jButton2.addActionListener(new EmbededTable_jButton2_actionAdapter(this));
this.getContentPane().add(jPanel1);
jPanel1.add(jButton1, null);
jPanel1.add(jButton2);
this.getContentPane().validate();
this.setVisible(true);
this.show();
public void testTable()
String[] columnNames = {"First Name",
"Last Name",
"Sport",
"Include Input",
"Include Output"};
Object[][] data = {
{"Mary", "Campione",
"Snowboarding", new Boolean(false), new Boolean(false)},
{"Alison", "Huml",
"Rowing", new Boolean(false), new Boolean(true)},
{"Kathy", "Walrath",
"Knitting", new Boolean(false), new Boolean(false)},
{"Sharon", "Zakhour",
"Speed reading", new Boolean(false), new Boolean(true)},
{"Philip", "Milne",
"Pool", new Boolean(false), new Boolean(false)},
if(flag==1)
TableDemo newContentPane = new TableDemo(columnNames,data,4,5);
newContentPane.setOpaque(true); //content panes must be opaque
jPanel2.add(newContentPane, BorderLayout.CENTER);
jPanel2.updateUI();
jPanel2.repaint();
jPanel2.revalidate();
this.getContentPane().add(jPanel2);
flag=0;
else if(flag==0)
Object[][] daa = {
{"A", "T",
"B", new Boolean(false), new Boolean(false)},
{"C", "T",
"Rowing", new Boolean(false), new Boolean(true)},
{"D", "T",
"Knitting", new Boolean(false), new Boolean(false)},
{"E", "T",
"Speed reading", new Boolean(false), new Boolean(true)},
{"F", "T",
"Pool", new Boolean(false), new Boolean(false)},
TableDemo newContentPane = new TableDemo(columnNames,daa,4,5);
newContentPane.setOpaque(true); //content panes must be opaque
this.getContentPane().add(jPanel2);
this.jPanel2.add(newContentPane,BorderLayout.CENTER);
this.jPanel2.updateUI();
jPanel2.repaint();
jPanel2.revalidate();
this.getContentPane().add(jPanel2);
flag=1;
public static void main(String[] args) {
EmbededTable embededtable = new EmbededTable();
JPanel jPanel1 = new JPanel();
static int flag;
JButton jButton1 = new JButton();
JPanel jPanel2 = new JPanel();
JPanel jPanel3 = new JPanel();
BorderLayout borderLayout1 = new BorderLayout();
JButton jButton2 = new JButton();
public void CreateGUI()
String[] columnNames = {"First Name",
"Last Name",
"Sport",
"Include Input",
"Include Output"};
Object[][] data = {
{"A", "Campione",
"B", new Boolean(false), new Boolean(false)},
{"C", "Huml",
"Rowing", new Boolean(false), new Boolean(true)},
{"D", "Walrath",
"Knitting", new Boolean(false), new Boolean(false)},
{"E", "Zakhour",
"Speed reading", new Boolean(false), new Boolean(true)},
{"F", "Milne",
"Pool", new Boolean(false), new Boolean(false)},
//Create and set up the content pane.
TableDemo newContentPane = new TableDemo(columnNames,data,4,5);
newContentPane.setOpaque(true); //content panes must be opaque
jPanel3.setBorder(BorderFactory.createEtchedBorder());
jPanel3.setBounds(new Rectangle(22, 133, 578, 304));
jPanel3.setLayout(borderLayout1);
// this.getContentPane().remove(jPanel2);
this.getContentPane().add(jPanel3);
this.jPanel3.add(newContentPane,BorderLayout.CENTER);
this.jPanel3.updateUI();
this.validate();
public void jButton1_actionPerformed(ActionEvent e) {
CreateGUI();
public void jButton2_actionPerformed(ActionEvent e) {
testTable();
public void this_componentAdded(ContainerEvent e) {
public void jPanel2_componentRemoved(ContainerEvent e) {
System.out.println(" component removed");
public void jPanel2_componentAdded(ContainerEvent e) {
System.out.println(" component added");
class EmbededTable_jPanel2_containerAdapter extends ContainerAdapter {
private EmbededTable adaptee;
EmbededTable_jPanel2_containerAdapter(EmbededTable adaptee) {
this.adaptee = adaptee;
public void componentRemoved(ContainerEvent e) {
adaptee.jPanel2_componentRemoved(e);
public void componentAdded(ContainerEvent e) {
adaptee.jPanel2_componentAdded(e);
class EmbededTable_this_containerAdapter extends ContainerAdapter {
private EmbededTable adaptee;
EmbededTable_this_containerAdapter(EmbededTable adaptee) {
this.adaptee = adaptee;
public void componentAdded(ContainerEvent e) {
adaptee.this_componentAdded(e);
class EmbededTable_jButton2_actionAdapter implements ActionListener {
private EmbededTable adaptee;
EmbededTable_jButton2_actionAdapter(EmbededTable adaptee) {
this.adaptee = adaptee;
public void actionPerformed(ActionEvent e) {
adaptee.jButton2_actionPerformed(e);
class EmbededTable_jButton1_actionAdapter implements ActionListener {
private EmbededTable adaptee;
EmbededTable_jButton1_actionAdapter(EmbededTable adaptee) {
this.adaptee = adaptee;
public void actionPerformed(ActionEvent e) {
adaptee.jButton1_actionPerformed(e);
TabelDemo class
public class TableDemo extends JPanel {
private boolean DEBUG = false;
public TableDemo(String[] c, Object[][] d,int col,int row) {
super(new GridLayout(1, 0));
JTable table = new JTable(new MyTableModel(c,d,4,5));
table.setPreferredScrollableViewportSize(new Dimension(500, 70));
table.setFillsViewportHeight(true);
Object obj=table.getValueAt(0,1);
table.updateUI();
JScrollPane scrollPane = new JScrollPane();
scrollPane.getViewport().setView(table);
     Object ob= table.getValueAt(0,0);
System.out.println(" ob " + ob.toString());
scrollPane.updateUI();
scrollPane.getViewport().revalidate();
scrollPane.getViewport().updateUI();
add(scrollPane);
this.updateUI();
this.revalidate();
super.repaint();
super.validate();
Tabel class
public class MyTableModel extends AbstractTableModel {
boolean DEBUG= false;
public String[] columnNames ;
public String[] str; // to verify only one output variable
Boolean fal= new Boolean(false);
     public Object[][] data;
MyTableModel()
MyTableModel(String[] col, Object[][] dat, int lenRow, int lenCol)
data=dat;
columnNames=col;
str= new String[col.length];
funcopy(str,lenRow);
void funcopy(String[] str, int lenRow)
for(int i=0;i<lenRow;i++)
str=fal.toString();
for(int i=0;i<str.length;i++)
System.out.println("values are " + str[i]);
public int getColumnCount() {
return columnNames.length;
public int getRowCount() {
return data.length;
public String getColumnName(int col) {
return columnNames[col];
public Object getValueAt(int row, int col) {
return data[row][col];
public Class getColumnClass(int c) {
return getValueAt(0, c).getClass();
public boolean isCellEditable(int row, int col) {
//Note that the data/cell address is constant,
//no matter where the cell appears onscreen.
if (col < 2) {
return false;
} else {
return true;
public void setValueAt(Object value, int row, int col) {
if (DEBUG) {
System.out.println("Setting value at " + row + "," + col
+ " to " + value
+ " (an instance of "
+ value.getClass() + ")");
System.out.println("row " + row + "col " + col + value.toString());
Object obj= getValueAt(row,col);
if(col==3) // column 3 is the output column.
if(value.toString().equals("true"))
int savepointer=row;
int flag=-1;
for(int i=0;i<str.length;i++)
if(str[i].toString().equalsIgnoreCase("true"))
flag=1;
if(flag!=1)
System.out.println("inside flag ==1");
data[row][col]=value;
str[row]=value.toString();
fireTableCellUpdated(row, col);
if(value.toString().equals("false"))
data[row][col]=value;
str[row]=value.toString();
fireTableCellUpdated(row, col);
}// id col ends...
if (DEBUG) {
System.out.println("New value of data:");
printDebugData();
private void printDebugData() {
int numRows = getRowCount();
int numCols = getColumnCount();
for (int i=0; i < numRows; i++) {
System.out.print(" row " + i + ":");
for (int j=0; j < numCols; j++) {
System.out.print(" " + data[i][j]);
System.out.println();
System.out.println("--------------------------");

Similar Messages

  • JTable with JComboBox/JSpinner problem

    The following code has a JTable with 2 columns.The lst column has JComboBoxes, the 2nd column has JSpinners.I want to set the spinner range of values based on the selection of JComboBox. The JComboBox selections are "small" and "large". For "small" the spinner should range from 0..49, for "large" from 50..99. When a selection is made, MyTable.itemStateChanged() is called, which in turn calls SpinnerEditor.setValueRange(). This sets an array with the desired values and then sets the model with this array. However, it sets the range not only for the row in which the combo box was clicked, but all rows.
    So in MyTable.setCellComponents(), there is this:
    spinnerEditor = new SpinnerEditor(this, defaultTableModel);
    modelColumn.setCellEditor(spinnerEditor);
    If the table has n rows, are n SpinnerEditors created, or just 1?
    If 1, do n need to be created and if so, how?
    public class MyTable extends JTable implements ItemListener {
         private DefaultTableModel defaultTableModel;
         private Vector<Object> columnNameVector;
         private JComboBox jComboBox;
         private SpinnerEditor spinnerEditor;
         private final int COMBO_BOX_COLUMN = 0;
         final static int SPINNER_COLUMN = 1;
         public static String SMALL = "Small";
         public String LARGE = "Large";
         private final String[] SMALL_LARGE = {
                   SMALL,
                   LARGE };
         public MyTable(String name, Object[][] variableNameArray, Object[] columnNameArray) {
              columnNameVector = new Vector<Object>();
              // need column names in order to make copy of table model
              for (Object object : columnNameArray) {
                   columnNameVector.add(object);
              defaultTableModel = new DefaultTableModel(variableNameArray, columnNameArray);
              this.setModel(defaultTableModel)     ;
              setCellComponents();
              setListeners();
         private void setCellComponents() {
              // combo box column -----------------------------------------------
              TableColumn modelColumn = this.getColumnModel().getColumn(COMBO_BOX_COLUMN);
              jComboBox = new JComboBox(SMALL_LARGE);
              // set default values
              for (int row = 0; row < defaultTableModel.getRowCount(); row++) {
                   defaultTableModel.setValueAt(SMALL_LARGE[0], row, COMBO_BOX_COLUMN);
              modelColumn.setCellEditor(new DefaultCellEditor(jComboBox));
              DefaultTableCellRenderer renderer = new DefaultTableCellRenderer();
              renderer.setToolTipText("Click for small/large"); // tooltip
              modelColumn.setCellRenderer(renderer);
              // index spinner column ------------------------------------------------------------
              modelColumn = this.getColumnModel().getColumn(SPINNER_COLUMN);
              spinnerEditor = new SpinnerEditor(this, defaultTableModel);
              modelColumn.setCellEditor(spinnerEditor);
              renderer = new DefaultTableCellRenderer();
              renderer.setToolTipText("Click for index value"); // tooltip
              modelColumn.setCellRenderer(renderer);
         private void setListeners() {
              jComboBox.addItemListener(this);
         @Override
         public void itemStateChanged(ItemEvent event) {
              // set spinner values depending on small or large
              String smallOrLarge = (String)event.getItem();
              if (this.getEditingRow() != -1 && this.getEditingColumn() != -1) {
                   spinnerEditor.setValueRange(smallOrLarge);
         public static void main(String[] args) {
              try{
                   UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
              catch (Exception e){
                   e.printStackTrace();
              String[] columnNameArray = {"JComboBox", "JSpinner"};
              Object[][]  dataArray = {
                        {"", "0"},
                        {"", "0"},
                        {"", "0"},
              final MyTable myTable = new MyTable("called from main", dataArray, columnNameArray);
              final JFrame frame = new JFrame();
              frame.getContentPane().add(new JScrollPane(myTable));
              frame.setTitle("My Table");
              frame.setPreferredSize(new Dimension(200, 125));
              frame.addWindowListener(new WindowAdapter(){
                   @Override
                   public void windowClosing(WindowEvent e) {
              frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
              frame.setLocation(800, 400);
              frame.pack();
              frame.setVisible(true);
    public class SpinnerEditor extends AbstractCellEditor implements TableCellEditor {
         private JComponent parent;
         private DefaultTableModel defaultTableModel;
         private final JSpinner spinner = new JSpinner();
         private String[] spinValues;
         private int row;
         private int column;
         public SpinnerEditor(JTable parent, DefaultTableModel defaultTableModel ) {
              super();
              this.parent = parent;
              this.defaultTableModel = defaultTableModel;
              setValueRange(MyTable.SMALL);
              // update every time spinner is incremented or decremented
              spinner.addChangeListener(new ChangeListener(){
                   public void stateChanged(ChangeEvent e) {
                        String value = (String) spinner.getValue();
                        System.out.println ("SpinnerEditor.stateChanged(): " + value);
                        setValue(value);
         private void setValue(String value) {
              // save to equation string
              System.out.println ("SpinnerEditor.setValue(): " + value + " at (" + row + ", " + MyTable.SPINNER_COLUMN + ")");
              ((JTable) parent).setValueAt(spinner.getValue(), this.row, this.column);
         @Override
         public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column)      {
              System.out.println ("SpinnerEditor.getTableCellEditorComponent(): row: " + row + "\tcolumn: " + column);
              System.out.println ("SpinnerEditor.getTableCellEditorComponent(): value: " + value);
              this.row = row;
              this.column = column;
              return spinner;
         @Override
         public boolean isCellEditable(EventObject evt) {
              return true;
         // Returns the spinners current value.
         @Override
         public Object getCellEditorValue() {
              return spinner.getValue();
         @Override
         public boolean stopCellEditing() {
              System.out.println("SpinnerEditor.stopCellEditing(): spinner: " + spinner.getValue() + " at (" + this.row + ", " + this.column + ")");
              ((JTable) parent).setValueAt(spinner.getValue(), this.row, this.column);
              return true;
         public void setValueRange(String smallOrLarge) {
              System.out.println ("SpinnerEditor.setValueRange for " + smallOrLarge);
              final int ARRAY_SIZE = 50;
              if (MyTable.SMALL.equals(smallOrLarge)) {
                   final int MIN_SPIN_VALUE = 0;               
                   final int MAX_SPIN_VALUE = 49;
                   //System.out.println ("SpinnerEditor.setValueRange(): [" + MIN_SPIN_VALUE + ".." +  MAX_SPIN_VALUE + "]");
                   spinValues = new String[ARRAY_SIZE];
                   for (int i = MIN_SPIN_VALUE; i <= MAX_SPIN_VALUE; i++) {
                        spinValues[i] = new String(Integer.toString(i));
              else { // large
                   final int MIN_SPIN_VALUE = 50;               
                   final int MAX_SPIN_VALUE = 99;
                   //System.out.println ("SpinnerEditor.setValueRange(): [" + MIN_SPIN_VALUE + ".." +  MAX_SPIN_VALUE + "]");
                   spinValues = new String[ARRAY_SIZE];
                   for (int i = 0; i <ARRAY_SIZE; i++) {
                        spinValues[i] = new String(Integer.toString(MIN_SPIN_VALUE + i));
                   //for (int i = 0; i <ARRAY_SIZE; i++) {
                   //     System.out.println ("spinValues[" + i + "] = " + spinValues);
              System.out.println ("SpinnerEditor.setValueRange(): [" + spinValues[0] + ".." + spinValues[ARRAY_SIZE-1] + "]");
              // set model
              spinner.setModel(new SpinnerListModel(java.util.Arrays.asList(spinValues)));

    However, it sets the range not only for the row in which the combo box was clicked, but all rows. Yes, because a single editor is used by the column.
    One solution is to create two editors, then you override the getCellEditor(...) method to return the appropriated editor. Something like:
    If (column == ?)
        if (smallOrLarge)
          return the small or large spinner editor
        else
           return the large spinner editor
    else
        return super.getCellEditor(...);

  • Newbie here with automatic update problem.

    Hi everyone,
    I just purchased a palm centro for sprint and so far I really like it. The problem is every morning when I get up there is this message...
    Sorry, your secheduled automatic updte did not complete successfully because a connection could not be establised--32485
    Can anyone help me with this? I would appreciate any advice. Thanks.
    Leila
    Post relates to: Centro (Sprint)

    Hello Leila and welcome to the Palm forums.
     This is likely an error message from the My Centro application of the Palm Software (store) application.  The problem is that one or both of these applications is waking up while you're asleep and trying to check for content updates (not really needed in my opinion) and the Internet connection on your phone is currently closed.
     I don't use either of these applications on my Treo 755p (My Centro is called My Treo).  If you launch these apps on your Centro, and then press the Menu button on your keyboard you should be be able to access the menu item that controls software updates and turn off the updates.
     Other applications on your Centro may also be looking to check for updates.  I would also check Pocket Tunes (pTunes) to see if it is looking for updates also.
    Hope that helps,
    Alan G
    Post relates to: Treo 755p (Sprint)

  • What's going on with the update problem?

    I still can't attach my ipod to my machine and play any music. Additionally, if I try to update any data on the iPod (song titles, artist names, etc), this also ultimately ends up freezing my machine (spinning beachball). I've got the most recent update here, and I believe this to be the cause of the problem. I am also totally updated on my OS. 2nd Generation iPod, plenty of songs -- works fine other than the lousy battery situation (didn't have my receipt, so couldn't participate in the class action suit). Anyway, working straight from the ipod to headphones, everything works fine. I just can't add any new songs anymore.
    What gives? Hasn't worked with the new updates. Apple, are you listening?

    I have a 4G 40 gig iPod that would lock up my computer if I plugged it in (Win XP). It would skip songs, freeze, do all kinds of weird stuff accompanied by a clicking sound. If your iPod is doing this, most people I have read about (including myself) found that by hitting your iPod hard on the right side seems to fix the problem. Mine wasn't working for about two weeks, I finally gave up all the other things I was doing and tried it. Now it works fine again. I also thought it was the "1-10-2006" updater, but I think it was just something loose in the iPod.

  • Help with iPhoto update problems?

    I was just prompted to update to iPhoto 2011 9.4.2 and not it will not upload albums to Facebook and it's decided to move all my events around and no longer allow me to move photos in an event. Does anyone have any solutions?

    Hi Ed_Tubridy,
    Please click on Learn More and let us know the exact error message. Are you on a managed network.
    Regards,
    Romit Sinha

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

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

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

  • Update row with more data - JTable with Abstracttablemodel

    Hello!
    I got some problems with my program, im using jtable with abstracttablemodel.
    First I include content into the jtable by pressing &rdquo;New Content&rdquo;, then it will pop up a dialog which I fill with information as you can see in the picture.
    http://img42.imageshack.us/img42/6969/jtable.jpg
    But when its done, I want to borrow it and update that row with more information as you can see if its loaned, if it is their shall be a checkbox, name and phone there. I don&rsquo;t really know how to do this. Suppose I should do a similar metodh as when I&rsquo;m adding and removing content. The question is how do I do that? I&rsquo;ve been looking at some tips and hints on google. It seems to me that should use &ldquo;fireTableRowsUpdated&rdquo; but not really sure if its right and how to. When I&rsquo;m borrowing the specific row I guess I need to check which row is clicked before borrowing and then fill in the information and update the table.The borrow button will also pop up a dialog with 3 fields to fill. Here is the code I wrote for adding and removing. I&rsquo;ve tried with the update but its not right which I&rsquo;m going to use when borrowing objects from the database. Please help!
    Code from the abstracttablemodel
    private ArrayList<Objects> obj = new ArrayList<Objects>();
         public void add(Objects o) {
              obj.add(o);
              fireTableRowsInserted(obj.size()-1, obj.size()-1);
         public void remove(int o) {
              int index = obj.indexOf(o);
              obj.remove(o);
              fireTableRowsDeleted(index, index);
         public void update (Objects o){
              // Not sure how to do here
              //int index = obj.indexOf(o);
              //fireTableRowsUpdated(index,index);
         }Code for the button in the main program.
    if (arg.getSource() == borrow) {
    // How should I do here? I need to implement the BorrowDialog, check if a row is pressed then update? How do I do that?
                   BorrowDialog newLoan = new BorrowDialog(frame);
                   if(table.getSelectedRow() == -1)
                        JOptionPane.showMessageDialog(frame,"Select the row before loan");
                   else
                        dir.update(newLoan.getLoan());
                        table.repaint();
              }Code for BorrowDialog
    public class BorrowDialog extends JDialog implements ActionListener {
            //implements JTextFields, Buttons,Labels and Panels.
         public BorrowDialog(JFrame parent) {
         //Setting buttons to panels and such
         public Objects getLoan(){
              return loan;
         public void setLoan()
                    // Not sure if this is right, as I leave some fields empty, will it be empty when its updating aswell?
                    // I tried with add data then it just will be a new row, when I will update a specific row
                    loan = new Objects("", "" , "" , "" , "" ,"", loanField.getText(),nameField.getText(), phoneField.getText());
         public void actionPerformed(ActionEvent arg) {
              if (arg.getActionCommand().equals("Save")) {
                   System.out.println("save");
                   setLoan();
                   dispose();
    }All help is appreciated!
    Edited by: iTech34 on Feb 22, 2010 3:27 AM
    Edited by: iTech34 on Feb 22, 2010 3:31 AM
    Edited by: iTech34 on Feb 22, 2010 3:58 AM

    Look up for the rest of the code!
    I explained everything on the first post, so please read there so you know the problem I got.
    import java.awt.BorderLayout;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.*;
    public class Database implements ActionListener {
         private final int WIDTH = 800;
         private final int HEIGHT = 800;
         private JTable table = new JTable();
         private JFrame frame = new JFrame("Database");
         private JButton addContent = new JButton("New content");
         private JButton borrow = new JButton("Borrow");
         private JButton returnObject = new JButton("Return");
         private JButton remove = new JButton("Remove");
         private JButton save = new JButton("Save");
         private JButton load = new JButton("Load");
         private JButton exit = new JButton("Exit");
         private Directory dir = new Directory();
         private JPanel buttonPanel = new JPanel();
         private JPanel mainPanel = new JPanel();
         public Database() {
              // BUTTONS
              buttonPanel.add(addContent);
              buttonPanel.add(remove);
              buttonPanel.add(borrow);
              buttonPanel.add(returnObject);
              buttonPanel.add(save);
              buttonPanel.add(load);
              buttonPanel.add(exit);
              // ACTION LISTENERS
              addContent.addActionListener(this);
              remove.addActionListener(this);
              borrow.addActionListener(this);
              returnObject.addActionListener(this);
              save.addActionListener(this);
              load.addActionListener(this);
              exit.addActionListener(this);
              // JTABLE
              table = new JTable(dir);
              table.setAutoCreateRowSorter(true);
              table.setRowHeight(25);
              JScrollPane JScroll = new JScrollPane(table);
              // PANELS
              mainPanel.setLayout(new BorderLayout());
              mainPanel.add("North", buttonPanel);
              mainPanel.add("Center", JScroll);
              // FRAME
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              frame.setSize(WIDTH, HEIGHT);
              frame.getContentPane().add(mainPanel);
              frame.pack();
              frame.setLocationRelativeTo(null);
              frame.setVisible(true);
         public void actionPerformed(ActionEvent arg) {
              if (arg.getSource() == addContent) {
                   Dialog newDialog = new Dialog(frame);
                   dir.add(newDialog.getItem());
              if (arg.getSource() == remove) {
                   if (table.getSelectedRow() == -1)
                        JOptionPane.showMessageDialog(frame,"Select the row before remove");
                   else
                        dir.remove(table.getSelectedRow());
              if (arg.getSource() == borrow) {
                   // Not sure how to do here! I need to check which row I've clicked and take that row into BorrowDialog as argument i suppose.. please explain
                   BorrowDialog newLoan = new BorrowDialog(frame);
                   if(table.getSelectedRow() == -1)
                        JOptionPane.showMessageDialog(frame,"Select the row before loan");
                   else
                        dir.update(newLoan.getLoan());
                        table.repaint();
              if (arg.getSource() == returnObject) {
              if (arg.getSource() == save) {
                   dir.writeFile();
              if (arg.getSource() == load) {
                   Objects[] tempObject = dir.readFile("info.txt");
                   for (int i = 0; tempObject[i] != null; i++)
                             dir.add(tempObject);
              if (arg.getSource() == exit){
                   frame.dispose();
         public static void main(String[] argv) {
              new Database();
    }import java.awt.GridLayout;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.JButton;
    import javax.swing.JDialog;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    import javax.swing.JTextField;
    public class BorrowDialog extends JDialog implements ActionListener {
         private final int WIDTH = 300;
         private final int HEIGHT = 400;
         private JButton exitDialog = new JButton("Exit");
         private JButton saveDialog = new JButton("Save");
         private JTextField loanField = new JTextField();
         private JTextField nameField = new JTextField();
         private JTextField phoneField = new JTextField();
         private JLabel loanLabel = new JLabel("Loan");
         private JLabel nameLabel = new JLabel("Name");
         private JLabel phoneLabel = new JLabel("Phone");
         private JPanel eastPanel = new JPanel();
         private JPanel southPanel = new JPanel();
         private JPanel westPanel = new JPanel();
         private GridLayout layout = new GridLayout(3, 1);
         private Objects loan;
         public BorrowDialog(JFrame parent) {
              super(parent, "Borrow", true);
              southPanel.add(saveDialog);
              southPanel.add(exitDialog);
              westPanel.add(loanLabel);
              eastPanel.add(loanField);
              westPanel.add(nameLabel);
              eastPanel.add(nameField);
              westPanel.add(phoneLabel);
              eastPanel.add(phoneField);
              westPanel.setLayout(layout);
              eastPanel.setLayout(layout);
              add("West", westPanel);
              add("Center", eastPanel);
              add("South", southPanel);
              saveDialog.addActionListener(this);
              exitDialog.addActionListener(this);
              setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
              setResizable(false);
              setSize(WIDTH, HEIGHT);
              getContentPane();
              setVisible(true);
         public Objects getLoan(){
              return loan;
         public void setLoan()
              // Can I really do like this? Will the the specific row I've chosen be overwriten entirly with blank elements in the six columns as I left empty(see below, when I send the arguments into the constructor)?
              loan = new Objects("", "" , "" , "" , "" ,"", loanField.getText(),nameField.getText(), phoneField.getText());
         public void actionPerformed(ActionEvent arg) {
              if (arg.getActionCommand().equals("Save")) {
                   System.out.println("save");
                   setLoan();
                   dispose();
              if (arg.getSource() == exitDialog) {
                   dispose();
    Edited by: iTech34 on Feb 22, 2010 11:19 AM
    Edited by: iTech34 on Feb 22, 2010 11:20 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • How can I update JTable with new Object[][]

    Hallo, I have got a problem. I want to update my Jtable with new Values,
    with
    setValueAt(Object aValue, int row, int column)
    i can only update one Object.
    Is it possible to update All Objects "Object[][]"??? in a whole Table
    after I clicked a Button???

    Hi,
    AbstractTableModel's method setValueAt(Object aValue, int row, int column)
    is not the way to fill values into a table. It is the way the table returns the changed values to you after the user has entered something. This is a very common misconception, probably because the method names are so confusing.
    The table model uses getValueAt (int row , int column)
    to fill in its rows and columns.
    If you extend AbstractTableModel to make this method fill in the correct values from you data array. then, when you wish to update the whole table, you can
    1) Put new values in the data array
    2) fireTableValuesChanged
    this will cause the table model to call getValueAt for every row and column.
    good luck.

  • Problem with an update page.

    I have a problem with an update page on my website
    Here's how it work
    values are defualted in from the advert table  - this works fine
    I should then be able to change the fields and click on the update button
    This works fine but ONLY when the O_year field is populated. 
    There doesn't seem to be anything special about the O_year field
    I thought spry text validation would of been causing the issues, but I removed them and have the same problem.
    For some reason the POST_MMupdate value is not being set to 'form4', which it is doing if O_year is set.
    Please can someone have a look at this, code,
    Also, is there a way of 'stepping through' dreamweaver code to debug it?
    Thanks
    Adam
    $colname_Advert = "-1";
    if (isset($_GET['advert_id'])) {
      $colname_Advert = $_GET['advert_id'];
    mysql_select_db($database_guitarswap_db, $guitarswap_db);
    $query_Advert = sprintf("SELECT * FROM advert WHERE advert_id = %s", GetSQLValueString($colname_Advert, "int"));
    $Advert = mysql_query($query_Advert, $guitarswap_db) or die(mysql_error());
    $row_Advert = mysql_fetch_assoc($Advert);
    $totalRows_Advert = mysql_num_rows($Advert);
    if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form4"))
        //Сheck that we have a file
    if((!empty($_FILES["PictureLocation"])) && ($_FILES['PictureLocation']['error'] == 0))
          //Check if the file is JPEG image and it's size is less than 350Kb
          $filename = basename($_FILES["PictureLocation"]["name"]);
          $ext = substr($filename, strrpos($filename, '.') + 1);
          if (($ext == "jpg") && ($_FILES["PictureLocation"]["type"] == "image/jpeg") &&
        ($_FILES["PictureLocation"]["size"] < 350000))
            //Determine the path to which we want to save this file
              $newname = dirname(__FILE__).'/upload/'.$filename;
              //Check if the file with the same name is already exists on the server
              if (!file_exists($newname))
                //Attempt to move the uploaded file to it's new place
                if ((move_uploaded_file($_FILES['PictureLocation']['tmp_name'],$newname)))
                       // echo "It's done! The file has been saved as: ".$newname;
                else
                       // echo "Error: A problem occurred during file upload!";
            else
                 // echo "Error: File ".$_FILES["PictureLocation"]["name"]." already exists";
          else
             // echo "Error: Only .jpg images under 350Kb are accepted for upload";
        else
         // echo "Error: No file uploaded";
        $filename=$row_Advert['PictureLocation'];
        // set default opentoalloffers
    if (!isset($_POST['checkopentoalloffers']))
        $_POST['checkopentoalloffers'] = 'n';
      $updateSQL = sprintf("UPDATE advert SET PictureLocation=%s, O_Make=%s, O_Model=%s, O_Country=%s, O_Year=%s, O_Colour=%s, O_Body=%s, O_Neck=%s, O_Fingerboard=%s, O_Pickups=%s, `value`=%s, `condition`=%s,  W_Make=%s, W_Model=%s, W_Country=%s, W_Year=%s, W_Colour=%s, W_Body=%s, W_Neck=%s, W_Fingerboard=%s, W_Pickups=%s, Comments=%s, opentoalloffers=%s, ChangeFlg = %s  WHERE advert_id=%s",
                           GetSQLValueString($filename, "text"),
                           GetSQLValueString($_POST['O_Make'], "text"),
                           GetSQLValueString($_POST['O_Model'], "text"),
                           GetSQLValueString($_POST['O_Country'], "text"),
                           GetSQLValueString($_POST['O_Year'], "date"),
                           GetSQLValueString($_POST['O_Colour'], "text"),
                           GetSQLValueString($_POST['O_Body'], "text"),
                           GetSQLValueString($_POST['O_Neck'], "text"),
                           GetSQLValueString($_POST['O_Fingerboard'], "text"),
                           GetSQLValueString($_POST['O_Pickups'], "text"),
                           GetSQLValueString($_POST['value'], "int"),
                           GetSQLValueString($_POST['condition'], "text"),
                           GetSQLValueString($_POST['W_Make'], "text"),
                           GetSQLValueString($_POST['W_Model'], "text"),
                           GetSQLValueString($_POST['W_Country'], "text"),
                           GetSQLValueString($_POST['W_Year'], "date"),
                           GetSQLValueString($_POST['W_Colour'], "text"),
                           GetSQLValueString($_POST['W_Body'], "text"),
                           GetSQLValueString($_POST['W_Neck'], "text"),
                           GetSQLValueString($_POST['W_Fingerboard'], "text"),
                           GetSQLValueString($_POST['W_Pickups'], "text"),
                           GetSQLValueString($_POST['Comments'], "text"),
                           GetSQLValueString($_POST['checkopentoalloffers'], "text"),
                           GetSQLValueString('y', "text"),
                           GetSQLValueString($_POST['advert_id'], "int"));
      mysql_select_db($database_guitarswap_db, $guitarswap_db);
      $Result1 = mysql_query($updateSQL, $guitarswap_db) or die(mysql_error());
        $updateGoTo = "Member2.php";
         if (isset($_SERVER['QUERY_STRING'])) {
           $updateGoTo .= (strpos($updateGoTo, '?')) ? "&" : "?";
           $updateGoTo .= $_SERVER['QUERY_STRING'];
         header(sprintf("Location: %s", $updateGoTo));
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    <link href="Layout3.css" rel="stylesheet" type="text/css" /><!--[if IE 5]>
    <style type="text/css">
    /* place css box model fixes for IE 5* in this conditional comment */
    .twoColFixLtHdr #sidebar1 { width: 230px; }
    </style>
    <![endif]--><!--[if IE]>
    <style type="text/css">
    /* place css fixes for all versions of IE in this conditional comment */
    .twoColFixLtHdr #sidebar1 { padding-top: 30px; }
    .twoColFixLtHdr #mainContent { zoom: 1; }
    /* the above proprietary zoom property gives IE the hasLayout it needs to avoid several bugs */
    </style>
    <![endif]-->
    <script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
    <script src="SpryAssets/SpryValidationTextField.js" type="text/javascript"></script>
    <link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" />
    <link href="SpryAssets/SpryMenuBarVertical.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
    <!--
    body {
        background-color: #FFF;
        margin-left: 20px;
    .twoColFixLtHdr #container #main3 #form1 div fieldset {
        border: thin ridge #CCC;
    -->
    </style>
    <script type="text/javascript">
    <!--
    function MM_goToURL() { //v3.0
      var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
      for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
    //-->
    </script>
    <link href="SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css" />
    </head>
    <body class="twoColFixLtHdr">
    <div id="container">
      <div id="header">
        <div id="Righty">
          <ul id="MenuBar2" class="MenuBarHorizontal">
        <li><a href="index.php">Search</a>      </li>
        <li><a href="Member2.php">Members</a></li>
      </ul>
      <p> </p>
    </div>
    <span id="LoginDiv">
        <?php
          if (isset($_SESSION['MM_Username']))
            echo "hello ". $_SESSION['MM_Username']. "";
            echo " <a href='Logout.php'>Log out</a> ";
        else
            echo "
                <a href='Login.php'>Login</a> / <a href='Register.php'>Register</a>
        ?>
        </a></span>
    <div id="Middle">
      <h1 align="center">GuitarSwap</h1>
    </div>
      </div>
      <div id="sidebar1">
        <h4>Members Area</h4>
        <ul id="MenuBar1" class="MenuBarVertical">
          <li><a href="Member2.php">My Adverts</a></li>
          <li><a href="NewAdvert.php">Create new Advert</a></li>
          <li><a href="UpdateUserDets.php">My Account</a></li>
        </ul>
        <h3>  </h3>
      </div>
      <div id="mainContent">
        <h4>Update Advert</h4>
        <!-- end #mainContent -->
      </div>
      <!-- This clearing element should immediately follow the #mainContent div in order to force the #container div to contain all child floats -->
      <div id="main3">
        <div id="main">
          <fieldset>
            <legend>Please update advert details and confirm</legend>
            <form action="<?php echo $editFormAction; ?>" enctype="multipart/form-data" method="post" name="form4" id="form4">
              <input type="hidden" name="advert_id" value="<?php echo $row_Advert['advert_id']; ?>" />
              <p></p>
              <table width="650" align="center">
                <tr valign="baseline">
                  <td width="17" rowspan="15" valign="middle" nowrap="nowrap"><?php echo "<img src='upload/" .$row_Advert['PictureLocation']."' width='64' height='180'/>" ?></td>
                  <td width="133" align="right" nowrap="nowrap"> </td>
                  <td width="240" align="center" bgcolor="#CCCCCC"><strong>Offered</strong></td>
                  <td width="240" align="center" bgcolor="#CCCCCC"><strong>Wanted</strong></td>
                </tr>
                <tr valign="baseline">
                  <td nowrap="nowrap" align="right"><strong>Make:</strong></td>
                  <td bgcolor="#CCFFCC"><input name="O_Make" type="text" value="<?php echo $row_Advert['O_Make']; ?>" size="30" maxlength="15" /></td>
                  <td bgcolor="#CCFFFF"><input name="W_Make" type="text" value="<?php echo $row_Advert['W_Make']; ?>" size="30" maxlength="15" /></td>
                </tr>
                <tr valign="baseline">
                  <td nowrap="nowrap" align="right"><strong>Model:</strong></td>
                  <td bgcolor="#CCFFCC"><input name="O_Model" type="text" value="<?php echo $row_Advert['O_Model']; ?>" size="30" maxlength="30" /></td>
                  <td bgcolor="#CCFFFF"><input name="W_Model" type="text" value="<?php echo $row_Advert['W_Model']; ?>" size="30" maxlength="30" /></td>
                </tr>
                <tr valign="baseline">
                  <td nowrap="nowrap" align="right"><strong>Country:</strong></td>
                  <td bgcolor="#CCFFCC"><input name="O_Country" type="text" value="<?php echo $row_Advert['O_Country']; ?>" size="30" maxlength="15" /></td>
                  <td bgcolor="#CCFFFF"><input name="W_Country" type="text" value="<?php echo $row_Advert['W_Country']; ?>" size="30" maxlength="15" /></td>
                </tr>
                <tr valign="baseline">
                  <td nowrap="nowrap" align="right"><strong>Year:</strong></td>
                  <td bgcolor="#CCFFCC"><span id="sprytextfield1">
                  <input name="O_Year" type="text" value="<?php echo $row_Advert['O_Year']; ?>" size="4" maxlength="4" />
    <span class="textfieldInvalidFormatMsg">Invalid format.</span><span class="textfieldMinValueMsg">The entered value is less than the minimum required.</span><span class="textfieldMaxValueMsg">The entered value is greater than the maximum allowed.</span></span></td>
                  <td bgcolor="#CCFFFF"><span id="sprytextfield2">
                  <input name="W_Year" type="text" value="<?php echo $row_Advert['W_Year']; ?>" size="4" maxlength="4" />
    <span class="textfieldInvalidFormatMsg">Invalid format.</span><span class="textfieldMinValueMsg">The entered value is less than the minimum required.</span><span class="textfieldMaxValueMsg">The entered value is greater than the maximum allowed.</span></span></td>
                </tr>
                <tr valign="baseline">
                  <td nowrap="nowrap" align="right"><strong>Colour:</strong></td>
                  <td bgcolor="#CCFFCC"><input name="O_Colour" type="text" value="<?php echo $row_Advert['O_Colour']; ?>" size="30" maxlength="15" /></td>
                  <td bgcolor="#CCFFFF"><input name="W_Colour" type="text" value="<?php echo $row_Advert['W_Colour']; ?>" size="30" maxlength="15" /></td>
                </tr>
                <tr valign="baseline">
                  <td nowrap="nowrap" align="right"><strong>Body:</strong></td>
                  <td bgcolor="#CCFFCC"><input name="O_Body" type="text" value="<?php echo $row_Advert['O_Body']; ?>" size="30" maxlength="15" /></td>
                  <td bgcolor="#CCFFFF"><input name="W_Body" type="text" value="<?php echo $row_Advert['W_Body']; ?>" size="30" maxlength="15" /></td>
                </tr>
                <tr valign="baseline">
                  <td nowrap="nowrap" align="right"><strong>Neck:</strong></td>
                  <td bgcolor="#CCFFCC"><input name="O_Neck" type="text" value="<?php echo $row_Advert['O_Neck']; ?>" size="30" maxlength="15" /></td>
                  <td bgcolor="#CCFFFF"><input name="W_Neck" type="text" value="<?php echo $row_Advert['W_Neck']; ?>" size="30" maxlength="15" /></td>
                </tr>
                <tr valign="baseline">
                  <td nowrap="nowrap" align="right"><strong>Fingerboard:</strong></td>
                  <td bgcolor="#CCFFCC"><input name="O_Fingerboard" type="text" value="<?php echo $row_Advert['O_Fingerboard']; ?>" size="30" maxlength="15" /></td>
                  <td bgcolor="#CCFFFF"><input name="W_Fingerboard" type="text" value="<?php echo $row_Advert['W_Fingerboard']; ?>" size="30" maxlength="15" /></td>
                </tr>
                <tr valign="baseline">
                  <td nowrap="nowrap" align="right"><strong>Pickups:</strong></td>
                  <td bgcolor="#CCFFCC"><input name="O_Pickups" type="text" value="<?php echo $row_Advert['O_Pickups']; ?>" size="30" maxlength="15" /></td>
                  <td bgcolor="#CCFFFF"><input name="W_Pickups" type="text" value="<?php echo $row_Advert['W_Pickups']; ?>" size="30" maxlength="15" /></td>
                </tr>
                <tr valign="baseline">
                  <td nowrap="nowrap" align="right"><strong>Condition:</strong></td>
                  <td bgcolor="#CCFFCC"><label for="condition">
                    <select name="condition" size="1" id="condition">
                      <option selected="selected" value="" <?php if (!(strcmp("", $row_Advert['condition']))) {echo "selected=\"selected\"";} ?>>---select---</option>
                      <option value="immaculate" <?php if (!(strcmp("immaculate", $row_Advert['condition']))) {echo "selected=\"selected\"";} ?>>immaculate</option>
                      <option value="excellent" <?php if (!(strcmp("excellent", $row_Advert['condition']))) {echo "selected=\"selected\"";} ?>>excellent</option>
                      <option value="good" <?php if (!(strcmp("good", $row_Advert['condition']))) {echo "selected=\"selected\"";} ?>>good</option>
                      <option value="well used" <?php if (!(strcmp("well used", $row_Advert['condition']))) {echo "selected=\"selected\"";} ?>>well used</option>
                      <option value="poor" <?php if (!(strcmp("poor", $row_Advert['condition']))) {echo "selected=\"selected\"";} ?>>poor</option>
                  </select>
                  </label></td>
                  <td bgcolor="#FFFFFF"> </td>
                </tr>
                <tr valign="baseline">
                  <td nowrap="nowrap" align="right"><strong>Value:</strong></td>
                  <td bgcolor="#CCFFCC"><span id="sprytextfield3">
                  <input name="value" type="text" value="<?php echo $row_Advert['value']; ?>" size="11" maxlength="11" />
    <span class="textfieldInvalidFormatMsg">Invalid format.</span></span></td>
                  <td bgcolor="#FFFFFF"> </td>
                </tr>
                <tr valign="baseline">
                  <td align="right" valign="top" nowrap="nowrap"><strong>Comments:</strong></td>
                  <td bgcolor="#CCFFCC"><textarea name="Comments" cols="25" rows="3"><?php echo $row_Advert['Comments']; ?></textarea></td>
                  <td bgcolor="#FFFFFF"> </td>
                </tr>
                <tr valign="baseline">
                  <td nowrap="nowrap" align="right"><strong>Picture location</strong></td>
                  <td bgcolor="#CCFFCC"><label for="checkopentoalloffers"></label>                <input type="file" name="PictureLocation" value="<?php echo $row_Advert['PictureLocation']; ?>" size="20" /></td>
                  <td bgcolor="#FFFFFF"> </td>
                </tr>
                <tr valign="baseline">
                  <td height="26" align="right" nowrap="nowrap"><strong>Open to all offers:</strong></td>
                  <td bgcolor="#CCFFCC"><input name="checkopentoalloffers" type="checkbox" id="checkopentoalloffers" value="y" <?php if (!(strcmp($row_Advert['opentoalloffers'],"y"))) {echo "checked=\"checked\"";} ?> /></td>
                  <td bgcolor="#FFFFFF"> </td>
                </tr>
              </table>
              <p> </p>
              <div id="submitdiv">
                <input type="hidden" name="MM_update" value="form4" />
                <input name="submit button" type="submit" id="submit button" value="Update Advert" />
              </div>
              <div id="exitdiv">
                <label for="button15"></label>
                <input name="button" type="button" id="button15" onclick="MM_goToURL('parent','Member2.php');return document.MM_returnValue" value="Exit" />
                <label for="button16"></label>
              </div>
              <p> </p>
            </form>
          </fieldset>
          <script type="text/javascript">
    var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1", "integer", {validateOn:["blur"], minValue:1900, maxValue:2010, isRequired:false});
    var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1", "integer", {validateOn:["blur"], minValue:1900, maxValue:2010});
    var sprytextfield2 = new Spry.Widget.ValidationTextField("sprytextfield2", "integer", {minValue:1900, maxValue:2010, validateOn:["blur"], isRequired:false});
    var sprytextfield3 = new Spry.Widget.ValidationTextField("sprytextfield3", "currency", {validateOn:["blur"], isRequired:false});
          </script>
          <br class="clearfloat" />
      <!-- end #container -->
    </div></div></div>
    <script type="text/javascript">
    <!--
    var  = new Spry.Widget.MenuBar("", {imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});
    var MenuBar2 = new Spry.Widget.MenuBar("MenuBar2", {imgDown:"../SpryAssets/SpryMenuBarDownHover.gif", imgRight:"../SpryAssets/SpryMenuBarRightHover.gif"});
    var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});
    //-->
    </script>
    </body>
    </html>
    <?php
    mysql_free_result($Advert);
    if (is_resource($Result1)) mysql_free_result($Result1);
    ?>

    Please note,
    Removing I investigated spry a little more, in the end I settled for removing spry altogether,
    Maybe it was because the text field in a $GET (for the default) AND a $PUT (for the update)

  • ?I am getting an error when installing on my dell inspiron with latest updates for drivers.  Error 1406.  I have the problem with Scan Snap software and a full version of reader.

    ?I am getting an error when installing on my dell inspiron with latest updates for drivers.  Error 1406.  I have the problem with Scan Snap software and a full version of reader.

    Error 1402 | Error 1406 | Acrobat, Reader

  • Problems with System Update 3.14.0019 after installation SP2

    Have you encountered problems with System Update 3.14.0019 after installation SP2 for Windows Vista?
     After this upgrade I view  this error: "An error occurred while gathering user information."
    Thanks for the help

    A known issue.  It wasn't supposed to be supported until SP2 is RTM.  However, look at the stickied post in the forum for some bad news about SU.
    x61s

  • Problems with Jrun4 updater 6

    A little background to begin. I recommended Jrun to one of
    our clients, a large Jewish university in New York. The reason I
    recommended it was that Jrun has an easy to use utility to setup a
    connector with IIS, wheras other solutions like Tomcat make that
    difficult.
    All we are asking Jrun to do is run a single relatively
    simply Proxy Servlet. In production, we had a lot of problems,
    which at first appeared sort of random several times a day, problem
    being our whole application came to a screaching halt. Our product
    is used by hundreds of fortune 500 companies, and it is a rock
    solid product with 15 years behind it.
    It took us several days to figure out that Jrun was the
    bottle neck, and that Jrun could not handle much more than a couple
    people trying to login at roughly the same time.
    I tried running the Jrun updater 6, which would not run,
    despite following all the instructions in detail, shutting down
    every possibly related service, and running PortQryV2 to be sure
    nothing was running that could interfere. Nothing I could do would
    make the updater run, and worse than that it messed up our original
    installation and can not be rolled back. Apparently it makes some
    environment variable changes, or registry changes, and restoring
    those folders it changes doesn't help much. The error running the
    updater says to make sure the Jrun server is not running, which it
    is not. So, this updater code is very poorly written because it
    can't be rolled back, and it can't tell you what the real problem
    is inorder to get it working.
    Any help would be appreciated.

    The problem with running the Updater was a conflict with an
    Anti Virus program. There should be some instructions included with
    Jrun Updater saying this is a problem, or a specific error message
    when the updater runs indicating this could be a problem, rather
    than the incorrect error saying a Jrun server might be running when
    a Jrun server obviously was not running.
    Hopefully this post will save someone else the frustration.
    Sincerely,
    Joe Paladin

  • Problems with FlashPlayer Update.

    Problems with FlashPlayer Update.
    after download, install begins, but when the progress bar ends a typical Windows error message displays showing :
    (literal translate from spanish):
    " is not found the enter point of procedure SetDIIDirectoryW into the dinamic Links Library KERNELL32.dll "
    ihave:  windows32, XP +  FlashPlayer Ver: 11.1.102.55 + MozilaFirefox10.0
    flash works ok, but i can't complete a new update since  Version: 11.1.102.55
    please help me, Thanks

    Microsoft Windows XP Professional    Version    5.1.2600  Compilacion 2600
    (looks like old windows98 / 2000 style but it's XP (i choose the old look in display preferences)
    i think it's Service Pack 1  beacause there were problems with SP2 updates with some programs, so this version works Ok with all my software... until now.  i Know there's a SP3 and it is an obsolate OS but i like it and works well in this PC.
    Do you think that it's the problem?  i must install SP3?

  • On iOS 8.3 using 'Keynote for iPad' the app freezes repeatedly (since the last update of April 21st) while editing slides. 30 sec. later comes alive again, then freezes again after a few editing actions. Anyone with the same problem?

    On iOS 8.3 using 'Keynote for iPad' the app freezes repeatedly (since the last update of April 21st) while editing slides. 30 sec. later comes alive again, then freezes again after a few editing actions. Anyone with the same problem?  I tried everything 'app support' tells me except deleting and reinstalling the App because I have a lot of files that I'd lose.  Recommendations anyone?  [email protected]

    On iOS 8.3 using 'Keynote for iPad' the app freezes repeatedly (since the last update of April 21st) while editing slides. 30 sec. later comes alive again, then freezes again after a few editing actions. Anyone with the same problem?  I tried everything 'app support' tells me except deleting and reinstalling the App because I have a lot of files that I'd lose.  Recommendations anyone?  [email protected]

  • Cursor with for update clause problem

    Hi all,
    We are having this problem with Oracle 8.1.7 where in we have a cursor with for update clause. The PL/SQL script used to work fine with Oracle 8.0.5 but is causing problems with Oracle 8.1.7. What the script is ending up doing in 8.1.7 is that it updates only one record instead of updating close to 60000 which it used to do in Oracle 8.0.5
    The script just hangs after updating one record. We have replicated the same problem.
    Has anyone seen this error before and attained resolution?
    Thanks

    Hello ,
    I have found the same / very close to the same problem. I tried the code below in Oracle 10.2.0.1 and got the following error after the first loop.
    ORA-01002: fetch out of sequence
    ORA-06512: at "DEMO_TEST_RESEARCH_PKG", line 18
    ORA-06512: at line 7
    After trying to debug it , i thought i would try it in Oracle 9.0.2.0.7.0 , and to my suprise it worked fine.
    Am i missing something ? Thanks in advance , ...
    I have included the code i was running ...
    PROCEDURE WhereCurrentOf(Param1 IN NUMBER) IS
    v_title_eng ISSUES.TITLE_ENG%TYPE;
    v_issue_id ISSUES.ISSUE_ID%TYPE;
    CURSOR issues_cur
    IS
    SELECT issue_id,title_eng
    FROM issues
    WHERE title_eng IS NULL
    FOR UPDATE OF title_eng;
    BEGIN
    FOR i IN issues_cur
    LOOP
    FETCH issues_cur INTO v_issue_id,v_title_eng;
    EXIT WHEN issues_cur%NOTFOUND;
    DBMS_OUTPUT.PUT_LINE(v_issue_id||' This was the english title before : '||v_title_eng);
    v_title_eng := 'This is my title';
    UPDATE issues
    SET title_eng = v_title_eng
    WHERE CURRENT OF issues_cur;
    DBMS_OUTPUT.PUT_LINE(v_issue_id||' This is the english title after : '||v_title_eng);
    END LOOP;
    END WhereCurrentOf;

Maybe you are looking for

  • I want to display the message in jsp .

    I display the data retrieve from the database.if the data base have no record,i want to display a message to user.I write only one jsp. i used the JOptionPane,first time it takes more time to execute, after it execute normally,i am not satisfy for th

  • Satellite L855-14G - Devices are not detected in device manager

    I've reinstalled my Satellite L855/L855D (installed windows 7 instead of win 8) . And there is a problem : many devices are not found , like ethernet / wireless. Video card Radeon HD 7670M also not found. I can't install drivers, the errors apears th

  • Return from a PHP Script

    Hi, I'm trying to get PHP and Flex to work with one another. I know that my program is getting the result, because if I change the XML to be invalid, my program will throw an error that says just that. However... I can't use the data that I am gettin

  • Blur a portion of a picture

    Is it possible to blur a portion of a picture through Aperature? Thanks for your help! dwatt

  • Change the Description of Purchasing Organization

    Hi Frenz,   Could some body guide me how to change the description for the Purchasing organization? Saurabh