To update the JComboBox selection

Hi,
I have JTable and JComboBox on a Frame. I got data into table and combo box from database. Now I want to change the combo box value depending on a JTable's row selection. I'm calling jComboBox1.getSelectedItem() , but there's changes in the JComboBox .
Please help, if you know how

I mean I just want to know how can I request the selection of the combo box

Similar Messages

  • Need image to update with JComboBox selection

    hello, i have code here that loads an image from a JFileChooser dialog when "Add Image" is clicked, the images name and path is stored in a JComboBox, and the image name is displayed. As more images are added to the JComboBox, I would like to be able to have the picture displayed in concurrence with whatever image is selected from the comboBox. For instance, if Jessica.jpg is selected in the JComboBox, i need Jessica.jpg to be loaded into imagePanel. Here is the code. The problem lies within the JComboBox's "itemStateChanged" I believe... This is what must be used (i think) to update the pictures in the imagePanel when the combobox is manipulated....
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    import java.util.*;
    import java.io.*;
    import javax.swing.border.*;
    import java.awt.image.BufferedImage;
    public class MyDialog extends JDialog implements ActionListener, WindowListener, ItemListener
         ReminderClass dataRec;
         ReminderClass originalDataRec;
         Image im;
         MediaTracker mt;
         Toolkit tk;
         JFileChooser imageDialog;
         File f;
         String[] comboBoxList;
         String fileName;
         String filePathName;
         DataManager dataManager;
         JPanel mainPanel1;
         JPanel mainPanel2;
         JPanel mainPanel3;
         JPanel buttonPanel;
         JPanel radioPanel;
         MyImageJPanel imagePanel;
         JScrollPane scrollPane1;
         JScrollPane scrollPane2;
         JRadioButton pendingButton;
         JRadioButton documentationButton;
         JRadioButton completedButton;
         JRadioButton failedButton;
         JRadioButton cancelledButton;
         ButtonGroup radioGroup;
         JComboBox imageComboBox;
         JComboBox category;
         JTextArea description;
         JTextArea message;
         JLabel descriptionLabel;
         JLabel messageLabel;
         JLabel fileNameLabel;
         JLabel categoryLabel;
         JLabel selectedFile;
         GregorianCalendar dueDateTime;
         GregorianCalendar reminderInterval;
         GregorianCalendar terminatedDateTime;
         JButton saveCont;
         JButton cancel;
         JButton addImage;
         JButton saveExit;
         JLabel dueDate;
         JLabel intervalDate;
         JLabel terminatedDate;
         JTextField dueDateField;
         JTextField intervalDateField;
         JTextField terminatedDateField;
         int choice;
         int newIndex;
         public MyDialog(DataManager aDataManager)
         {//add new Reminder to list d-box
              Container cp;
              dataManager = aDataManager;
              dataRec = new ReminderClass();
              imageComboBox = new JComboBox();
              imagePanel = new MyImageJPanel();
              imagePanel.setPreferredSize(new Dimension(40, 40));
              imageComboBox.addItemListener(this);
              mainPanel1 = new JPanel(new BorderLayout());
              mainPanel2 = new JPanel(new BorderLayout());
              mainPanel3 = new JPanel(new GridLayout(7,2));
              radioPanel = new JPanel(new GridLayout(5,1));
              buttonPanel = new JPanel(new FlowLayout());
              saveCont = new JButton ("Save & Continue");
              saveExit = new JButton ("Save & Exit");
              addImage = new JButton ("Add Image(s)");
              cancel = new JButton ("Cancel");
              description = new JTextArea("         ");
              description.setBorder(BorderFactory.createLineBorder(Color.black));
              scrollPane1 = new JScrollPane(description);
              message = new JTextArea("          ");
              scrollPane2 = new JScrollPane(message);
              comboBoxList = CategoryConversion.categories;
              category = new JComboBox(comboBoxList);
              category.setSelectedIndex(0);
              message.setBorder(BorderFactory.createLineBorder(Color.black));
              scrollPane2 = new JScrollPane(message);
              descriptionLabel = new JLabel("Description: ");
              messageLabel = new JLabel("Message: ");
              selectedFile = new JLabel("Selected File(s): ");
              fileNameLabel = new JLabel();
              categoryLabel = new JLabel("Category: ");
              dueDate = new JLabel("Due date: ");
              intervalDate = new JLabel ("Interval date: ");
              terminatedDate = new JLabel ("Terminated date: ");
              dueDateField = new JTextField("   ");
              intervalDateField = new JTextField("   ");
              terminatedDateField = new JTextField("   ");
              pendingButton = new JRadioButton("Pending?");
              documentationButton = new JRadioButton("Documentation?");
              completedButton = new JRadioButton("Completed?");
              failedButton = new JRadioButton("Failed?");
              cancelledButton = new JRadioButton("Cancelled?");
              radioGroup = new ButtonGroup();
              radioGroup.add(pendingButton);
              radioGroup.add(documentationButton);
              radioGroup.add(completedButton);
              radioGroup.add(failedButton);
              radioGroup.add(cancelledButton);
              radioPanel.add(pendingButton);
              radioPanel.add(documentationButton);
              radioPanel.add(completedButton);
              radioPanel.add(failedButton);
              radioPanel.add(cancelledButton);
              pendingButton.addActionListener(this);
              pendingButton.setActionCommand("PENDING");
              documentationButton.addActionListener(this);
              documentationButton.setActionCommand("DOCUMENTATION");
              completedButton.addActionListener(this);
              completedButton.setActionCommand("COMPLETED");
              failedButton.addActionListener(this);
              failedButton.setActionCommand("FAILED");
              cancelledButton.addActionListener(this);
              cancelledButton.setActionCommand("CANCELLED");
              add(mainPanel1);
              mainPanel1.add(mainPanel2, BorderLayout.CENTER);
              mainPanel3.add(descriptionLabel);
              mainPanel3.add(scrollPane1);
              mainPanel3.add(messageLabel);
              mainPanel3.add(scrollPane2);
              mainPanel3.add(selectedFile);
              mainPanel3.add(imageComboBox);
              mainPanel3.add(categoryLabel);
              mainPanel3.add(category);
              mainPanel3.add(dueDate);
              mainPanel3.add(dueDateField);
              mainPanel3.add(intervalDate);
              mainPanel3.add(intervalDateField);
              mainPanel3.add(terminatedDate);
              mainPanel3.add(terminatedDateField);
              mainPanel2.add(radioPanel, BorderLayout.EAST);
              mainPanel2.add(mainPanel3, BorderLayout.WEST);
              buttonPanel.add(addImage);
              buttonPanel.add(saveCont);
              buttonPanel.add(saveExit);
              buttonPanel.add(cancel);
              mainPanel1.add(buttonPanel, BorderLayout.SOUTH);
              mainPanel2.add(imagePanel, BorderLayout.CENTER);
              saveCont.setActionCommand("SAVECONT");
              saveCont.addActionListener(this);
              saveExit.setActionCommand("SAVEEXIT");
              saveExit.addActionListener(this);
              cancel.setActionCommand("CANCEL");
              cancel.addActionListener(this);
              addImage.setActionCommand("ADDIMAGE");
              addImage.addActionListener(this);
              category.addItemListener(this);
              addWindowListener(this);
              description.setInputVerifier(new MyTextAreaVerifier(dataRec, ReminderClass.DESCRIPTION_FIELD));
              message.setInputVerifier(new MyTextAreaVerifier(dataRec, ReminderClass.MESSAGE_FIELD));
              //dueDateField.setInputVerifier(new MyDateAreaVerifier(dataRec, ReminderClass.DUE_DATE_TIME_FIELD));
              //intervalDateField.setInputVerifier(new MyDateAreaVerifier(dataRec, ReminderClass.REMINDER_INTERVAL_FIELD));
              //terminatedDateField.setInputVerifier(new MyDateAreaVerifier(dataRec, ReminderClass.TERMINATED_DATE_TIME_FIELD));
              cp = getContentPane();
              cp.add(mainPanel1);     
              originalDataRec = (ReminderClass)dataRec.clone();
              setupMainFrameAdd();
         public MyDialog(int index, DataManager aDataManager, ReminderClass newDataRec)
         {//edit an existing reminder dialog
              Container cp;
              dataManager = aDataManager;
              index = newIndex;
              dataRec = newDataRec;
              imageComboBox = new JComboBox();
              imagePanel = new MyImageJPanel();
              imagePanel.setPreferredSize(new Dimension(40, 40));
              imageComboBox.addItemListener(this);
              mainPanel1 = new JPanel(new BorderLayout());
              mainPanel2 = new JPanel(new BorderLayout());
              mainPanel3 = new JPanel(new GridLayout(7,2));
              radioPanel = new JPanel(new GridLayout(5,1));
              buttonPanel = new JPanel(new FlowLayout());
              saveCont = new JButton ("Save & Continue");
              saveExit = new JButton ("Save & Exit");
              addImage = new JButton ("Add Image(s)");
              cancel = new JButton ("Cancel");
              description = new JTextArea("         ");
              description.setBorder(BorderFactory.createLineBorder(Color.black));
              scrollPane1 = new JScrollPane(description);
              message = new JTextArea("          ");
              scrollPane2 = new JScrollPane(message);
              comboBoxList = CategoryConversion.categories;
              category = new JComboBox(comboBoxList);
              category.setSelectedIndex(0);
              dataRec.populateComboBox(imageComboBox);
              message.setBorder(BorderFactory.createLineBorder(Color.black));
              scrollPane2 = new JScrollPane(message);
              descriptionLabel = new JLabel("Description: ");
              messageLabel = new JLabel("Message: ");
              selectedFile = new JLabel("Selected File(s): ");
              fileNameLabel = new JLabel();
              categoryLabel = new JLabel("Category: ");
              dueDate = new JLabel("Due date: ");
              intervalDate = new JLabel ("Interval date: ");
              terminatedDate = new JLabel ("Terminated date: ");
              dueDateField = new JTextField("   ");
              intervalDateField = new JTextField("   ");
              terminatedDateField = new JTextField("   ");
              pendingButton = new JRadioButton("Pending?");
              documentationButton = new JRadioButton("Documentation?");
              completedButton = new JRadioButton("Completed?");
              failedButton = new JRadioButton("Failed?");
              cancelledButton = new JRadioButton("Cancelled?");
              radioGroup = new ButtonGroup();
              radioGroup.add(pendingButton);
              radioGroup.add(documentationButton);
              radioGroup.add(completedButton);
              radioGroup.add(failedButton);
              radioGroup.add(cancelledButton);
              radioPanel.add(pendingButton);
              radioPanel.add(documentationButton);
              radioPanel.add(completedButton);
              radioPanel.add(failedButton);
              radioPanel.add(cancelledButton);
              pendingButton.addActionListener(this);
              pendingButton.setActionCommand("PENDING");
              documentationButton.addActionListener(this);
              documentationButton.setActionCommand("DOCUMENTATION");
              completedButton.addActionListener(this);
              completedButton.setActionCommand("COMPLETED");
              failedButton.addActionListener(this);
              failedButton.setActionCommand("FAILED");
              cancelledButton.addActionListener(this);
              cancelledButton.setActionCommand("CANCELLED");
              add(mainPanel1);
              mainPanel1.add(mainPanel2, BorderLayout.CENTER);
              mainPanel3.add(descriptionLabel);
              mainPanel3.add(scrollPane1);
              mainPanel3.add(messageLabel);
              mainPanel3.add(scrollPane2);
              mainPanel3.add(selectedFile);
              mainPanel3.add(imageComboBox);
              mainPanel3.add(categoryLabel);
              mainPanel3.add(category);
              mainPanel3.add(dueDate);
              mainPanel3.add(dueDateField);
              mainPanel3.add(intervalDate);
              mainPanel3.add(intervalDateField);
              mainPanel3.add(terminatedDate);
              mainPanel3.add(terminatedDateField);
              mainPanel2.add(radioPanel, BorderLayout.EAST);
              mainPanel2.add(mainPanel3, BorderLayout.WEST);
              buttonPanel.add(addImage);
              buttonPanel.add(saveCont);
              buttonPanel.add(saveExit);
              buttonPanel.add(cancel);
              mainPanel1.add(buttonPanel, BorderLayout.SOUTH);
              mainPanel2.add(imagePanel, BorderLayout.CENTER);
              fillInData(dataRec);
              saveCont.setActionCommand("SAVECONT2");
              saveCont.addActionListener(this);
              saveExit.setActionCommand("SAVEEXIT2");
              saveExit.addActionListener(this);
              cancel.setActionCommand("CANCEL2");
              cancel.addActionListener(this);
              addImage.setActionCommand("ADDIMAGE");
              addImage.addActionListener(this);
              category.addItemListener(this);
              addWindowListener(this);
              description.setInputVerifier(new MyTextAreaVerifier(dataRec, ReminderClass.DESCRIPTION_FIELD));
              message.setInputVerifier(new MyTextAreaVerifier(dataRec, ReminderClass.MESSAGE_FIELD));
              //dueDateField.setInputVerifier(new MyDateAreaVerifier(dataRec, ReminderClass.DUE_DATE_TIME_FIELD));
              //intervalDateField.setInputVerifier(new MyDateAreaVerifier(dataRec, ReminderClass.REMINDER_INTERVAL_FIELD));
              //terminatedDateField.setInputVerifier(new MyDateAreaVerifier(dataRec, ReminderClass.TERMINATED_DATE_TIME_FIELD));
              cp = getContentPane();
              cp.add(mainPanel1);     
              originalDataRec = (ReminderClass)dataRec.clone();
              setupMainFrameEdit();
         void setupMainFrameAdd()
              tk = Toolkit.getDefaultToolkit();
              Dimension d = tk.getScreenSize();
              setSize(d.width/3, d.height/4);
              setLocation(d.width/3, d.height/3);
              setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              setTitle("Reminder Add New");
              setVisible(true);
         }//end of setupMainFrame
         void setupMainFrameEdit()
              tk = Toolkit.getDefaultToolkit();
              Dimension d = tk.getScreenSize();
              setSize(d.width/3, d.height/4);
              setLocation(d.width/3, d.height/3);
              setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              setTitle("Edit Existing Reminder");
              setVisible(true);
         public void actionPerformed(ActionEvent e)
              JOptionPane optionPane;
              String temp = new String();
              if (e.getActionCommand().equals("CANCEL"))
                   if(dataRec.compareTo(originalDataRec) != 0)
                        choice = JOptionPane.showConfirmDialog(this, "Are you sure you wish to exit without first saving data?","Are you sure you wish to\n" + "exit without first saving data?", JOptionPane.YES_NO_OPTION);
                        if(choice == JOptionPane.YES_OPTION)
                             dispose();
                        else
                             for (int n = 0; n<imageComboBox.getItemCount(); n++)
                                  dataRec.addImageToArray((String)imageComboBox.getItemAt(n));
                             dataRec.setCategory(category.getSelectedIndex());
                             dataManager.add(dataRec);
                             fillInData(dataRec);
                             dispose();
                   else
                        dispose();
              else if (e.getActionCommand().equals("CANCEL2"))
                   if (dataRec.compareTo(originalDataRec) != 0)
                        choice = JOptionPane.showConfirmDialog(this, "Are you sure you wish to\n" + "exit without first saving data?");
                        if (choice == JOptionPane.YES_OPTION)
                             dispose();
                        else
                             this.dispose();
              else if (e.getActionCommand().equals("ADDIMAGE"))
                   filePathName = new String();
                   fileName = new String();
                   imageDialog = new JFileChooser();
                   imageDialog.showOpenDialog(this);
                   f = imageDialog.getSelectedFile();
                   tk = Toolkit.getDefaultToolkit();
                   fileName = f.getName();
                   filePathName = f.getPath();
                   im = tk.getImage(filePathName);
                   try
                        mt = new MediaTracker(this);
                        mt.addImage(im, 432);
                        mt.waitForAll();
                   catch(InterruptedException ie)
                        ie.getStackTrace();
                   imageComboBox.addItem(fileName);
                   dataRec.setImageFileName(fileName);
                   imageComboBox.setSelectedItem(fileName);
                   imagePanel.refreshImage(im , 50, 50);
              else if (e.getActionCommand().equals("SAVECONT"))
                   for (int n = 0; n<imageComboBox.getItemCount(); n++)
                        dataRec.addImageToArray((String)imageComboBox.getItemAt(n));
                   temp = dueDateField.getText();
                   fileNameLabel.setText("");
                  dataRec.setCategory(category.getSelectedIndex());
                   dataManager.add((ReminderClass)(dataRec.clone()));
                   dataRec.clearFields();
                   fillInData(dataRec);     
              else if (e.getActionCommand().equals("SAVECONT2"))
                   fileNameLabel.setText("");
                  dataRec.setCategory(category.getSelectedIndex());
                   dataManager.replace(newIndex,(ReminderClass)(dataRec.clone()));
                   dataRec.clearFields();
                   fillInData(dataRec);
              else if (e.getActionCommand().equals("SAVEEXIT"))
                   for (int n = 0; n<imageComboBox.getItemCount(); n++)
                        dataRec.addImageToArray((String)imageComboBox.getItemAt(n));
                   dataRec.setCategory(category.getSelectedIndex());
                   dataManager.add(dataRec);
                   fillInData(dataRec);
                   dispose();
                   //save new data to list, and exit back to main prog.
              else if (e.getActionCommand().equals("SAVEEXIT2"))
                   for (int n = 0; n<imageComboBox.getItemCount(); n++)
                        dataRec.addImageToArray((String)imageComboBox.getItemAt(n));
                   dataRec.setCategory(category.getSelectedIndex());
                   dataManager.replace(newIndex, (ReminderClass)(dataRec.clone()));
                   fillInData(dataRec);
                   dispose();
              else if (e.getActionCommand().equals("PENDING"))
                   dataRec.setStatus("Pending");
              else if (e.getActionCommand().equals("DOCUMENTATION"))
                   dataRec.setStatus("Documentation");
              else if (e.getActionCommand().equals("COMPLETED"))
                   dataRec.setStatus("Completed");
              else if (e.getActionCommand().equals("FAILED"))
                   dataRec.setStatus("Failed");
              else if (e.getActionCommand().equals("CANCELLED"))
                   dataRec.setStatus("Cancelled");
         public void itemStateChanged(ItemEvent e)
               JComboBox cb = (JComboBox)e.getSource();
               int categorySelection;
               if(cb == category)
                 categorySelection = cb.getSelectedIndex();
               if (cb == imageComboBox)
                       tk = Toolkit.getDefaultToolkit();
                        fileName = dataRec.getImageFileName();
                        filePathName = f.getPath();
                        im = tk.getImage(filePathName);
                        try
                             mt = new MediaTracker(this);
                             mt.waitForAll();
                             mt.addImage(im, 432);
                             imagePanel.refreshImage(im , 50, 50);
                        catch(InterruptedException ie)
                        ie.getStackTrace();
         public void fillInData(ReminderClass d)
              fileNameLabel.setText(d.getImageFileName());
              description.setText(d.getDescription());
              message.setText(d.getMessage());
              category.setSelectedIndex(d.getCategory());
         public void windowOpened(WindowEvent e)
              //no action to take
         public void windowClosing(WindowEvent e)
              JOptionPane j = new JOptionPane("Are you sure you wish to exit \n" + "without saving data first?", JOptionPane.QUESTION_MESSAGE, JOptionPane.YES_NO_OPTION);;
         public void windowClosed(WindowEvent e)
    //          no action to take
         public void windowIconified(WindowEvent e)
    //          no action to take
         public void windowDeiconified(WindowEvent e)
    //          no action to take
         public void windowActivated(WindowEvent e)
    //          no action to take
         public void windowDeactivated(WindowEvent e)
    //          no action to take
    }Here is the main "ReminderClass" with all methods and accessors/mutators....
    import java.util.*;
    import java.awt.*;
    import java.io.*;
    import javax.swing.*;
    //search for Java Thumb Wheel under Google.
    public class ReminderClass extends Object implements Cloneable, Comparable
          private int category;
          private String description;
          private String message;
          private GregorianCalendar dueDateTime;
         private GregorianCalendar reminderInterval;
          private GregorianCalendar terminatedDateTime;
          private int displayStyle;
          private int compareKey;
          private String status;
          String[] imagePathArray;
          String[] imageArray;
          String imageFileName;
          int numImages;
          public final static int CATEGORY_FIELD = 1;
          public final static int DESCRIPTION_FIELD = 2;
          public final static int MESSAGE_FIELD = 3;
          public final static int DUE_DATE_TIME_FIELD = 4;
          public final static int REMINDER_INTERVAL_FIELD =5;
          public final static int TERMINATED_DATE_TIME_FIELD = 6;
          public final static int DISPLAY_STYLE_FIELD = 7;
          public final static int COMPARE_KEY_FIELD = 8;
          public final static int STATUS_FIELD = 9;
          static boolean showDescription = false;
          static boolean showDate = false;
          static boolean showCategory = false;
          static boolean showMessage = false;
          static boolean showDueDateTime = false;
          static boolean showReminderInterval = false;
          static boolean showTerminatedDateTime = false;
          static boolean showImageName = false;
          static boolean showStatus = false;
          //******************REMINDER CLASS DEFAULT CONSTRUCTOR***************
          ReminderClass()
               numImages = 0;
               imageArray = new String[20];
               imagePathArray = new String[20];
               imageFileName = "";
               category = -1;
               description = "";
               message = "";
               dueDateTime = new GregorianCalendar();
               reminderInterval = new GregorianCalendar();
               terminatedDateTime = new GregorianCalendar();
               displayStyle = -1;
               compareKey = -1;
         //     *****************REMINDER CLASS INITIALIZER CONSTRUCTOR*************
          ReminderClass(int initCategory, String initDescription, GregorianCalendar initDueDateTime, String[] initImagePathArray, String[] initImageArray, String initImageFileName,
                    GregorianCalendar initReminderInterval, GregorianCalendar initTerminatedDateTime, String initMessage, String initStatus,
                     int initCompareKey, int initDisplayStyle)
               imagePathArray = new String[20];
               imageArray = new String[20];
               for (int n = 0; n<initImageArray.length; n++)
                    imageArray[n] = initImageArray[n];
               for (int n = 0; n<initImagePathArray.length; n++)
                    imagePathArray[n] = initImagePathArray[n];
                    imageFileName = initImageFileName;
                     category = initCategory;
                     description = initDescription;
                     dueDateTime = (GregorianCalendar)initDueDateTime.clone();
                     reminderInterval = (GregorianCalendar)initReminderInterval.clone();
                     terminatedDateTime = (GregorianCalendar)initTerminatedDateTime.clone();
                     message = initMessage;
                     status = initStatus;
                     compareKey = initCompareKey;
                     displayStyle = initDisplayStyle;
               //*********************LOAD DATA FROM FILE WITH CONSTRUCTOR*****************************
            public ReminderClass(DataInputStream dataInStream) throws IOException
                           imageFileName = dataInStream.readUTF();
                       category = dataInStream.readInt();
                       description = dataInStream.readUTF();
                       message = dataInStream.readUTF();
                       dueDateTime = new GregorianCalendar(dataInStream.readInt(), dataInStream.readInt(), dataInStream.readInt(), dataInStream.readInt(), dataInStream.readInt(), dataInStream.readInt());
                       reminderInterval = new GregorianCalendar(dataInStream.readInt(), dataInStream.readInt(), dataInStream.readInt(), dataInStream.readInt(), dataInStream.readInt(), dataInStream.readInt()); 
                       terminatedDateTime = new GregorianCalendar(dataInStream.readInt(), dataInStream.readInt(), dataInStream.readInt(), dataInStream.readInt(), dataInStream.readInt(), dataInStream.readInt());
                       displayStyle = dataInStream.readInt();
                       compareKey = dataInStream.readInt();
                       status = dataInStream.readUTF();
             //********************SAVE DATA TO FILE***************************
             public void write(DataOutputStream dataOutStream) throws IOException
                       dataOutStream.writeUTF(imageFileName);
                       dataOutStream.writeInt(category);
                       dataOutStream.writeUTF(description);
                       dataOutStream.writeUTF(message);
                       dataOutStream.writeInt(dueDateTime.get(Calendar.YEAR));
                       dataOutStream.writeInt(dueDateTime.get(Calendar.MONTH));
                       dataOutStream.writeInt(dueDateTime.get(Calendar.DAY_OF_MONTH));
                       dataOutStream.writeInt(dueDateTime.get(Calendar.HOUR));
                       dataOutStream.writeInt(dueDateTime.get(Calendar.MINUTE));
                       dataOutStream.writeInt(dueDateTime.get(Calendar.SECOND));
                       dataOutStream.writeInt(reminderInterval.get(Calendar.YEAR));
                       dataOutStream.writeInt(reminderInterval.get(Calendar.MONTH));
                       dataOutStream.writeInt(reminderInterval.get(Calendar.DAY_OF_MONTH));
                       dataOutStream.writeInt(reminderInterval.get(Calendar.HOUR));
                       dataOutStream.writeInt(reminderInterval.get(Calendar.MINUTE));
                       dataOutStream.writeInt(reminderInterval.get(Calendar.SECOND));         
                       dataOutStream.writeInt(terminatedDateTime.get(Calendar.YEAR));
                       dataOutStream.writeInt(terminatedDateTime.get(Calendar.MONTH));
                       dataOutStream.writeInt(terminatedDateTime.get(Calendar.DAY_OF_MONTH));
                       dataOutStream.writeInt(terminatedDateTime.get(Calendar.HOUR));
                       dataOutStream.writeInt(terminatedDateTime.get(Calendar.MINUTE));
                       dataOutStream.writeInt(terminatedDateTime.get(Calendar.SECOND));        
                       dataOutStream.writeInt(displayStyle);
                       dataOutStream.writeInt(compareKey);
                       //dataOutStream.writeUTF(status);
             public void clearFields()
                   numImages = 0;
                   imageFileName = "";
                   category = -1;
                    description = "";
                    message = "";
                    dueDateTime = new GregorianCalendar();
                    reminderInterval = new GregorianCalendar();
                    terminatedDateTime = new GregorianCalendar();
                    displayStyle = -1;
                    status = "";
                    compareKey = -1;
               //************* OVERRIDE clone METHOD***********************
               public Object clone() 
                         ReminderClass c = new ReminderClass();
                         try
                              c = ((ReminderClass)super.clone());
                              c.setImageArray(imageArray);
                              c.setImagePathArray(imagePathArray);
                              c.imageFileName = (String)imageFileName;
                              c.category = (int)category;
                              c.description = (String)description;
                              c.message = (String)message;
                              c.status = (String)status;
                              c.compareKey = (int)compareKey;
                              c.displayStyle = (int)displayStyle;
                              c.dueDateTime = (GregorianCalendar)(dueDateTime.clone());
                              c.reminderInterval = (GregorianCalendar)(reminderInterval.clone());
                              c.terminatedDateTime = (GregorianCalendar)(terminatedDateTime.clone());
                         catch (CloneNotSupportedException e)
                              System.out.println("Fatal Error: " + e.getMessage());
                              System.exit(1);
                         return c;
          //**************** OVERRIDE toString METHOD*************************
          public String toString()
               String s = new String();
               s =  description;
              if (showCategory)
                    s = s + "," + CategoryConversion.categories[category];
              if (showImageName)
                   s = s + "," + "'" + imageFileName + "'";
              if (showMessage)
                    s = s + "," + message;
              if (showStatus)
                   s = s + "," + status;
              if (showDueDateTime)
                    s = s + ", " + dueDateTime.get(Calendar.MONTH);
                    s = s + "/" + dueDateTime.get(Calendar.DAY_OF_MONTH);
                    s = s + "/" + dueDateTime.get(Calendar.YEAR);
                    s = s + "  " + dueDateTime.get(Calendar.HOUR);
                    s = s + ":" + dueDateTime.get(Calendar.MINUTE);
                    s = s + ":" + dueDateTime.get(Calendar.SECOND);
              if (showReminderInterval)
                    s = s + ", " + reminderInterval.get(Calendar.MONTH);
                    s = s + "/" + reminderInterval.get(Calendar.DAY_OF_MONTH);
                    s = s + "/" + reminderInterval.get(Calendar.YEAR);
                    s = s + "  " + reminderInterval.get(Calendar.HOUR);
                    s = s + ":" + reminderInterval.get(Calendar.MINUTE);
                    s = s + ":" + reminderInterval.get(Calendar.SECOND);
              if (showTerminatedDateTime)
                    s = s + ", " + terminatedDateTime.get(Calendar.MONTH);
                    s = s + "/" + terminatedDateTime.get(Calendar.DAY_OF_MONTH);
                    s = s + "/" +terminatedDateTime.get(Calendar.YEAR);
                    s = s + "  " + terminatedDateTime.get(Calendar.HOUR);
                    s = s + ":" + terminatedDateTime.get(Calendar.MINUTE);
                    s = s + ":" + terminatedDateTime.get(Calendar.SECOND);
               return s;
          //******************COMPARE TO OBJECT*********************************
          public int compareTo(Object r)
               ReminderClass x;
               x = (ReminderClass)r;
               if (
                   (x.getCategory() == this.category)
               && (x.getDescription().equals(this.description))
               && (x.getMessage().equals(this.message))
               && (x.getImageFileName().equals(this.imageFileName))
               && (x.getDueDateTime().equals(this.dueDateTime))
               && (x.getReminderInterval().equals(this.reminderInterval))
               && (x.getTerminatedDateTime().equals(this.terminatedDateTime))
              return 0;
               else     
              return 1;
          //*************** ACCESSORS AND MUTATORS INCLUDING DISPLAY STYLE*******
          public void setDisplayStyle(int newDisplayStyle)
               displayStyle = newDisplayStyle;
          public int getDisplayStyle()
               return displayStyle;
          public int getCompareKey()
               return compareKey;
          public void setCompareKey(int newCompareKey)
               compareKey = newCompareKey;
          public int getCategory()
               return category;
          public void setImageFileName(String newFileName)
               imageFileName = newFileName;
          public String getImageFileName()
               return imageFileName;
          public void setCategory(int newCategory)
               category = newCategory;
          public String getDescription()
               return description;
          public void setDescription(String newDescription)
               description = newDescription;
          public void setImageArray(String[] array)
               imageArray = new String[20];
               for (int n = 0; n<array.length; n++)
                    imageArray[n] = array[n];
          public void setImagePathArray(String[] array)
               imagePathArray = new String[20];
               for (int n = 0; n<array.length; n++)
                    imagePathArray[n] = array[n];
          public String getImagePathArray(int index)
               return imagePathArray[index];
          public void populateComboBox(JComboBox jcb)
               for (int n = 0; n<numImages; n++)
                     jcb.addItem(imageArray[n]);
          public void addImageToArray(String s)
               imageArray[numImages] = s;
               numImages++;
          public String getMessage()
               return message;
          public void setMessage(String newMessage)
               message = newMessage;     
          public GregorianCalendar getDueDateTime()
               return dueDateTime;
          public void setDueDateTime(int newYear, int newMonth, int newDay, int newHours, int newMins,
                    int newSecs)
              dueDateTime = new GregorianCalendar(newYear, newMonth, newDay, newHours, newMins, newSecs);           
          public GregorianCalendar getReminderInterval()
               return reminderInterval;
          public void setReminderInterval(int newYear, int newMonth, int newDay, int newHours, int newMins,
                   int newSecs)
               reminderInterval = new GregorianCalendar(newYear, newMonth, newDay, newHours, newMins, newSecs);
          public GregorianCalendar getTerminatedDateTime()
               return terminatedDateTime;
          public void setTerminatedDateTime(int newYear, int newMonth, int newDay, int newHours, int newMins,
                   int newSecs)
              terminatedDateTime = new GregorianCalendar(newYear, newMonth, newDay, newHours, newMins, newSecs);      
          public String getStatus()
               return status;
          public void setStatus(String selection)
               status = selection;
          static public void setShowDate(boolean state)
               showDate = state;
          static public boolean getShowDate()
               return showDate;
          static public void setShowCategory(boolean state)
               showCategory = state;
          static public boolean getShowCategory()
               return showCategory;
          static public void setShowImageName(boolean state)
               showImageName = state;
          stat                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  

    You don't really expect us to read through 300 lines of code do you?
    If you need further help then you need to create a [url http://homepage1.nifty.com/algafield/sscce.html]Short, Self Contained, Compilable and Executable, Example Program that demonstrates the incorrect behaviour, because I can't guess exactly what you are doing based on the information provided.
    And don't forget to use the [url http://forum.java.sun.com/help.jspa?sec=formatting]Code Formatting Tags so the code retains its original formatting.
    In the meantime I suggest you read the Swing tutorial on [url http://java.sun.com/docs/books/tutorial/uiswing/components/combobox.html]How to Use Combo Boxes for a working example that does exactly what you want.

  • Updating the current row in vo which is bind to af:table.

    Dear all.
    I have created af table by dragging datacontrol on page.. i also have a form and onclick of button i want to update the current selected row in table..
    I am getting the current row properly but when i am trying to update the row.. it gives me following exception.
    <Utils> <buildFacesMessage> ADF: Adding the following JSF error message: Failed to lock the record, another user holds the lock.
    oracle.jbo.AlreadyLockedException: JBO-26030: Failed to lock the record, another user holds the lock.
    Following is my update code.
    public void update(){
    //BindingContext.getCurrent().getCurrentBindingsEntry().getOperationBinding("Create").execute();
    BindingContext bc = BindingContext.getCurrent();
    JUApplication japp =
    (JUApplication)bc.getCurrentBindingsEntry().get("Entries_AMDataControl");
    Entries_AMImpl ampl = (Entries_AMImpl)japp.getApplicationModule();
    ViewObjectImpl vo=ampl.getEntries_VO1();
    Entries_VORowImpl row=(Entries_VORowImpl)vo.getCurrentRow();
    row.setSubject(subject);
    ClobDomain c=new ClobDomain(toXML().toString());
    row.setXmlcontent(c);
    row.setDescription("");
    //vo.setCurrentRow(row);
    //vo.executeQuery();
    //BindingContext.getCurrent().getCurrentBindingsEntry().getOperationBinding("Execute").execute();
    BindingContext.getCurrent().getCurrentBindingsEntry().getOperationBinding("Commit").execute();
    So please can anyone there tell me how can solve this problem.
    Thanks,
    Regards
    jdev version 11.1.1.4.0

    Hi Frank
    in your AM configuration, set the locking behavior to optimisticIts already optimistic.
    is bad coding practice. You should perform updates through teh ADF binding layer and not directlxy against the Application Module Impl class. You can get the >current row from the iterator the table is bound to and set the attributes on itI changed my code to following
    RowKeySet rs = getCalcTable().getSelectedRowKeys();
    Iterator it = rs.iterator();
    DCBindingContainer bindings =
    (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
    DCIteratorBinding empIter =
    bindings.findIteratorBinding("Entries_VO1Iterator");
    StringBuilder sb = new StringBuilder();
    RowSetIterator empRSIter = empIter.getRowSetIterator();
    Row currentRow = null;
    while (it.hasNext()) {
    Key key = (Key)((List)it.next()).get(0);
    currentRow = empRSIter.getRow(key);
    break;
    Entries_VORowImpl row=(Entries_VORowImpl)currentRow;
    row.setSubject(subject);
    ClobDomain c=new ClobDomain(toXML().toString());
    row.setXmlcontent(c);
    row.setDescription("");
    BindingContext.getCurrent().getCurrentBindingsEntry().getOperationBinding("Commit").execute();
    But it still gives me same error.
    <Utils> <buildFacesMessage> ADF: Adding the following JSF error message: Failed to lock the record, another user holds the lock.
    oracle.jbo.AlreadyLockedException: JBO-26030: Failed to lock the record, another user holds the lock.
    Any suggestion appreciated..
    Thanks
    Regards.

  • How to update the second JComboBox according selection in first JComboBox??

    I am having a hard time to update the second JcomboBox according to the selection of the first JcomboBox. For example, the content of the first JcomboBox is {city, rent}. When "city" is selected, the content of the second JcomboBox should be set to a number of cities. When "rent" is selected, the content of the second JcomboBox should be set to a range of rent.
    Since I have to detect the selection in actionperformed(), where the JcomboBoxes have been added to a Panel, and my JFrame setContentPane() to this Panel, I don't know how to update the JFrame or the Panel. I can make the old JFrame disappear and a new JFrame appear instead, but this is not what I want. I tried method update(Graphics) and removeAll(), and never made it work.
    I would greatly appreciate if anyone could give me any help.

    Thanks for your response. I fixed the problem in the following clumsy way:
    frame.getContentPane().remove(mainPanel);
    mainPanel.remove(box2);
    if(box1.compareTo("city")==0)
    box2 = new JComboBox(cities);
    else if(box1.compareTo("rent")==0)
         box2 = new JComboBox(rents);     
    else if(box1.compareTo("type")==0)
         box2 = new JComboBox(types);
    box2.setBounds(305, 30, 90, 20);
    mainPanel.add(box2);
    frame.getContentPane().add(mainPanel);
    Maybe there is a better way, but I don't know, and I don't understand your suggestion, could you further explain it? Thanks a lot.
    lz22

  • Not Updating the Values in the JComboBox and JTable

    Hi Friends
    In my program i hava Two JComboBox and One JTable. I Update the ComboBox with different field on A Table. and then Display a list of record in the JTable.
    It is Displaying the Values in the Begining But when i try to Select the Next Item in the ComboBox it is not Updating the Records Eeither to JComboBox or JTable.
    MY CODE is this
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.DefaultComboBoxModel.*;
    import javax.swing.table.*;
    import java.sql.*;
    import java.util.*;
    public class SearchBook extends JDialog implements ActionListener
         private JComboBox comboCategory,comboAuthor;
         private JSplitPane splitpane;
         private JTable table;
         private JToolBar toolBar;
         private JButton btnclose, btncancel;
         private JPanel panel1,panel2,panel3,panel4;
         private JLabel lblCategory,lblAuthor;
         private Container c;
         //DefaultTableModel model;
         Statement st;
         ResultSet rs;
         Vector v = new Vector();
         public SearchBook (Connection con)
              // Property for JDialog
              setTitle("Search Books");
              setLocation(40,110);
              setModal(true);
              setSize(750,450);
              // Creating ToolBar Button
              btnclose = new JButton(new ImageIcon("Images/export.gif"));
              btnclose.addActionListener(this);
              // Creating Tool Bar
              toolBar = new JToolBar();
              toolBar.add(btnclose);
              try
                   st=con.createStatement();
                   rs =st.executeQuery("SELECT BCat from Books Group By Books.BCat");
                   while(rs.next())
                        v.add(rs.getString(1));
              catch(SQLException ex)
                   System.out.println("Error");
              panel1= new JPanel();
              panel1.setLayout(new GridBagLayout());
              GridBagConstraints c = new GridBagConstraints();
              c.fill = GridBagConstraints.HORIZONTAL;
              lblCategory = new JLabel("Category:");
              lblCategory.setHorizontalAlignment (JTextField.CENTER);
              c.gridx=2;
              c.gridy=2;
              panel1.add(lblCategory,c);
              comboCategory = new JComboBox(v);
              comboCategory.addActionListener(this);
              c.ipadx=20;
              c.gridx=3;
              c.gridwidth=1;
              c.gridy=2;
              panel1.add(comboCategory,c);
              lblAuthor = new JLabel("Author/Publisher:");
              c.gridwidth=2;
              c.gridx=1;
              c.gridy=4;
              panel1.add(lblAuthor,c);
              lblAuthor.setHorizontalAlignment (JTextField.LEFT);
              comboAuthor = new JComboBox();
              comboAuthor.addActionListener(this);
              c.insets= new Insets(20,0,0,0);
              c.ipadx=20;
              c.gridx=3;
              c.gridy=4;
              panel1.add(comboAuthor,c);
              comboAuthor.setBounds (125, 165, 175, 25);
              table = new JTable();
              JScrollPane scrollpane = new JScrollPane(table);
              //panel2 = new JPanel();
              //panel2.add(scrollpane);
              splitpane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,panel1,scrollpane);
              splitpane.setDividerSize(15);
              splitpane.setDividerLocation(190);
              getContentPane().add(toolBar,BorderLayout.NORTH);
              getContentPane().add(splitpane);
         public void actionPerformed(ActionEvent ae)
              Object obj= ae.getSource();
              if(obj==comboCategory)
                   String selecteditem = (String)comboCategory.getSelectedItem();
                   displayAuthor(selecteditem);
                   System.out.println("Selected Item"+selecteditem);
              else if(obj==btnclose)
                   setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
              else if(obj==comboAuthor)
                   String selecteditem1 = (String)comboAuthor.getSelectedItem();
                   displayavailablity(selecteditem1);
                   //System.out.println("Selected Item"+selecteditem1);
                   System.out.println("Selected Author"+selecteditem1);
         private void displayAuthor(String selecteditem)
              try
              {     Vector data = new Vector();
                   rs= st.executeQuery("SELECT BAuthorandPublisher FROM Books where BCat='" + selecteditem + "' Group By Books.BAuthorandPublisher");
                   System.out.println("Executing");
                   while(rs.next())
                        data.add(rs.getString(1));
                   //((DefaultComboBoxModel)comboAuthor.getModel()).setVectorData(data);
                   comboAuthor.setModel(new DefaultComboBoxModel(data));
              catch(SQLException ex)
                   System.out.println("ERROR");
         private void displayavailablity(String selecteditem1)
                   try
                        Vector columnNames = new Vector();
                        Vector data1 = new Vector();
                        rs= st.executeQuery("SELECT * FROM Books where BAuthorandPublisher='" + selecteditem1 +"'");     
                        ResultSetMetaData md= rs.getMetaData();
                        int columns =md.getColumnCount();
                        String booktblheading[]={"Book ID","Book NAME","BOOK AUTHOR/PUBLISHER","REFRENCE","CATEGORY"};
                        for(int i=1; i<= booktblheading.length;i++)
                             columnNames.addElement(booktblheading[i-1]);
                        while(rs.next())
                             Vector row = new Vector(columns);
                             for(int i=1;i<=columns;i++)
                                  row.addElement(rs.getObject(i));
                             data1.addElement(row);
                             //System.out.println("data is:"+data);
                        ((DefaultTableModel)table.getModel()).setDataVector(data1,columnNames);
                        //DefaultTableModel model = new DefaultTableModel(data1,columnNames);
                        //table.setModel(model);
                        rs.close();
                        st.close();
                   catch(SQLException ex)
    }Please check my code and give me some Better Solution
    Thank you

    You already have a posting on this topic:
    http://forum.java.sun.com/thread.jspa?threadID=5143235

  • How to have a JComboBox display an item different from the one selected

    Hello,
    I have a JTable (single column). I have set this column cell editor to be a JComboBox...
    JComboBox stdComboBox = new JComboBox();
    TableColumn column_zero = stdTablewCombo.getColumnModel().getColumn(0);
            column_zero.setCellEditor( new DefaultCellEditor(stdComboBox) );I have added a lovString array say {"A", "B", "C") to this stdComboBox. However, when the user selects a value from this list, I need to display a value from another lovString array say {"1", "2", "3"}. So if the user selects A then 1 needs to be displayed.
    I have a TableModelListener on this table that is getting me the correct selected index for any of the JComboBoxes on any of the rows. But I am little lost on how to display the value from the 2nd list.
    Thanks.

    Yes...but do I do that in the TableModelListener ?
    This is what I've tried in the TableModelListener:
    public void tableChanged(TableModelEvent e)
             System.out.println(e.getSource());
               if(e.getType() == TableModelEvent.UPDATE)
                    TableModel model = stdTablewCombo.getModel();
                    int row = e.getFirstRow();
                    this.cellValue = ((String)model.getValueAt(row, 0));
                    if (cellValue != null)
                         this.selectedIndex = this.stdComboBox.getSelectedIndex();
                          System.out.println("Selected Index:" + this.selectedIndex);
                          if (this.selectedIndex >= 0)
                             String valueToSet = this.lovStringB[this.selectedIndex];
                             model.setValueAt(valueToSet, row, 0);
                          else
                               System.out.println("Value in cell is not from List");
                          }It returns the selectedIndex value allright.
    It sets the value of valueToSet string allright.
    it also does the model.setValueAt allright....but this triggers a tableChanged event and it goes back up - this is also fine. However, when it now comes back to the this.selectedIndex = , this again returns the index of the original selection and not a -1 (for values not in the ComboBox list). This makes it go into an infinite loop and gives me a StackOverflowError.
    Edited by: 799076 on Oct 10, 2010 9:41 AM
    Edited by: 799076 on Oct 10, 2010 9:49 AM

  • "All of the Playlists Selected for Updating No Longer Exist"

    My family has 2 ipod shuffles. After purchasing a Nano recently, I inserted the cd that came with it. Apparently the existing iTunes software was removed and reinstalled. At any rate, the library still shows all the original songs, but when the Nano is plugged in, iTunes immediately gives a prompt stating "Songs on the iPod *** cannot be updated because all of the playlists selected for updating no longer exist." The library is there, the playlists that were there are there, and I can play the songs on my cpu. Is there anything I can do besides completely uninstalling everything and starting over?
    iPod Nano   Windows XP Pro  

    This user tip should help you sort out your missing playlist problem: Hudgie - iPod cannot sync because one or more playlists are missing

  • "...(ipod) cannot be updated because all of the playlists selected for

    Please help! I get the error message, "Songs on the iPod
    cannot be updated because all of the playlists selected for updating no longer exist." So it seems that I erased the playlists from my iPod. I have done the "Five Rs."
    Doing the iPod Updater took 2 1/2 hrs. It did not help.
    How can I get my iPod to work?

    See this.
    iPod cannot sync because one or more playlist is missing.

  • I just updated my iPhone 4 to iOS6.  In the process, I ran into a problem and had to restore factory settings.  After syncing the phone, I see that 218 apps need to be updated. When selecting "update all," it says "manage local device storage usage." How?

    I just updated my iPhone 4 to iOS6.  In the process, I ran into a problem and had to restore factory settings.  After syncing the phone, I see that 218 apps need to be updated. When selecting "update all," it says "Cannot Download.  There is not enough available local storage to download these items.  You can manage your local device storage usage in Settings."
    How can this be the case when I haven't changed any apps from before updrading to iOS6, and I don't have any music yet on the phone?  Why is it telling me there is not enough local space?

    Hi RileyAvaCadenRiver,
    If you recently updated your iPhone to iOS7, you will need to update iTunes on your computer to iTunes 11.1 or newer for it to correctly recognize the iPhone. You may find the following link helpful:
    Apple: iTunes 11.1.1
    http://support.apple.com/kb/DL1614
    Regards,
    - Brenden

  • I just updated the software on my iPad and now I cannot update my Aps or install new ones.  I ran a diagnostic and that resulted in "power issue." It wouldn't let me select what my options were.  Any ideas?

    Don't know where to get help.  I just updated the software and I am having issues with not being able to update Aps or install new ones.  The circles just spin and Aps just say "waiting."  I tried running a diagnostic with the apple store and it came back with "power issues" (?) as a result.  It wouldn't let me select an option to see what steps I could take to fix it, it just backed out of the page.  I just don't know what to do.....

    Hi,
    Thank you for your reply, I did go to my general settings, but for some odd reason I don't have a restrictions setting, or a reset setting. I thought I could reset all the setting to see if it could be that, but as I said there aren't any.
    My husband also has the iPad 2, and also did the software update and hasn't had any problems at all. I took both iPad's and compared the settings thinking maybe there could be a setting that could have been changed when the update was done.

  • When my iPod Touch is connected to my Mac, and I select Update to update the software of my iPod Touch, I get a message saying that my iTunes software is current, but it will not update my iPod Touch software.  Is there a bug in the iPod program?

    When my iPod Touch is connected to my Mac, and I select Update to update the software of my iPod Touch, I get a message saying that my iTunes software is current, but it will not update my iPod Touch software.  Is there a bug in the iPod program?

    If you have the first gen ipod touch as your information shows, then you would have to buy a software update:
    Purchasing iOS 3.1 Software Update for iPod touch (1st generation)

  • I accidently deleted the playlist selected for updating thing...

    i was adding new songs to my ipod and i guess there were too many songs there so it asked me if i wanted it to choose some songs randomly...
    so i chose "ok" but actually i didnt really want it to choose songs on its own so i deleted the list that was automatically created by itself and decided to delete some songs on my own...
    after doin that, i tried to update it but now it says i cant do it because i deleted that list...
    it says "songs on the ipod "stephanie kim" cannot be updated because all of the playlists selected for updating no longer exists"
    i turned my computer off and tried it again several times but it wont work...
    and all the songs in my ipod are gone now...
    is there anything i can do?

    http://support.apple.com/kb/PH10918
    Best.

  • How to clear the selected values in the JCombobox

    Hi All,
    Can you please tell - how to clear the selected values in the JCombobox
    I have four dropdowns in my application, When I click "CLEAR" button, what ever the values selected in the four drop downs should go off and view as "SELECT" in all the dropdowns.

    In addition to the above you should also check out [Combo Box Prompt|http://www.camick.com/java/blog.html?name=combo-box-prompt] which makes it easy to display the default prompt.

  • Why can't I select or update the Record using the PreparedStatement?

    the DB is oracle9i,here is the test table
    test
    id number;
    name char(10);
    intro char(10);
    I have insert a record in the table.
    Now I will select or update the record by using the PreparedStatement here is my code:
    sqlStr = "update test set intro = ? where name =?";
    PreparedStatement stmt = conn.prepareStatement(sqlStr);
    stmt.setString(1,"my name is irixwang");
    stmt.setString(2,"irixwang");
    int is = stmt.executeUpdate();
    if (is >=1 )
    System.out.println("ok");
    It will not work ,but where I change the update condiction as followed:
    sqlStr = "update test set intro = ? where id =?";
    PreparedStatement stmt = conn.prepareStatement(sqlStr);
    stmt.setString(1,"my name is irixwang");
    stmt.setInt(2,100);
    int is = stmt.executeUpdate();
    It works well,why?
    please help me!thk!!!!

    I doubt it works "well" in either case since you are inserting a string that is longer than 10 characters into a field that only holds 10 characters. But to your question....
    A char data type holds a fixed number of characters - in your case 10.
    Because it holds 10 characters it will never hold 9, regardless of what you think is in the field it will always have 10 characters in it. The value you are using for query for name is 9 characters. Since 9 characters, regardless of content, will never be equal to 10 characters there is no way that it will update.
    So your choice is to either use a varchar, which holds a variable number of characters, or to always use 10 characters for your query (pad it with spaces.)

  • Updating the Leave Information (dates selected) from MSOutlook to SAP ESS

    Hi Forum,
                    I had a scenario where I need to use Microsoft Outlook as an interface and the leave information selected in outlook calender should be updated to SAP ESS. Does Any one worked on similar kind of scenarios ? I would like to know if any API is available to interface between MS Outlook and SAP. If not is there any 3rd part integration technologies available ? Helpful answers will be Appriciated in the SDN way
    Regards
    Ramesh

    Hi Manoj,
                   Thanks for your reply. I am looking for a Java API using which i can read the calender information in outlook (dates selected and saved by the user). If I can get this dates information i could think of updating the same dates (leave info) to SAP ESS usingn JCO Client java program.
    Please suggest me some java API to read the calender information stored in outlook.
    Thanks & Regards
    Ramesh

Maybe you are looking for