Can anybody run Oralce(8.1.6) demo code ?

Can anybody run Oralce(8.1.6) demo code about embedded SQL without any problem?
It seems that I'm unlucky.
I need to write a small embedded SQL program (Window 2000 / VC++6 compiler) that can connect to the Oracle server on the LAN. So I try to begin from the demo code which provided by Oracle. Precompiler and VC++ compiler process seem OK (only adjust the precompiler's default path to the correct path which contains the head files). So I can get the exeacutable file.
But when I run the exeacutable file, error occurs! ORA-12560. protocol adapter error!
The SQL Plus works fine. The whole system is new and clean. After tracing the operation, I find that maybe the protocol I'm using is: 'beq', instead of 'TCP/IP'.
A little bit further searching in Oracle document said that I may need to install JSB driver... But it seems that no related dll files in my computer... I'm totally lost here!
Can anybody help me about it!
Thanks a lot!!
Charles

Is there a reason that you can't use the newer 8.1.6.2 driver? Generally, Oracle doesn't make all the older versions available for download.
Justin

Similar Messages

  • Can anybody tell me the problem with this code when compiled in jdk1.4

    Can anybody help me find out the error in this code.
    Try to drag a file from your desktop and drop it on the first textpane on my GUI. Then try to drag another file. This time the dragdrop event handler throws a null pointer exception. This happened when I compiled the code with jdk1.4. With jdk1.3 it is working fine. Actually, I need jdk1.4 to get the systemicons for the files I drop on my desktop.
    /* Client.java*/
    import java.util.Vector;
    import java.util.Enumeration;
    import java.util.Arrays;
    import java.awt.*;
    import java.awt.event.*;
    import java.rmi.*;
    import java.rmi.server.*;
    import javax.swing.*;
    import javax.swing.tree.*;
    import javax.swing.filechooser.*;
    import java.io.*;
    import java.awt.dnd.*;
    import java.awt.datatransfer.*;
    import java.util.Iterator;
    import javax.swing.plaf.*;
    import javax.swing.plaf.basic.*;
    import java.util.Hashtable;
    import javax.swing.text.*;
    import javax.swing.event.*;
    public class Client extends JFrame{
    static String newline = System.getProperty("line.separator");
    static Client client;
         //ServerInterface server;
         //ClientProperties clp;
         Vector v1=new Vector();
         ByteArrayOutputStream out;
         Runtime r1;
         //file objects,together with array of bytes
         Hashtable files=new Hashtable(); //files sent
         Hashtable rfiles=new Hashtable(); //files received
         //file objects,together with button handlers
         Hashtable hfiles=new Hashtable(); //files sent,files received
         JButton button1=new JButton();
         JButton button2=new JButton();
         JButton button3=new JButton();
         JLabel label1=new JLabel();
         JLabel label2=new JLabel();
         JLabel label3=new JLabel();
         JLabel label4=new JLabel();
         JLabel label5=new JLabel();
         JLabel label6=new JLabel();
         JLabel label7=new JLabel();
         JLabel label8=new JLabel();
         JOptionPane dialog=new JOptionPane();
         JFileChooser chooser = new JFileChooser();
         JPanel panel1;
         JPanel panel2;
         DropTarget dtarget;
         DragSource dsource;
         JTextPane textArea1=new JTextPane();
         TextArea textArea2=new TextArea();
         JTextPane textpanel=new JTextPane();
         Style defstyle,style;
         StyledDocument doc,doc1;
         JPopupMenu popup;
         JTree tree;
         JScrollPane jsppane;
         JScrollPane jsp,jsp2;
         DefaultMutableTreeNode top;
         Container cp;
         private String toalias;
         private String togroup;
    private String fromalias;
         private String fromgroup;     
         private boolean CONNECT;
         public Client()
         cp=getContentPane();
         cp.setLayout(null);
              setForeground(java.awt.Color.red);
              setFont(new Font("Dialog", Font.PLAIN, 14));
              setVisible(false);
              label1.setText(" CHAT APPLICATION");
              cp.add(label1);
              label1.setFont(new Font("Dialog", Font.BOLD, 16));
              label1.setBounds(72,20,319,30);
              label2.setText("List of Users Connected.");
              cp.add(label2);
              label2.setForeground(java.awt.Color.blue);
              label2.setFont(new Font("Dialog", Font.BOLD, 12));
              label2.setBounds(24,60,192,26);
              label8.setBounds(280,60,100,26);
              cp.add(label8);
              cp.add(textArea2);
              textArea2.setBounds(204,120,268,90);
              jsppane=new JScrollPane(textArea1);
              doc1=textArea1.getStyledDocument();
              jsppane.setBounds(12,264,456,109);
              cp.add(jsppane);
              label3.setText("TO::");
              cp.add(label3);
              label3.setFont(new Font("Dialog", Font.BOLD, 12));
              label3.setBounds(12,228,36,20);
              cp.add(label4);
              label4.setBackground(java.awt.Color.lightGray);
              label4.setBounds(60,228,172,19);
              label5.setText("SERVER RESPONSE");
              cp.add(label5);
              label5.setFont(new Font("Dialog", Font.BOLD, 12));
              label5.setBounds(204,96,204,21);
              label7.setText("MESSAGE FOR YOU.");
              cp.add(label7);
              label7.setFont(new Font("Dialog", Font.BOLD, 14));
         label7.setBounds(12,371,288,25);
         jsp2=new JScrollPane(textpanel);
         setTextPaneStyle();
    jsp2.setBounds(12,401,456,109);
    cp.add(jsp2);
    button1.setLabel("Send");
              button1.setEnabled(false);
              cp.add(button1);
              button1.setBackground(java.awt.Color.lightGray);
              button1.setForeground(java.awt.Color.black);
              button1.setFont(new Font("Dialog", Font.BOLD|Font.ITALIC, 10));
              button1.setBounds(60,520,78,36);
              button2.setLabel("Attach");
              //button2.setEnabled(false);
              cp.add(button2);
              button2.setBackground(java.awt.Color.lightGray);
              button2.setForeground(java.awt.Color.black);
              button2.setFont(new Font("Dialog", Font.BOLD|Font.ITALIC, 10));
              button2.setBounds(180,520,72,36);
              button3.setLabel("Connect");
              cp.add(button3);
              button3.setBackground(java.awt.Color.lightGray);
              button3.setForeground(java.awt.Color.black);
              button3.setFont(new Font("Dialog", Font.BOLD|Font.ITALIC, 10));
              button3.setBounds(288,520,72,33);
              setSize(500,620);
         show();
         addWindowListener(new WindowEventHandler());
         button1.addActionListener(new ButtonHandler());     
         button2.addActionListener(new ButtonHandler());     
         button3.addActionListener(new ButtonHandler());
         textArea1.addContainerListener(new ComponentHandler());     
         dtarget=new DropTarget(textArea1,new DragDropHandler());
         textArea2.setEnabled(false);
         textpanel.setEnabled(false);
         r1=Runtime.getRuntime();
         r1.addShutdownHook(new onshutdown());
         addMenu();
         cp.repaint();
         //adds attachments to the textArea1     
         synchronized private void addAttach(java.util.List fileList)
         Iterator iterator=fileList.iterator();
         JButton bw;
         while(iterator.hasNext())
              File file=(File)iterator.next();
              Icon icon=chooser.getIcon(file);
              bw=new JButton(icon);
              bw.setBackground(java.awt.Color.gray);
              bw.setToolTipText(file.getAbsolutePath());
              bw.addMouseListener(new AttachmentHandler());
              Dimension d1=new Dimension(icon.getIconWidth(),icon.getIconHeight());
              bw.setMaximumSize(d1);
              hfiles.put(bw,file);          
              textArea1.insertComponent(bw);
              textArea1.setCaretPosition(doc1.getLength());
              bw.setSize(icon.getIconWidth(),icon.getIconHeight());
              //only one file at a time
              break;
         cp.repaint();
    public void setAudioStream(ByteArrayOutputStream out)
    this.out=out;               
    private void addMenu()
         JMenuBar mbar=new JMenuBar();
         mbar.setVisible(true);
         mbar.setBounds(0,0,500,20);
         mbar.setBackground(java.awt.Color.gray);
         //first menu
         JMenu m1=new JMenu("Connection");
         m1.setBounds(0,0,80,20);
         m1.setBackground(java.awt.Color.gray);
         JMenuItem mitem1=new JMenuItem("Connect");
         JMenuItem mitem2=new JMenuItem("Disconnect");
         m1.add(mitem1);
         m1.add(mitem2);
         mitem1.addActionListener(new ButtonHandler());
         mitem2.addActionListener(new ButtonHandler());
         mbar.add(m1);
         //second menu
         JMenu m2=new JMenu("Send...");
         m2.setBounds(90,0,80,20);
         m2.setBackground(java.awt.Color.gray);
         JMenuItem mitem3=new JMenuItem("Send");
         JMenuItem mitem4=new JMenuItem("Send with Audio...");
         mitem3.addActionListener(new ButtonHandler());
         mitem4.addActionListener(new ButtonHandler());
         m2.add(mitem3);
         m2.add(mitem4);
         mbar.add(m2);
         cp.add(mbar);
    private void setTextPaneStyle()
    StyleContext stylecontext =StyleContext.getDefaultStyleContext();
    defstyle=stylecontext.getStyle(StyleContext.DEFAULT_STYLE);
    doc= textpanel.getStyledDocument();
    //style 1
    style= textpanel.addStyle("bold",defstyle);
    StyleConstants.setBackground(style,Color.white);
    StyleConstants.setForeground(style,Color.blue);
    StyleConstants.setItalic(style, false);
    StyleConstants.setBold(style, true);
    StyleConstants.setFontSize(style,16);
    //style 2
    style= textpanel.addStyle("normal",defstyle);
    StyleConstants.setBackground(style,Color.white);
    StyleConstants.setForeground(style,Color.black);
    StyleConstants.setItalic(style, false);
    StyleConstants.setBold(style, false);
    StyleConstants.setFontSize(style,14);      
    //style3
    style= textpanel.addStyle("attach",defstyle);
    StyleConstants.setBackground(style,Color.white);
    StyleConstants.setForeground(style,Color.red);
    StyleConstants.setItalic(style, true);
    StyleConstants.setBold(style, false);
    StyleConstants.setFontSize(style,12);      
    //remote method called by server
    public void addClient(String alias,String group,JTree tree)
         //if old client remove old tree
         if(!alias.equals(""))
         cp.remove(this.jsp);
         //add new tree
         this.tree=tree;
         setTreeModel();
         getSound(2);
         if(!alias.equals(""))
         textArea2.append("\nNew Client:" + alias + "has joined");
         else
         textArea2.append("\nYou have been connected to the Server.");
         jsp=new JScrollPane(this.tree);
    jsp.setBounds(12,96,168,120);
         jsp.setBackground(java.awt.Color.lightGray);
    cp.add(jsp);
    this.tree.addMouseListener(new MouseHandler());
    //remote method called by server
    public void sendMessage(String str,Hashtable rfiles,String alias,String group) throws RemoteException
              receiveMessage(str,rfiles,alias,group);
    //remote method called by server
    public void removeClient(JTree tree,String alias,String group) throws RemoteException
    cp.remove(this.jsp);
    this.tree=tree;
    setTreeModel();
    getSound(3);
    jsp=new JScrollPane(this.tree);
    jsp.setBounds(12,96,168,120);
         jsp.setBackground(java.awt.Color.lightGray);
    cp.add(jsp);
    this.tree.addMouseListener(new MouseHandler());
    textArea2.append("\nClient:" + alias + "has disconnected");                          
    private void receiveMessage(String str,Hashtable rfiles,String alias,String group)
              boolean flag=true;
              UIManager.put("JFrame.activeTitleBackground", new Color(64,128,255));
    UIManager.put("JFrame.activeTitleForeground", Color.white);
    UIManager.put("JFrame.inactiveTitleBackground", new Color(128,128,128));
    UIManager.put("JFrame.inactiveTitleForeground", Color.black);
    SwingUtilities.updateComponentTreeUI(this);
              try{
              if(alias.equals(""))
         doc.insertString(doc.getLength(),"CHATMASTER>>",textpanel.getStyle("bold"));
              doc.insertString(doc.getLength(),str+ newline,textpanel.getStyle("normal"));
              else
              doc.insertString(doc.getLength(),alias + "@" + group + ">>",textpanel.getStyle("bold"));
              doc.insertString(doc.getLength(),str,textpanel.getStyle("normal"));
              //add files to textpanel
              if(rfiles!=null && rfiles.size()>0)
              doc.insertString(doc.getLength(),newline+"Attachments>>",textpanel.getStyle("attach"));
              showattach(rfiles);
              addtoList(rfiles);     
    doc.insertString(doc.getLength(),newline,textpanel.getStyle("normal"));
    catch(Exception e)
              e.printStackTrace();
              dialog.showMessageDialog(client,e.toString(),"Error:ChatApplication",JOptionPane.ERROR_MESSAGE);
         cp.repaint();               
    protected boolean ContactServer(String alias,String servername,String group)
         try{
              //UnicastRemoteObject.exportObject(this);
              //server=(ServerInterface)Naming.lookup("//gpt02d05:5500/" + servername);
         //     server.notifyMe(this,alias,group);
              //change the settings of buttons
              button1.setEnabled(true);
              button2.setEnabled(true);
              button3.setLabel("Disconnect");
              label8.setVisible(true);
              label8.setText(" Welcome::" + alias);
              //putting values of alias and group for sending messages
              fromalias=alias;
              fromgroup=group;
              CONNECT=true;
              return true;
         catch(UnsupportedOperationException e)
         dialog.showMessageDialog(client,"Client with the Same Alias in " + group + " already exists","Error:ChatApplication",JOptionPane.ERROR_MESSAGE);                                   
         try{
              //     UnicastRemoteObject.unexportObject(client,true);
              catch(Exception ev){System.out.println(ev.toString());}     
         catch(Exception e)
              dialog.showMessageDialog(client,"Unable to connect to Server","Error:ChatApplication",JOptionPane.ERROR_MESSAGE);
              try{
              //     UnicastRemoteObject.unexportObject(client,true);
              catch(Exception ev){System.out.println(ev.toString());}     
         return false;      
    public static void main(String args[]) throws RemoteException{
         client=new Client();          
    }//main ends
    public void getSound(int count)
         Toolkit t1=getToolkit();
              for(int i=0;i<count;i++)
              t1.beep();
              try{
                   Thread.sleep(500);
              catch(Exception e){}
    public void setTreeModel()
    ImageIcon i1=new ImageIcon("Lock.gif","No Users");
    ImageIcon i2=new ImageIcon("Connec.gif","Users in Group");
    ImageIcon i3=new ImageIcon("authorbn.gif","An User");
    DefaultTreeCellRenderer dr1= new DefaultTreeCellRenderer();
    dr1.setClosedIcon(i1);
    dr1.setOpenIcon(i2);
    dr1.setLeafIcon(i3);
    dr1.setTextSelectionColor(java.awt.Color.red);
    tree.setCellRenderer(dr1);
    //add received files to the list
    private void addtoList(Hashtable rfiles)
    Enumeration filelist=rfiles.keys();          
    while(filelist.hasMoreElements())          
    File file=(File)filelist.nextElement();
    this.rfiles.put(file,rfiles.get(file));               
    //show the attachments received               
    private void showattach(Hashtable rfiles)
    Enumeration filelist=rfiles.keys();
    dsource=DragSource.getDefaultDragSource();
    JButton b1=null;
    while(filelist.hasMoreElements())
         File file=(File)filelist.nextElement();
         Icon icon=chooser.getIcon(file);
         b1=new JButton(icon);
         b1.setBackground(java.awt.Color.gray);
    b1.setToolTipText(file.getName());
    b1.addMouseListener(new AttachmentHandler());
    Dimension d1=new Dimension(icon.getIconWidth(),icon.getIconHeight());
    b1.setMaximumSize(d1);
    hfiles.put(b1,file);
    textpanel.setCaretPosition(doc.getLength());
    textpanel.insertComponent(b1);
    b1.setSize(icon.getIconWidth(),icon.getIconHeight());
    dsource.createDefaultDragGestureRecognizer(b1, DnDConstants.ACTION_COPY_OR_MOVE,new DragGestureHandler());           
    cp.repaint();
    private void savefile(File file,Object parent)
    //ExtensionFileFilter filter = new ExtensionFileFilter(false);
    //filter.addExtension("txt",true);
    //chooser.setFileFilter(filter);
    int returnVal = chooser.showSaveDialog(client);
    if(returnVal ==JFileChooser.APPROVE_OPTION)
         try{
         FileOutputStream fstream=new FileOutputStream(chooser.getSelectedFile());
         //decide whether the file received or sent is to be saved
         if(((Container)parent).equals(textArea1))
         fstream.write((byte[])files.get(file));
         else
         fstream.write((byte[])rfiles.get(file));
         fstream.close();
         System.out.println(file.getName());          
         catch(Exception e)
         {System.out.println(e.toString()); }
    private void openfile(File file,Object parent)
         File tempfile=null;
         try{
         String fname=file.getName();     
         tempfile=File.createTempFile("temp",fname.substring(fname.lastIndexOf(".")));     
         FileOutputStream fstream=new FileOutputStream(tempfile);
         System.out.println(tempfile.getAbsolutePath());
         //decide whether the file received or sent is to be saved
         if(((Container)parent).equals(textArea1))
         fstream.write((byte[])files.get(file));
         else
         fstream.write((byte[])rfiles.get(file));          
         fstream.close();
    catch(Exception e){System.out.println(e.toString());}
    try{
         Process p1=r1.exec("cmd /c start " + tempfile.getAbsolutePath());
         p1.waitFor();
    catch(Exception e){System.out.println(e.toString());}     
    //inner classes
    class ComponentHandler implements ContainerListener{
    public void componentRemoved(ContainerEvent ev)     
              Container cont=(Container)ev.getChild();
              if(cont.getComponentCount()>0)
              JButton but=(JButton)cont.getComponent(0);
              files.remove((File)hfiles.get(but));
              hfiles.remove(but);
    public void componentAdded(ContainerEvent ev){}
    class AttachmentHandler extends MouseAdapter{
         public void mouseClicked(MouseEvent ev){
         if(ev.getModifiers()==4)
         Component comp=(Component)ev.getSource();
         File file=(File)hfiles.get(comp);
         popup=new JPopupMenu();
         JMenuItem popopen=new JMenuItem("Open");
         JMenuItem popsave=new JMenuItem("Save As..");
         popup.add(popopen);
         System.out.println(comp.getParent().getParent().getClass().toString());
         popopen.addActionListener(new ButtonHandler(file,comp.getParent().getParent()));
         popup.add(popsave);
         popsave.addActionListener(new ButtonHandler(file,comp.getParent().getParent()));
         popup.show(comp,12,12);
    class DragGestureHandler extends Vector implements DragGestureListener,DragSourceListener,Transferable{
    final static int FILE = 0;
    final static int STRING = 1;
    final static int PLAIN = 2;
    DataFlavor flavors[] = {DataFlavor.javaFileListFlavor,DataFlavor.stringFlavor,DataFlavor.plainTextFlavor};
    public void dragDropEnd(DragSourceDropEvent ev){}
    public void dragEnter(DragSourceDragEvent ev){}
    public void dragExit(DragSourceEvent ev){}
    public void dragOver(DragSourceDragEvent ev){}
    public void dropActionChanged(DragSourceDragEvent ev){}
    public void dragGestureRecognized(DragGestureEvent ev)     
              System.out.println("recognized");
              File file=(File)hfiles.get(ev.getComponent());
    addElement(file);
    ev.startDrag(DragSource.DefaultCopyDrop,this,this);
    /* Returns the array of flavors in which it can provide the data. */
    public synchronized DataFlavor[] getTransferDataFlavors() {
         return flavors;
    /* Returns whether the requested flavor is supported by this object. */
    public boolean isDataFlavorSupported(DataFlavor flavor) {
    boolean b = false;
    b |=flavor.equals(flavors[FILE]);
    b |= flavor.equals(flavors[STRING]);
    b |= flavor.equals(flavors[PLAIN]);
         return (b);
    public synchronized Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException,IOException
    if(flavor.equals(flavors[FILE])){return this;}
    else if (flavor.equals(flavors[PLAIN])) {
         return new StringReader(((File)elementAt(0)).getAbsolutePath());
         } else if (flavor.equals(flavors[STRING])) {
         return((File)elementAt(0)).getAbsolutePath();
         } else {
         throw new UnsupportedFlavorException(flavor);
    //inner class for draging in the files on java frame     
    class DragDropHandler implements DropTargetListener{
    public void dragEnter(DropTargetDragEvent ev){     
    public void dragExit(DropTargetEvent ev){
    public void dragOver(DropTargetDragEvent ev){
    public void drop(DropTargetDropEvent ev){
         Transferable tf1=ev.getTransferable();
         DataFlavor fl[]=ev.getCurrentDataFlavors();
         if(ev.isDataFlavorSupported(DataFlavor.javaFileListFlavor))
         ev.acceptDrop (DnDConstants.ACTION_COPY_OR_MOVE);
         try{
         java.util.List fileList = (java.util.List)tf1.getTransferData(DataFlavor.javaFileListFlavor);
    Iterator iterator = fileList.iterator();
    while (iterator.hasNext())
    File file = (File)iterator.next();
    if(file.isFile())
    Icon icon=chooser.getIcon(file);
    FileInputStream fstream=new FileInputStream(file);
    int filedata=(new Double(file.length())).intValue();
    byte bytes[]=new byte[filedata];
    fstream.read(bytes);
    files.put(file,bytes);
    ev.getDropTargetContext().dropComplete(true);
    addAttach(fileList);
    catch(Exception e)
    {System.out.println(e.toString() + "here");}
    public void dropActionChanged(DropTargetDragEvent ev){
    class MouseHandler extends MouseAdapter{
    public void mouseClicked(MouseEvent me)
    TreePath tp=tree.getPathForLocation(me.getX(),me.getY());
    if(tp!=null)
         if(tp.getPathCount()==3)
              toalias=tp.getPathComponent(2).toString();
              togroup=tp.getPathComponent(1).toString();
              System.out.println(toalias);
              if (!(toalias.equals(fromalias) && togroup.equals(fromgroup)))
              System.out.println("hh " + toalias);
              label4.setText(tp.getPathComponent(2).toString() + "_@" + tp.getPathComponent(1).toString());           
    class ButtonHandler implements ActionListener{
         private File file;
         private Object parent;
         //constructors
         public ButtonHandler()
         public ButtonHandler(File file,Object parent)
              this.file=file;
              this.parent=parent;
         //other functions      
         public void actionPerformed(ActionEvent ev){
              String s=ev.getActionCommand();
         System.out.println(s);
              if(s.equals("Send with Audio..."))
              //Audio audio=new Audio(client,false,"CAPTURE");          
              if(s.equals("Disconnect"))
              try{
              // server.disconnect(client);
              client.getSound(3);
              cp.remove(jsp);
              label6.setVisible(false);
              //UnicastRemoteObject.unexportObject(client,true);
              button3.setLabel("Connect");
              textArea2.append("\nYou have been disconnected to Server");
              client.repaint();     
              catch(Exception e)
              System.out.println(e.toString());
              if(s.equals("Connect"))
         //     clp=new ClientProperties(client,false);
         if(s.equals("Save As.."))
         savefile(file,parent);     
         if(s.equals("Open"))
         openfile(file,parent);
              if(s.equals("Attach"))
              //ExtensionFileFilter filter = new ExtensionFileFilter(false);
              //filter.addExtension(".txt",true);
              //filter.setDescription("Text Files(.txt)");
              // chooser.setFileFilter(filter);
              chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
              //chooser.setMultiSelectionEnabled(true);
              int returnVal = chooser.showOpenDialog(client);
              if(returnVal ==JFileChooser.APPROVE_OPTION)
              //File fp[]=chooser.getSelectedFiles();
              File fp[]=new File[1];
              fp[0]=chooser.getSelectedFile();
              int i=0;
              while(i<fp.length)
              try{
              File file=fp;
              Icon icon=chooser.getIcon(file);
    FileInputStream fstream=new FileInputStream(file);
    int filedata=(new Double(file.length())).intValue();
    byte bytes[]=new byte[filedata];
    fstream.read(bytes);
    files.put(file,bytes);
    catch(Exception e){dialog.showMessageDialog(client,e.toString(),"Error:ChatApplication",JOptionPane.ERROR_MESSAGE);
    return; }
    i++;
              java.util.List fileList=Arrays.asList(fp);
              addAttach(fileList);
              if(s.equals("Send"))
              try{
                   if(toalias==null)
                   dialog.showMessageDialog(client,"Select the Recepient First!!","Error:ChatApplication",JOptionPane.ERROR_MESSAGE);
                   return;
                   if(toalias!=null && togroup!=null && (!toalias.equals(fromalias)))
                   // server.sendMessage(textArea1.getText(),files,toalias,togroup,fromalias,fromgroup);
                   textArea1.setText("");
              catch(Exception e)
         e.printStackTrace();
    }//if ends
    class WindowEventHandler extends WindowAdapter{
         public void windowClosing(WindowEvent ev){
              try{
              //server.disconnect(client);
              client.getSound(3);
         //     UnicastRemoteObject.unexportObject(client,true);
              catch(Exception e){System.out.println(e.toString());}
              dispose();
    private class onshutdown extends Thread{
    public void run(){
         try{
              //server.disconnect(client);
              //UnicastRemoteObject.unexportObject(client,true);
              catch(Exception e){}      
    }//run ends          

    Here is the working code :
    There was an error line 724
    File file=fp; -> File file=fp[0];
    Several method were deprecated and try to replace the deprecated static field : DataFlavor.plainTextFlavor which was deprecated since 1.4.
    /* Client.java*/
    import java.util.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.rmi.*;
    import java.rmi.server.*;
    import javax.swing.*;
    import javax.swing.tree.*;
    import javax.swing.filechooser.*;
    import java.io.*;
    import java.awt.dnd.*;
    import java.awt.datatransfer.*;
    import javax.swing.plaf.*;
    import javax.swing.plaf.basic.*;
    import javax.swing.text.*;
    import javax.swing.event.*;
    public class Client extends JFrame{
    static String newline = System.getProperty("line.separator");
    static Client client;
    //ServerInterface server;
    //ClientProperties clp;
    Vector v1=new Vector();
    ByteArrayOutputStream out;
    Runtime r1;
    //file objects,together with array of bytes
    Hashtable files=new Hashtable(); //files sent
    Hashtable rfiles=new Hashtable(); //files received
    //file objects,together with button handlers
    Hashtable hfiles=new Hashtable(); //files sent,files received
    JButton button1=new JButton();
    JButton button2=new JButton();
    JButton button3=new JButton();
    JLabel label1=new JLabel();
    JLabel label2=new JLabel();
    JLabel label3=new JLabel();
    JLabel label4=new JLabel();
    JLabel label5=new JLabel();
    JLabel label6=new JLabel();
    JLabel label7=new JLabel();
    JLabel label8=new JLabel();
    JOptionPane dialog=new JOptionPane();
    JFileChooser chooser = new JFileChooser();
    JPanel panel1;
    JPanel panel2;
    DropTarget dtarget;
    DragSource dsource;
    JTextPane textArea1=new JTextPane();
    TextArea textArea2=new TextArea();
    JTextPane textpanel=new JTextPane();
    Style defstyle,style;
    StyledDocument doc,doc1;
    JPopupMenu popup;
    JTree tree;
    JScrollPane jsppane;
    JScrollPane jsp,jsp2;
    DefaultMutableTreeNode top;
    Container cp;
    private String toalias;
    private String togroup;
    private String fromalias;
    private String fromgroup;
    private boolean CONNECT;
    public Client()
    cp=getContentPane();
    cp.setLayout(null);
    setForeground(java.awt.Color.red);
    setFont(new Font("Dialog", Font.PLAIN, 14));
    setVisible(false);
    label1.setText(" CHAT APPLICATION");
    cp.add(label1);
    label1.setFont(new Font("Dialog", Font.BOLD, 16));
    label1.setBounds(72,20,319,30);
    label2.setText("List of Users Connected.");
    cp.add(label2);
    label2.setForeground(java.awt.Color.blue);
    label2.setFont(new Font("Dialog", Font.BOLD, 12));
    label2.setBounds(24,60,192,26);
    label8.setBounds(280,60,100,26);
    cp.add(label8);
    cp.add(textArea2);
    textArea2.setBounds(204,120,268,90);
    jsppane=new JScrollPane(textArea1);
    doc1=textArea1.getStyledDocument();
    jsppane.setBounds(12,264,456,109);
    cp.add(jsppane);
    label3.setText("TO::");
    cp.add(label3);
    label3.setFont(new Font("Dialog", Font.BOLD, 12));
    label3.setBounds(12,228,36,20);
    cp.add(label4);
    label4.setBackground(java.awt.Color.lightGray);
    label4.setBounds(60,228,172,19);
    label5.setText("SERVER RESPONSE");
    cp.add(label5);
    label5.setFont(new Font("Dialog", Font.BOLD, 12));
    label5.setBounds(204,96,204,21);
    label7.setText("MESSAGE FOR YOU.");
    cp.add(label7);
    label7.setFont(new Font("Dialog", Font.BOLD, 14));
    label7.setBounds(12,371,288,25);
    jsp2=new JScrollPane(textpanel);
    setTextPaneStyle();
    jsp2.setBounds(12,401,456,109);
    cp.add(jsp2);
    button1.setText("Send");
    button1.setEnabled(false);
    cp.add(button1);
    button1.setBackground(java.awt.Color.lightGray);
    button1.setForeground(java.awt.Color.black);
    button1.setFont(new Font("Dialog", Font.BOLD|Font.ITALIC, 10));
    button1.setBounds(60,520,78,36);
    button2.setText("Attach");
    //button2.setEnabled(false);
    cp.add(button2);
    button2.setBackground(java.awt.Color.lightGray);
    button2.setForeground(java.awt.Color.black);
    button2.setFont(new Font("Dialog", Font.BOLD|Font.ITALIC, 10));
    button2.setBounds(180,520,72,36);
    button3.setText("Connect");
    cp.add(button3);
    button3.setBackground(java.awt.Color.lightGray);
    button3.setForeground(java.awt.Color.black);
    button3.setFont(new Font("Dialog", Font.BOLD|Font.ITALIC, 10));
    button3.setBounds(288,520,72,33);
    setSize(500,620);
    show();
    addWindowListener(new WindowEventHandler());
    button1.addActionListener(new ButtonHandler());
    button2.addActionListener(new ButtonHandler());
    button3.addActionListener(new ButtonHandler());
    textArea1.addContainerListener(new ComponentHandler());
    dtarget=new DropTarget(textArea1,new DragDropHandler());
    textArea2.setEnabled(false);
    textpanel.setEnabled(false);
    r1=Runtime.getRuntime();
    r1.addShutdownHook(new onshutdown());
    addMenu();
    cp.repaint();
    //adds attachments to the textArea1
    synchronized private void addAttach(java.util.List fileList)
    Iterator iterator=fileList.iterator();
    JButton bw;
    while(iterator.hasNext())
    File file=(File)iterator.next();
    Icon icon=chooser.getIcon(file);
    bw=new JButton(icon);
    bw.setBackground(java.awt.Color.gray);
    bw.setToolTipText(file.getAbsolutePath());
    bw.addMouseListener(new AttachmentHandler());
    Dimension d1=new Dimension(icon.getIconWidth(),icon.getIconHeight());
    bw.setMaximumSize(d1);
    hfiles.put(bw,file);
    textArea1.insertComponent(bw);
    textArea1.setCaretPosition(doc1.getLength());
    bw.setSize(icon.getIconWidth(),icon.getIconHeight());
    //only one file at a time
    break;
    cp.repaint();
    public void setAudioStream(ByteArrayOutputStream out)
    this.out=out;
    private void addMenu()
    JMenuBar mbar=new JMenuBar();
    mbar.setVisible(true);
    mbar.setBounds(0,0,500,20);
    mbar.setBackground(java.awt.Color.gray);
    //first menu
    JMenu m1=new JMenu("Connection");
    m1.setBounds(0,0,80,20);
    m1.setBackground(java.awt.Color.gray);
    JMenuItem mitem1=new JMenuItem("Connect");
    JMenuItem mitem2=new JMenuItem("Disconnect");
    m1.add(mitem1);
    m1.add(mitem2);
    mitem1.addActionListener(new ButtonHandler());
    mitem2.addActionListener(new ButtonHandler());
    mbar.add(m1);
    //second menu
    JMenu m2=new JMenu("Send...");
    m2.setBounds(90,0,80,20);
    m2.setBackground(java.awt.Color.gray);
    JMenuItem mitem3=new JMenuItem("Send");
    JMenuItem mitem4=new JMenuItem("Send with Audio...");
    mitem3.addActionListener(new ButtonHandler());
    mitem4.addActionListener(new ButtonHandler());
    m2.add(mitem3);
    m2.add(mitem4);
    mbar.add(m2);
    cp.add(mbar);
    private void setTextPaneStyle()
    StyleContext stylecontext =StyleContext.getDefaultStyleContext();
    defstyle=stylecontext.getStyle(StyleContext.DEFAULT_STYLE);
    doc= textpanel.getStyledDocument();
    //style 1
    style= textpanel.addStyle("bold",defstyle);
    StyleConstants.setBackground(style,Color.white);
    StyleConstants.setForeground(style,Color.blue);
    StyleConstants.setItalic(style, false);
    StyleConstants.setBold(style, true);
    StyleConstants.setFontSize(style,16);
    //style 2
    style= textpanel.addStyle("normal",defstyle);
    StyleConstants.setBackground(style,Color.white);
    StyleConstants.setForeground(style,Color.black);
    StyleConstants.setItalic(style, false);
    StyleConstants.setBold(style, false);
    StyleConstants.setFontSize(style,14);
    //style3
    style= textpanel.addStyle("attach",defstyle);
    StyleConstants.setBackground(style,Color.white);
    StyleConstants.setForeground(style,Color.red);
    StyleConstants.setItalic(style, true);
    StyleConstants.setBold(style, false);
    StyleConstants.setFontSize(style,12);
    //remote method called by server
    public void addClient(String alias,String group,JTree tree)
    //if old client remove old tree
    if(!alias.equals(""))
    cp.remove(this.jsp);
    //add new tree
    this.tree=tree;
    setTreeModel();
    getSound(2);
    if(!alias.equals(""))
    textArea2.append("\nNew Client:" + alias + "has joined");
    else
    textArea2.append("\nYou have been connected to the Server.");
    jsp=new JScrollPane(this.tree);
    jsp.setBounds(12,96,168,120);
    jsp.setBackground(java.awt.Color.lightGray);
    cp.add(jsp);
    this.tree.addMouseListener(new MouseHandler());
    //remote method called by server
    public void sendMessage(String str,Hashtable rfiles,String alias,String group) throws RemoteException
    receiveMessage(str,rfiles,alias,group);
    //remote method called by server
    public void removeClient(JTree tree,String alias,String group) throws RemoteException
    cp.remove(this.jsp);
    this.tree=tree;
    setTreeModel();
    getSound(3);
    jsp=new JScrollPane(this.tree);
    jsp.setBounds(12,96,168,120);
    jsp.setBackground(java.awt.Color.lightGray);
    cp.add(jsp);
    this.tree.addMouseListener(new MouseHandler());
    textArea2.append("\nClient:" + alias + "has disconnected");
    private void receiveMessage(String str,Hashtable rfiles,String alias,String group)
    boolean flag=true;
    UIManager.put("JFrame.activeTitleBackground", new Color(64,128,255));
    UIManager.put("JFrame.activeTitleForeground", Color.white);
    UIManager.put("JFrame.inactiveTitleBackground", new Color(128,128,128));
    UIManager.put("JFrame.inactiveTitleForeground", Color.black);
    SwingUtilities.updateComponentTreeUI(this);
    try{
    if(alias.equals(""))
    doc.insertString(doc.getLength(),"CHATMASTER>>",textpanel.getStyle("bold"));
    doc.insertString(doc.getLength(),str+ newline,textpanel.getStyle("normal"));
    else
    doc.insertString(doc.getLength(),alias + "@" + group + ">>",textpanel.getStyle("bold"));
    doc.insertString(doc.getLength(),str,textpanel.getStyle("normal"));
    //add files to textpanel
    if(rfiles!=null && rfiles.size()>0)
    doc.insertString(doc.getLength(),newline+"Attachments>>",textpanel.getStyle("attach"));
    showattach(rfiles);
    addtoList(rfiles);
    doc.insertString(doc.getLength(),newline,textpanel.getStyle("normal"));
    catch(Exception e)
    e.printStackTrace();
    dialog.showMessageDialog(client,e.toString(),"Error:ChatApplication",JOptionPane.ERROR_MESSAGE);
    cp.repaint();
    protected boolean ContactServer(String alias,String servername,String group)
    try{
    //UnicastRemoteObject.exportObject(this);
    //server=(ServerInterface)Naming.lookup("//gpt02d05:5500/" + servername);
    // server.notifyMe(this,alias,group);
    //change the settings of buttons
    button1.setEnabled(true);
    button2.setEnabled(true);
    button3.setText("Disconnect");
    label8.setVisible(true);
    label8.setText(" Welcome::" + alias);
    //putting values of alias and group for sending messages
    fromalias=alias;
    fromgroup=group;
    CONNECT=true;
    return true;
    catch(UnsupportedOperationException e)
    dialog.showMessageDialog(client,"Client with the Same Alias in " + group + " already exists","Error:ChatApplication",JOptionPane.ERROR_MESSAGE);
    try{
    // UnicastRemoteObject.unexportObject(client,true);
    catch(Exception ev){System.out.println(ev.toString());}
    catch(Exception e)
    dialog.showMessageDialog(client,"Unable to connect to Server","Error:ChatApplication",JOptionPane.ERROR_MESSAGE);
    try{
    // UnicastRemoteObject.unexportObject(client,true);
    catch(Exception ev){System.out.println(ev.toString());}
    return false;
    public static void main(String args[]) throws RemoteException{
    client=new Client();
    }//main ends
    public void getSound(int count)
    Toolkit t1=getToolkit();
    for(int i=0;i<count;i++)
    t1.beep();
    try{
    Thread.sleep(500);
    catch(Exception e){}
    public void setTreeModel()
    ImageIcon i1=new ImageIcon("Lock.gif","No Users");
    ImageIcon i2=new ImageIcon("Connec.gif","Users in Group");
    ImageIcon i3=new ImageIcon("authorbn.gif","An User");
    DefaultTreeCellRenderer dr1= new DefaultTreeCellRenderer();
    dr1.setClosedIcon(i1);
    dr1.setOpenIcon(i2);
    dr1.setLeafIcon(i3);
    dr1.setTextSelectionColor(java.awt.Color.red);
    tree.setCellRenderer(dr1);
    //add received files to the list
    private void addtoList(Hashtable rfiles)
    Enumeration filelist=rfiles.keys();
    while(filelist.hasMoreElements())
    File file=(File)filelist.nextElement();
    this.rfiles.put(file,rfiles.get(file));
    //show the attachments received
    private void showattach(Hashtable rfiles)
    Enumeration filelist=rfiles.keys();
    dsource=DragSource.getDefaultDragSource();
    JButton b1=null;
    while(filelist.hasMoreElements())
    File file=(File)filelist.nextElement();
    Icon icon=chooser.getIcon(file);
    b1=new JButton(icon);
    b1.setBackground(java.awt.Color.gray);
    b1.setToolTipText(file.getName());
    b1.addMouseListener(new AttachmentHandler());
    Dimension d1=new Dimension(icon.getIconWidth(),icon.getIconHeight());
    b1.setMaximumSize(d1);
    hfiles.put(b1,file);
    textpanel.setCaretPosition(doc.getLength());
    textpanel.insertComponent(b1);
    b1.setSize(icon.getIconWidth(),icon.getIconHeight());
    dsource.createDefaultDragGestureRecognizer(b1, DnDConstants.ACTION_COPY_OR_MOVE,new DragGestureHandler());
    cp.repaint();
    private void savefile(File file,Object parent)
    //ExtensionFileFilter filter = new ExtensionFileFilter(false);
    //filter.addExtension("txt",true);
    //chooser.setFileFilter(filter);
    int returnVal = chooser.showSaveDialog(client);
    if(returnVal ==JFileChooser.APPROVE_OPTION)
    try{
    FileOutputStream fstream=new FileOutputStream(chooser.getSelectedFile());
    //decide whether the file received or sent is to be saved
    if(((Container)parent).equals(textArea1))
    fstream.write((byte[])files.get(file));
    else
    fstream.write((byte[])rfiles.get(file));
    fstream.close();
    System.out.println(file.getName());
    catch(Exception e)
    {System.out.println(e.toString()); }
    private void openfile(File file,Object parent)
    File tempfile=null;
    try{
    String fname=file.getName();
    tempfile=File.createTempFile("temp",fname.substring(fname.lastIndexOf(".")));
    FileOutputStream fstream=new FileOutputStream(tempfile);
    System.out.println(tempfile.getAbsolutePath());
    //decide whether the file received or sent is to be saved
    if(((Container)parent).equals(textArea1))
    fstream.write((byte[])files.get(file));
    else
    fstream.write((byte[])rfiles.get(file));
    fstream.close();
    catch(Exception e){System.out.println(e.toString());}
    try{
    Process p1=r1.exec("cmd /c start " + tempfile.getAbsolutePath());
    p1.waitFor();
    catch(Exception e){System.out.println(e.toString());}
    //inner classes
    class ComponentHandler implements ContainerListener{
    public void componentRemoved(ContainerEvent ev)
    Container cont=(Container)ev.getChild();
    if(cont.getComponentCount()>0)
    JButton but=(JButton)cont.getComponent(0);
    files.remove((File)hfiles.get(but));
    hfiles.remove(but);
    public void componentAdded(ContainerEvent ev){}
    class AttachmentHandler extends MouseAdapter{
    public void mouseClicked(MouseEvent ev){
    if(ev.getModifiers()==4)
    Component comp=(Component)ev.getSource();
    File file=(File)hfiles.get(comp);
    popup=new JPopupMenu();
    JMenuItem popopen=new JMenuItem("Open");
    JMenuItem popsave=new JMenuItem("Save As..");
    popup.add(popopen);
    System.out.println(comp.getParent().getParent().getClass().toString());
    popopen.addActionListener(new ButtonHandler(file,comp.getParent().getParent()));
    popup.add(popsave);
    popsave.addActionListener(new ButtonHandler(file,comp.getParent().getParent()));
    popup.show(comp,12,12);
    class DragGestureHandler extends Vector implements DragGestureListener,DragSourceListener,Transferable{
    final static int FILE = 0;
    final static int STRING = 1;
    final static int PLAIN = 2;
    DataFlavor flavors[] = {DataFlavor.javaFileListFlavor,DataFlavor.stringFlavor,DataFlavor.plainTextFlavor};
    public void dragDropEnd(DragSourceDropEvent ev){}
    public void dragEnter(DragSourceDragEvent ev){}
    public void dragExit(DragSourceEvent ev){}
    public void dragOver(DragSourceDragEvent ev){}
    public void dropActionChanged(DragSourceDragEvent ev){}
    public void dragGestureRecognized(DragGestureEvent ev)
    System.out.println("recognized");
    File file=(File)hfiles.get(ev.getComponent());
    addElement(file);
    ev.startDrag(DragSource.DefaultCopyDrop,this,this);
    /* Returns the array of flavors in which it can provide the data. */
    public synchronized DataFlavor[] getTransferDataFlavors() {
    return flavors;
    /* Returns whether the requested flavor is supported by this object. */
    public boolean isDataFlavorSupported(DataFlavor flavor) {
    boolean b = false;
    b |=flavor.equals(flavors[FILE]);
    b |= flavor.equals(flavors[STRING]);
    b |= flavor.equals(flavors[PLAIN]);
    return (b);
    public synchronized Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException,IOException
    if(flavor.equals(flavors[FILE])){return this;}
    else if (flavor.equals(flavors[PLAIN])) {
    return new StringReader(((File)elementAt(0)).getAbsolutePath());
    } else if (flavor.equals(flavors[STRING])) {
    return((File)elementAt(0)).getAbsolutePath();
    } else {
    throw new UnsupportedFlavorException(flavor);
    //inner class for draging in the files on java frame
    class DragDropHandler implements DropTargetListener{
    public void dragEnter(DropTargetDragEvent ev){
    public void dragExit(DropTargetEvent ev){
    public void dragOver(DropTargetDragEvent ev){
    public void drop(DropTargetDropEvent ev){
    Transferable tf1=ev.getTransferable();
    DataFlavor fl[]=ev.getCurrentDataFlavors();
    if(ev.isDataFlavorSupported(DataFlavor.javaFileListFlavor))
    ev.acceptDrop (DnDConstants.ACTION_COPY_OR_MOVE);
    try{
    java.util.List fileList = (java.util.List)tf1.getTransferData(DataFlavor.javaFileListFlavor);
    Iterator iterator = fileList.iterator();
    while (iterator.hasNext())
    File file = (File)iterator.next();
    if(file.isFile())
    Icon icon=chooser.getIcon(file);
    FileInputStream fstream=new FileInputStream(file);
    int filedata=(new Double(file.length())).intValue();
    byte bytes[]=new byte[filedata];
    fstream.read(bytes);
    files.put(file,bytes);
    ev.getDropTargetContext().dropComplete(true);
    addAttach(fileList);
    catch(Exception e)
    {System.out.println(e.toString() + "here");}
    public void dropActionChanged(DropTargetDragEvent ev){
    class MouseHandler extends MouseAdapter{
    public void mouseClicked(MouseEvent me)
    TreePath tp=tree.getPathForLocation(me.getX(),me.getY());
    if(tp!=null)
    if(tp.getPathCount()==3)
    toalias=tp.getPathComponent(2).toString();
    togroup=tp.getPathComponent(1).toString();
    System.out.println(toalias);
    if (!(toalias.equals(fromalias) && togroup.equals(fromgroup)))
    System.out.println("hh " + toalias);
    label4.setText(tp.getPathComponent(2).toString() + "_@" + tp.getPathComponent(1).toString());
    class ButtonHandler implements ActionListener{
    private File file;
    private Object parent;
    //constructors
    public ButtonHandler()
    public ButtonHandler(File file,Object parent)
    this.file=file;
    this.parent=parent;
    //other functions
    public void actionPerformed(ActionEvent ev){
    String s=ev.getActionCommand();
    System.out.println(s);
    if(s.equals("Send with Audio..."))
    //Audio audio=new Audio(client,false,"CAPTURE");
    if(s.equals("Disconnect"))
    try{
    // server.disconnect(client);
    client.getSound(3);
    cp.remove(jsp);
    label6.setVisible(false);
    //UnicastRemoteObject.unexportObject(client,true);
    button3.setText("Connect");
    textArea2.append("\nYou have been disconnected to Server");
    client.repaint();
    catch(Exception e)
    System.out.println(e.toString());
    if(s.equals("Connect"))
    // clp=new ClientProperties(client,false);
    if(s.equals("Save As.."))
    savefile(file,parent);
    if(s.equals("Open"))
    openfile(file,parent);
    if(s.equals("Attach"))
    //ExtensionFileFilter filter = new ExtensionFileFilter(false);
    //filter.addExtension(".txt",true);
    //filter.setDescription("Text Files(.txt)");
    // chooser.setFileFilter(filter);
    chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
    //chooser.setMultiSelectionEnabled(true);
    int returnVal = chooser.showOpenDialog(client);
    if(returnVal ==JFileChooser.APPROVE_OPTION)
    //File fp[]=chooser.getSelectedFiles();
    File fp[]=new File[1];
    fp[0]=chooser.getSelectedFile();
    int i=0;
    while(i<fp.length)
    try{
    File file=fp[0];
    Icon icon=chooser.getIcon(file);
    FileInputStream fstream=new FileInputStream(file);
    int filedata=(new Double(file.length())).intValue();
    byte bytes[]=new byte[filedata];
    fstream.read(bytes);
    files.put(file,bytes);
    catch(Exception e){dialog.showMessageDialog(client,e.toString(),"Error:ChatApplication",JOptionPane.ERROR_MESSAGE);
    return; }
    i++;
    java.util.List fileList=Arrays.asList(fp);
    addAttach(fileList);
    if(s.equals("Send"))
    try{
    if(toalias==null)
    dialog.showMessageDialog(client,"Select the Recepient First!!","Error:ChatApplication",JOptionPane.ERROR_MESSAGE);
    return;
    if(toalias!=null && togroup!=null && (!toalias.equals(fromalias)))
    // server.sendMessage(textArea1.getText(),files,toalias,togroup,fromalias,fromgroup);
    textArea1.setText("");
    catch(Exception e)
    e.printStackTrace();
    }//if ends
    class WindowEventHandler extends WindowAdapter{
    public void windowClosing(WindowEvent ev){
    try{
    //server.disconnect(client);
    client.getSound(3);
    // UnicastRemoteObject.unexportObject(client,true);
    catch(Exception e){System.out.println(e.toString());}
    dispose();
    private class onshutdown extends Thread{
    public void run(){
    try{
    //server.disconnect(client);
    //UnicastRemoteObject.unexportObject(client,true);
    catch(Exception e){}
    }//run ends
    I hope this helps,
    Denis

  • How can i run oralce copy command with in sql j code [urgent]

    I try it but it give me error inavalid sql command etc
    i need help urgent

    http://www.oracle.com/technetwork/database/enterprise-edition/calling-shell-commands-from-plsql-1-1-129519.pdf

  • Can't run project because of error in code

    I was working on a project and started creating a scroll panel per the instructions at http://forums.adobe.com/message/2295900#2295900
    After creating the scroll panel, I tried running the project and it told me I couldn't run it because of a code error.  Looking at the problems panel, I got an error that said "Open quote is expected for attribute "id"." I wanted to work backward to see what was causing the problem and reverted the panel back to artwork and got the same error in the line for my scroll bar, so I reverted that and got it for my track shape, and reverted that (it had reverted to a button earlier, not sure why), and I got the error for my thumb, so I reverted that (a button again), ran the project and got the error for the text I was using as scrolling content, etc....
    It seems like I'm getting this error everywhere with all the elements I need for my scroll panel, and it seems to be moving from element to element.  I'm not a coder so I'm wary of getting in there and changing  things.  What could be the problem?
    I can't seem to attach my project because it is too big (5.2 MB) and zipping it doesn't reduce it's size.
    Any help would be greatly appreciated!
    -Ryan

    I created a new project and went through the same steps that led to my bug; however I wasn't able to recreate the bug.  Here is the project anyway, and here are the step i took:
    import an swf into the project, (it's a looping video)
    created text, using text tool.
    drew a line, using the line drawing tool
    -changed the weight
    -made it gradient
    -tweaked the gradient colors
    Imported a .psd file of thumb, moved it over the line i drew for the track
    converted the line and thumb into a vertical scroll bar
    -assigned parts (line to track, thumb to thumb)
    imported a .psd image that's called whitefeather, to act as a top and bottom border
    project running
    -converted scroll bar, text, and border to scroll panel
    -Assigned the text as the scrolling content
    -tweaked the scrolling content are, made it a little bigger
    ran project.

  • Can anybody help with some subtleties to this code?

    Hello,
    I was wondering if anyone could take a look at the code in general for me, which is to go in an 'effects' pedal.  The first while loop is for a footswitch that either reads high or low.  It controls the mode of the pedal.  the first mode is the default, where no signal manipulation occurs, and what comes in the audio input just comes out; the second mode stores data (fundamental frequency, average FFT amplitude from 3 kHz to 5 kHz) from the E string of a guitar, which is plucked after that mode is actuated; the third mode does the same for the A string; and the final mode takes in a note on the E or string, recognizes it as either on the E or A string, and adjusts the frequency content to be in tune based the data stored in modes 2 and 3.  then the new magnitude vector is put through an inverse FFT and output through the DAC and sounded.
    What I'm curious to know is, are there any blatant errors I've made?  Will the signal coming out of the inverse FFT be sounded through the DAC? does it need to be changed from a double to an I32?  I am trying to debug, but right now I'm having problems getting the correct output voltages on the Blackfin (the SPORT 0 pinout doesn't seem to match what is on the board....).
    also, I was wondering if I will lose any phase information on the signal that I get out compared to the signal I put in.  Will it be detectable by ear?  Or would it all sound the same?  along with the phase change for some signals, using an inverse FFT resulted in a loss of amplitude (from about 1 to on the order of 10^-5.  that's a lot!).  but when the test program was played on my computer, the phase change was not noticeable from the output signal, and neither was the magnitude change!  the output played at the same volume as in the input, despite the waveform chart on the front panel showing an amplitude five orders of magnitude less!  can you help explain that to me?  what can I do, will it matter coming out of the Blackfin and into an amplifier?
    i appreciate any input anyone can give me on all this!!  thank you!!
    Attachments:
    102 project.vi ‏287 KB

    Hi noahgrant,
    I've had a look at your vi and can make some suggestions that you can try.
    From what I can see, your while loop with the wait timer of 100 ms and continue if true condition on it (we shall cool this loop 1) will always keep running.
    The other while loop (loop 2) is nested within a couple of case structures and will only run once (false to a continue if true condition). The default case has a different condition and will always run, instead.
    From what I can make of this, loop 2 and all its case structures will only run once (except for case 0, default). WHEN it runs will depend on how it was compiled on the Blackfin - case structure/loop2 may go first or loop 1 will go first.
    If you want loop 2 to go first (and only go once) then you need to link the output of the case structure to the input of loop 1 - this can be done by simply wiring up a boolean to it (data flow rules).
    If you want loop 2 to always be checking the status of the mode then you need to place the whole case structure within a while loop, to run continuously.
    That is a very quick interpretation of what you are trying to do. There are a lot of question marks (missing vi's) and some heavy use of local variables. I would consider using sub-vi's, in particular functional global variables (FGV's).
    I hope that helps.

  • Can anybody help on sending mail through Java Code

    I am trying to send the mail using the java code and I am unable to do it. My code is
    import java.io.*;
    import java.net.*;
    import java.util.*;
    import java.text.*;
    public class EmailExample {
    public static void main(String[] args)
    Socket smtpSocket;
    DataOutputStream os;
    BufferedReader is;
    Date dDate = new Date();
    DateFormat dFormat = DateFormat.getDateInstance(DateFormat.FULL,Locale.US);
    try
    smtpSocket = new Socket("www.gmail.com",80);
    os = new DataOutputStream(smtpSocket.getOutputStream());
    is = new BufferedReader(new InputStreamReader(smtpSocket.getInputStream()));
    System.out.println("Hi How is this?");
    os.writeBytes("HELLO\r\n");
    // You will add the email address that the server
    // you are using know you as.
    os.writeBytes("MAIL From: <[email protected]>\r\n");
    // Who the email is going to.
    os.writeBytes("RCPT To: <[email protected]>\r\n");
    //IF you want to send a CC then you will have to add this
    //os.writeBytes("RCPT Cc: <[email protected]>\r\n");
    // Now we are ready to add the message and the
    // header of the email to be sent out.
    os.writeBytes("DATA\r\n");
    os.writeBytes("X-Mailer: Via Java\r\n");
    os.writeBytes("DATE: " + dFormat.format(dDate) + "\r\n");
    System.out.println("DATE: " + dFormat.format(dDate) + "\r\n");
    os.writeBytes("From: Me <[email protected]>\r\n");
    os.writeBytes("To: YOU <[email protected]>\r\n");
    //Again if you want to send a CC then add this.
    //os.writeBytes("Cc: CCDUDE <[email protected]>\r\n");
    //Here you can now add a BCC to the message as well
    //os.writeBytes("RCPT Bcc: BCCDude<[email protected]>\r\n");
    String sMessage = "Your subjectline here";
    os.writeBytes("Subject: Your subjectline here\r\n");
    os.writeBytes(sMessage + "\r\n");
    os.writeBytes("\r\n.\r\n");
    os.writeBytes("QUIT\r\n");
    // Now send the email off and check the server reply.
    // Was an OK is reached you are complete.
    String responseline;
    while((responseline = is.readLine())!=null)
    {   System.out.println(responseline);
    if(responseline.indexOf("Ok") != -1)
    break;
    } catch (IOException e) {
    e.printStackTrace();
    It is compiling and runnung properly. Please Help me on this.
    Thanks.
    Satya.

    You're mishandling the responses. You terminate if you don't get an "Ok" string, but that's not how success is defined - you should get a 200 code back, typically with an "OK" (not caps) message.
    It doesn't help that you're ignoring all of the server output after each command, so you never find out if anything goes wrong.
    You're also reinventing a wheel. The JavaMail API exists for this: http://java.sun.com/products/javamail/

  • Can anybody suggest me how to creat match code id and object

    hi Gurus,
    can any body suggest me how to create match code object and match code id..
    in my program i need specific values in search help..
    to avoid confusion in selecting the values.
    i need only selcted values..
    thanks in advance.
    vijay chavan

    Hi
    In Older SAP versions Match codes are used, now they are replaced by SEARCH HELPs
    there 2 types of search helps
    Elementary and Collective
    see the doc and create accordingly
    1) Elementary search helps describe a search path. The elementary search help must define where the data of the hit list should be read from (selection method), how the exchange of values between the screen template and selection method is implemented (interface of the search help) and how the online input help should be defined (online behavior of the search help).
    2) Collective search helps combine several elementary search helps. A collective search help thus can offer several alternative search paths.
    3)An elementary search help defines the standard flow of an input help.
    4) A collective search help combines several elementary search helps. The user can thus choose one of several alternative search paths with a collective search help.
    5)A collective search help comprises several elementary search helps. It combines all the search paths that are meaningful for a field.
    6)Both elementary search helps and other search helps can be included in a collective search help. If other collective search helps are contained in a collective search help, they are expanded to the level of the elementary search helps when the input help is called.
    CREATION:
    Go to SE11  Tcode
    select search help
    give the 'z' search help name and create
    select the selection method ur table name eg : 'mara'
    dialog module 'display value immediately'.
    add the field whatever u want and lpos = 1 and spos = 1 and check import and export parameter.
    where left position when displaying and spos = search position
    and then save and activate ..
    See the links:
    http://help.sap.com/saphelp_nw04/helpdata/en/cf/21ee38446011d189700000e8322d00/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/cf/21ee45446011d189700000e8322d00/content.htm
    https://forums.sdn.sap.com/click.jspa?searchID=3173469&messageID=2176485
    https://forums.sdn.sap.com/click.jspa?searchID=3173469&messageID=3601619
    pls go through this for search help creation
    http://help.sap.com/saphelp_nw2004s/helpdata/en/41/f6b237fec48c67e10000009b38f8cf/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/cf/21ee2b446011d189700000e8322d00/content.htm
    Search Help Exits:
    Re: dynamic values for search help
    Re: Dynamic search  help
    http://help.sap.com/saphelp_nw04/helpdata/en/cf/21ee52446011d189700000e8322d00/content.htm
    http://www.sapdevelopment.co.uk/dictionary/shelp/shelp_exit.htm
    https://forums.sdn.sap.com/click.jspa?searchID=4390517&messageID=1712818
    Collective search help Combine several elementary search helps. A collective search help thus can offer several alternative search paths.
    A Collective search help provides alternative search
    Paths by combining elementary search helps.
    Only one search help can be attached to a field, table or data element. Several search paths are therefore attached with a collective search help.
    A collective search help also has interface parameters like
    an elementary search help.
    Like an elementary search help, a collective search help has an interface of IMPORT and EXPORT parameters with which the search help exchanges data. Using this interface, the collective search help can be attached to fields, tables and data elements exactly like an elementary search help.
    Parameter assignment needs to be done for each of the
    Included search helps.
    When you define a collective search help, there are no components for describing the dialog behavior and data selection; instead the included search helps are listed here. You must assign the parameters of the collective search help to the interface parameters of the included search help for each inclusion.
    User may choose the tab and thus the elementary
    search maethod.
    When we execute the search help SCUSTOM, we are confronted with a dialog which gives us an option of either restricting
    By 1)Search for customer according to booking
    2)Search for customer according to name.
    These are effectively the elementary search helps (SCUSTOM_BOOK and SCUSTOM_NAME) which have been included in the collective search help SCUSTOM.
    HOT KEY
    The hot key is used to select the elementary search help from the collective search help and to enter the restrictions in the dialog box for restricting values directly from the entry field. If the user often searches for values using the same search help, this procedure can save time.
    Steps to create a Collective Search Help
    1)Enter the search help name and click on create.
    2)Choose Collective search help radio button option as the search help type.
    3)Enter the search help parameters.
    4)Instead of the selection method, we enter the included
    search helps for the collective search help.
    5)We need to assign parameters for each of the included
    search helps.
    6)Complete the parameter assignment by clicking on the push button
    7)Collective search help offers the user to obtain F4 help
    using any of the included search helps.
    Regards
    Anji

  • Can anybody help me and find why that code cause that exception

    Hi
    I'm standing whole the day finding out why that code cause the following exception but i couldn't so any help
    The exception:
    Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space
    package simulation;
    import javax.swing.*;
    import java.io.*;
    import java.lang.*;
    import java.math.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    import java.util.*;
    * @author Enegm
    public class Main {
       void InitGui()
           f=new JFrame("Simulation");
           f.setBounds(200,200,300,200);
           f.setLayout(null);
           l1=new JLabel("<html>\u03b2<sub>a</sub></html>");
           l2=new JLabel("<html>\u03b2<sub>s</sub></html>");
           l3=new JLabel("The number of delaies desired");
           t2=new JTextField();
           t1=new JTextField();
           t3=new JTextField();
           b1=new JButton("Simulate");
            Draw d;
            b1.addActionListener(new
                ActionListener()
                    public void actionPerformed(ActionEvent event)
                        //Main m=new Main();
                        new Thread()
                            public void run()
                    Draw();
                   //  Draw1();
                            }}.start();
    //                     f1=new JFrame("Q(t) vs t");
    //                    float MX=MaxX(QT);
    //                    float MY=MaxY(QT);
    //                   d=new Draw(MX,MY,QT,BT);
    //                    d.setBounds(10,10,580,280);
    //                    d.setBackground(Color.WHITE);
    //                    f1.setLayout(null);
    //                    f1.setBounds(50,0,610,340);
    //                    f1.getContentPane().add(d);
    //                    f1.setVisible(true);
           l1.setBounds(50,50,30,50);
           t1.setBounds(90,60,30,20);
           l2.setBounds(150,50,30,50);
           t2.setBounds(190,60,30,20);
           b1.setBounds(100,130,100,30);
           l3.setBounds(30,100,175,20);
           t3.setBounds(210,100,30,20);
           f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
           f.getContentPane().add(l1);
           f.getContentPane().add(t1);
           f.getContentPane().add(l2);
           f.getContentPane().add(t2);
           f.getContentPane().add(l3);
           f.getContentPane().add(t3);
           f.getContentPane().add(b1);
           f.setVisible(true);
        public Main() {
         * @param args the command line arguments
        public static void main(String[] args) {
            Main m=new Main();
            m.InitGui();
              r=new Random();
    //          while(true)
    //              if(flag==1)
    //                 m.Draw();
    //        int NEv;
    //        r=new Random();
    //        m.Initialize();
    //        while(ND<=Integer.parseInt(t3.getText()));
    //            NEv=m.TimingRoutine();
    //            if(NEv==0)
    //                m.Arrival();
    //            else
    //                m.Departure();
       public void Initialize()
            SS=false;
            NIQ=0;
            TOLE=0;
            ND=0;
            TD=0;
             float temp1=Float.parseFloat(t1.getText());
            EList[0]=-temp1*((float)(Math.log(r.nextFloat())));
            EList[1]=(float)10e6;
            CLK=0;
            QT=new Vector<Point2D>(100);
            BT=new Vector<Point2D>(100);
       public  void Draw()
           System.out.println(""+java.lang.Runtime.getRuntime());
           int NEv;
                     ND=0;
                      Initialize();
            while(ND<Integer.parseInt(t3.getText()))
                NEv=TimingRoutine();
                if(NEv==0)
                   Arrival();
               else
                    Departure();
                     // System.out.println("ADSDDA SAD");
                       f1=new JFrame("Q(t) vs t");
                        float MX=MaxX(QT);
                        float MY=MaxY(QT);
                        d=new Draw(MX,MY,QT,BT,1);
                        d.repaint();
                        d.setBounds(10,10,600,280);
                        d.setBackground(Color.WHITE);
                        f1.setLayout(null);
                        f1.setBounds(50,0,630,340);
                        f1.getContentPane().add(d);
                        f1.setVisible(true);
                           System.out.println(""+java.lang.Runtime.getRuntime());
        public  void Draw1()
           System.out.println(""+java.lang.Runtime.getRuntime());
           int NEv;
                     ND=0;
                      Initialize();
            while(ND<Integer.parseInt(t3.getText()))
                NEv=TimingRoutine();
                if(NEv==0)
                   Arrival();
               else
                    Departure();
                     // System.out.println("ADSDDA SAD");
                       f1=new JFrame("B(t) vs t");
                        float MX=MaxX(QT);
                        float MY=MaxY(QT);
                        d=new Draw(MX,MY,QT,BT,0);
                        d.repaint();
                        d.setBounds(10,10,600,280);
                        d.setBackground(Color.WHITE);
                        f1.setLayout(null);
                        f1.setBounds(50,350,630,340);
                        f1.getContentPane().add(d);
                        f1.setVisible(true);
                           System.out.println(""+java.lang.Runtime.getRuntime());
       public void Arrival()
           float AT=EList[0];
           float temp1,temp2;
           temp1=Float.parseFloat(t1.getText());
           temp2=Float.parseFloat(t2.getText());
         Point2D state,state1;
           EList[0]=(-temp1*((float)Math.log((r.nextFloat()))))+AT;
          if(SS==true)
              NIQ+=1;
              state=new Point2D.Float(CLK,1);
            //  state.setLocation(CLK,1);
          else
              TD=0;
              ND+=1;
              SS=true;
              EList[1]=(-temp2*((float)Math.log(r.nextFloat())))+CLK;
              state=new Point2D.Float(CLK,1);
              //state.setLocation(CLK,1);
          state1=new Point2D.Float(CLK,NIQ);
        //  state1.setLocation(CLK,NIQ);
            QT.add(state1);
          BT.add(state);
       public void Departure()
           Point2D state,state1;
           float temp=Float.parseFloat(t2.getText());
           if(NIQ==0)
               SS=false;
               state=new Point2D.Float(CLK,0);
              // state.setLocation(CLK,0);
           else
               NIQ--;
               ND++;
               //temp=TOA.remove(0);
               SS=true;
                EList[1]=(-temp*((float)Math.log((r.nextFloat()))))+CLK;
                state=new Point2D.Float(CLK,0);
                // state.setLocation(CLK,0);
              state1=new Point2D.Float(CLK,NIQ);
               //state1.setLocation(CLK,NIQ);
            QT.add(state1);
            BT.add(state);
       public int TimingRoutine()
           int NE;
           if(EList[0]<EList[1])
           {   CLK=EList[0];
               return 0;}
           else
           {   CLK=EList[1];
               return 1;}
       public float MaxX(Vector<Point2D> pts)
           int len =pts.size();
           float Max=0;
           float temp=0;
           for(int i=0;i<len;i++)
               temp=(float)pts.get(i).getX();
               if(Max<temp)
               Max=temp;
           return Max;
        public float MaxY(Vector<Point2D> pts)
           int len =pts.size();
           float Max=0;
           float temp=0;
           for(int i=0;i<len;i++)
               temp=(float)pts.get(i).getY();
               if(Max<temp)
               Max=temp;
           return Max;
      public static Random r;
      public static JFrame f; 
      public static JFrame f1; 
      public static JLabel l1;
      public static JTextField t1;
      public static JLabel l2;
      public static JTextField t2;
      public static JButton b1;
      public static JLabel l3;
      public static JTextField t3;
      public static boolean SS;
      public static int NIQ;
      public static float TOLE;
      public static int ND;
      public static float TD;
      public static Draw d;
      public static Vector<Point2D>QT;
      public static Vector<Point2D>BT;
      public static Vector<Float>TOA;
      public float[] EList=new float[2];
      public static float CLK;
      public static int flag=0;
    class Draw extends JPanel
        public Draw(float x,float y,Vector<Point2D> QT,Vector<Point2D> BT,int dif)
           MX=x;
           MY=y;
           this.QT=QT;
           this.BT=BT;
           this.dif=dif;
        public void paintComponent(Graphics g)
            super.paintComponent(g);
       Graphics2D g2=(Graphics2D) g;
        Line2D L;
        if(dif==1)
        Draw(g2);
        else
              Draw1(g2);
          return;
        public void Draw(Graphics2D g2)
            Line2D L;
            java.text.DecimalFormat dfm = new java.text.DecimalFormat("00.##");
        float tempx,tempy,x,y;
      g2.setColor(Color.BLACK);
      g2.drawLine(0,260,600,260);
      g2.drawLine(10,0,10,280);
      g2.drawLine(578,255,600,260);
      g2.drawLine(578,265,600,260);
       x=(float)((QT.get(0).getX()*580)/MX);
      y=(float)((QT.get(0).getY()*260)/MY);
      int stepx=(int)(580/10+10);int stepy=(int)(260/10);
      String stepx1=""+(int)(MX/10);String stepy1=""+(int)(MY/10);
      String tempc="";
      if((int)(MX/10)==0)
          stepx1=dfm.format(MX/10);;
      if((int)(MY/10)==0)
          stepy1=dfm.format(MY/10);
      int temp=10;double temp1=0;
      for(int i=0;i<10;i++)
          if(temp1>MX)
              break;
          g2.drawString(""+temp1,(int)temp,270);
          temp=temp+stepx;
          temp1=temp1+Double.parseDouble(stepx1);
          tempc=dfm.format(temp1);
          temp1=Double.parseDouble(tempc);
      temp=0;temp1=0;
      for(int i=0;i<10;i++)
          g2.drawString(""+temp1,0,260-temp);
          temp=temp+stepy;
          temp1=temp1+Double.parseDouble(stepy1);
           tempc=dfm.format(temp1);
          temp1=Double.parseDouble(tempc);
       g2.setColor(Color.blue);
      for(int i=1;i<QT.size();i++)
         tempx=(float)((QT.get(i).getX()*580)/MX+10);
         tempy=(float)((QT.get(i).getY()*260)/MY);
         L=new Line2D.Float(x,260-y,tempx,260-y);
          g2.draw(L);
         L=new Line2D.Float(tempx,260-y,tempx,260-tempy);
         g2.draw(L);
    //     g2.drawLine(10,10,260,10);
    //     g2.drawString(""+QT.get(i).getX(),tempx,260);
         x=tempx;y=tempy;  
         public void Draw1(Graphics2D g2)
            Line2D L;
            java.text.DecimalFormat dfm = new java.text.DecimalFormat("00.##");
        float tempx,tempy,x,y;
      g2.setColor(Color.BLACK);
      g2.drawLine(0,260,600,260);
      g2.drawLine(10,0,10,280);
      g2.drawLine(578,255,600,260);
      g2.drawLine(578,265,600,260);
       x=(float)((BT.get(0).getX()*580)/MX);
      y=(float)((BT.get(0).getY()*260)/MY);
      int stepx=(int)(580/10+10);int stepy=(int)(260/10);
      String stepx1=""+(int)(MX/10);String stepy1=""+(int)(MY/10);
      String tempc="";
      if((int)(MX/10)==0)
          stepx1=dfm.format(MX/10);;
      if((int)(MY/10)==0)
          stepy1=dfm.format(MY/10);
      int temp=10;double temp1=0;
      for(int i=0;i<10;i++)
          if(temp1>MX)
              break;
          g2.drawString(""+temp1,(int)temp,270);
          temp=temp+stepx;
          temp1=temp1+Double.parseDouble(stepx1);
          tempc=dfm.format(temp1);
          temp1=Double.parseDouble(tempc);
      temp=0;temp1=0;
      for(int i=0;i<10;i++)
    //      if(temp1>MY)
    //          break;
    //      if((temp1-(int)temp1)!=0)
    //          continue;
          g2.drawString(""+temp1,0,260-temp);
          temp=temp+stepy;
          temp1=temp1+Double.parseDouble(stepy1);
           tempc=dfm.format(temp1);
          temp1=Double.parseDouble(tempc);
       g2.setColor(Color.blue);
      for(int i=1;i<QT.size();i++)
         tempx=(float)((BT.get(i).getX()*580)/MX+10);
         tempy=(float)((BT.get(i).getY()*260)/MY);
         L=new Line2D.Float(x,260-y,tempx,260-y);
          g2.draw(L);
         L=new Line2D.Float(tempx,260-y,tempx,260-tempy);
         g2.draw(L);
    //     g2.drawLine(10,10,260,10);
    //     g2.drawString(""+QT.get(i).getX(),tempx,260);
         x=tempx;y=tempy;  
         public float MaxX(Vector<Point2D> pts)
           int len =pts.size();
           float Max=0;
           float temp=0;
           for(int i=0;i<len;i++)
               temp=(float)pts.get(i).getX();
               if(Max<temp)
               Max=temp;
           return Max;
        public float MaxY(Vector<Point2D> pts)
           int len =pts.size();
           float Max=0;
           float temp=0;
           for(int i=0;i<len;i++)
               temp=(float)pts.get(i).getY();
               if(Max<temp)
               Max=temp;
           return Max;
    public static JFrame f1;
    public static JFrame f2;
    public static float MX;
    public static float MY;
    public static Vector<Point2D> QT;
    public static Vector<Point2D> BT;
    public static int dif;

    Hard to tell. Somewhere you're creating objects without ever releasing them. Are you endlessly adding to a list or something?
    System.out.println(""+java.lang.Runtime.getRuntime());What are those calls good for?
    And may I suggest you to stick to the Java coding conventions (lower-case method and variable names) and generally find better names for your classes and methods?

  • Can anybody help me in fixing the problem ? of JTable ( CODE GIVEN )

    My problem is
    1)when i select the combo box (2nd column) through keyboard the selected item is not visible in the cell
    2) i need to press TAB key twice to go to next cell .
    3) also before editing i need to press a key to start editing (caret visible) HELP ME
    CODE CAN BE RUN TO SEE WHAT I MEANT
    <code>
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.table.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.util.Vector;
    import java.text.*;
    public class BaseTable
    public JScrollPane scrollPane;
         public JTable table;
         public int totalRows;
         public int i,numRows,numCols;
         public TableModel model;
         public int rowCount;
         public JComboBox box;
    public BaseTable()
              String[] items=new String[]{"item1","jItem2","kItem3","Item4","Item5","Item6"};
              String[] columns = {"Column1","Column2","Column3","Column4","Column5","Column6","Column7","Column8","Column9"};
              box=new JComboBox(items);
              box.setEditable(true);
    DefaultTableModel baseModel=new DefaultTableModel();
              baseModel.setColumnIdentifiers(columns);
    table = new JTable(baseModel)
                   protected void processKeyEvent(KeyEvent e)
                        if ( e.getID() == KeyEvent.KEY_PRESSED && e.getKeyCode() != e.VK_TAB)
                             int column = table.getSelectedColumn();
                             int row = table.getSelectedRow();
                             Rectangle r = getCellRect(row, column, false);
                             Point p = new Point( r.x, r.y );
                             SwingUtilities.convertPointToScreen(p, table);
                             try
                                  System.out.println("PROCESS KEY EVENT Typing"+e.getKeyCode());
                                  Robot robot = new Robot();
                                  robot.mouseMove(p.x, p.y );
                                  robot.mousePress(InputEvent.BUTTON1_MASK);
                                  robot.mouseRelease(InputEvent.BUTTON1_MASK);
                                  robot.mouseMove(0, 0 );
                             catch (Exception e2) {}
                        else
                             System.out.println("PROCESS KEY EVENT IN ELSE");
                             if(e.getKeyCode() == e.VK_TAB && table.isEditing())
                                  ((DefaultCellEditor)table.getCellEditor()).stopCellEditing();
                             else
                                  super.processKeyEvent(e);
    Vector vectorRow = new Vector();
              vectorRow.addElement("");
              vectorRow.addElement("");
              vectorRow.addElement("");
              vectorRow.addElement("");
              vectorRow.addElement("");
              vectorRow.addElement("");
              vectorRow.addElement("");
              vectorRow.addElement("");
              vectorRow.addElement("");
              TableCellEditor tableCellEditor_comboBox = new MyCustomTableCellEditor(box,this);
              table.getColumnModel().getColumn(1).setCellEditor(tableCellEditor_comboBox);
              ((DefaultTableModel)table.getModel()).addRow(vectorRow);
              rowCount = table.getRowCount();
              ((DefaultTableModel)table.getModel()).fireTableRowsInserted(rowCount,rowCount);
              scrollPane = new JScrollPane(table);
              scrollPane.setForeground(Color.white);
              rowCount = table.getRowCount();
    numCols = table.getColumnCount();
    public class MyCustomTableCellEditor extends DefaultCellEditor
                   JTable table=null;
                   BaseTable baseTable=null;
                   JComboBox box=null;
                   MyCustomTableCellEditor(JComboBox editorComponent,BaseTable baseTable)
                        super(editorComponent);
                        this.table=baseTable.table;
                        this.baseTable=baseTable;
                        setClickCountToStart(0);
                   public Component getTableCellEditorComponent(
                        JTable table,
                        Object value,
                        boolean isSelected,
                        int row,
                        int column)
                             super.getTableCellEditorComponent(table,value,isSelected,row,column);
                             box=(JComboBox)getComponent();
                             box.putClientProperty("JComboBox.isTableCellEditor", Boolean.TRUE);
                             return box;
         public static void main(String s1[])
              BaseTable t=new BaseTable();
              JFrame f=new JFrame();
              f.getContentPane().add(t.scrollPane);
              f.setSize(800,200);
              f.setVisible(true);
    </code>

    sahas@sun, you're very impolite! farukkhan was trying to help, and he's right because when you use code formatting the code is really easier to read.
    Perhaps you have lost a chance for getting the answer!

  • A Problem with the JavaScript Code can anybody help me

    Hi every body,
    I prepared a html page using the following code, which i grab it from some web site, and used it in my web project,
    but the code that is not working and it is showing some javascript error, can anybody correct it for me please, the code is as follows
    <html>
    <head>
    <title>Contact Form</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <style type="text/css">
    // CSS goes here
    </style>
    <script language="JavaScript">
    function checkForm()
       var cname, cemail, csubject, cmessage;
       with(window.document.msgform)
          cname    = sname;
          cemail   = email;
          csubject = subject;
          cmessage = message;
       if(trim(cname.value) == '')
          alert('Please enter your name');
          cname.focus();
          return false;
       else if(trim(cemail.value) == '')
          alert('Please enter your email');
          cemail.focus();
          return false;
       else if(!isEmail(trim(cemail.value)))
          alert('Email address is not valid');
          cemail.focus();
          return false;
       else if(trim(csubject.value) == '')
          alert('Please enter message subject');
          csubject.focus();
          return false;
       else if(trim(cmessage.value) == '')
          alert('Please enter your message');
          cmessage.focus();
          return false;
       else
          cname.value    = trim(cname.value);
          cemail.value   = trim(cemail.value);
          csubject.value = trim(csubject.value);
          cmessage.value = trim(cmessage.value);
          return true;
    function trim(str)
       return str.replace(/^\s+|\s+$/g,'');
    function isEmail(str)
       var regex = /^[-_.a-z0-9]+@(([-_a-z0-9]+\.)+(ad|ae|aero|af|ag|
    ai|al|am|an|ao|aq|ar|arpa|as|at|au|aw|az|ba|bb|bd|be|bf|bg|
    bh|bi|biz|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|
    ch|ci|ck|cl|cm|cn|co|com|coop|cr|cs|cu|cv|cx|cy|cz|de|dj|dk|
    dm|do|dz|ec|edu|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|
    gd|ge|gf|gh|gi|gl|gm|gn|gov|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|
    hr|ht|hu|id|ie|il|in|info|int|io|iq|ir|is|it|jm|jo|jp|ke|kg|
    kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|
    ma|mc|md|mg|mh|mil|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|museum|
    mv|mw|mx|my|mz|na|name|nc|ne|net|nf|ng|ni|nl|no|np|nr|nt|nu|
    nz|om|org|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|pro|ps|pt|pw|py|qa|
    re|ro|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|
    su|sv|sy|sz|tc|td|tf|tg|th|tj|tk|tm|tn|to|tp|tr|tt|tv|tw|tz|
    ua|ug|uk|um|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|yu|za|
    zm|zw)|(([0-9][0-9]?|[0-1][0-9][0-9]|[2][0-4][0-9]|[2][5][0-5])\.){3}([0-9][0-9]?|[0-1][0-9][0-9]|[2][0-4][0-9]|[2][5][0-5]))$/i;
    return regex.test(str);
    </script>
    </head>
    <body>
    <form method="post" name="msgform">
    <table width="500" border="0" align="center" cellpadding="2" cellspacing="1" class="maincell">
    <tr>
    <td width="106">Your Name</td>
    <td width="381"><input name="sname" type="text" class="box" id="sname" size="30"></td>
    </tr>
    <tr>
    <td>Your Email</td>
    <td>
    <input name="email" type="text" class="box" id="email" size="30">
    </td></tr>
    <tr>
    <td>Subject</td>
    <td><input name="subject" type="text" class="box" id="subject" size="30"></td>
    </tr>
    <tr>
    <td>Message</td>
    <td><textarea name="message" cols="55" rows="10" wrap="OFF" class="box" id="message"></textarea></td>
    </tr>
    <tr align="center">
    <td colspan="2"><input name="send" type="submit" class="bluebox" id="send" value="Send Message" onClick="return checkForm();"></td>
    </tr>
    <tr align="center">
    <td colspan="2"> </td>
    </tr>
    </table>
    </form>
    </body>
    </html>

    function isEmail(str)
       var regex = /^[-_.a-z0-9]+@(([-_a-z0-9]+\.)+(ad|ae|aero|af|ag|
    ai|al|am|an|ao|aq|ar|arpa|as|at|au|aw|az|ba|bb|bd|be|bf|bg|
    bh|bi|biz|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|
    ch|ci|ck|cl|cm|cn|co|com|coop|cr|cs|cu|cv|cx|cy|cz|de|dj|dk|
    dm|do|dz|ec|edu|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|
    gd|ge|gf|gh|gi|gl|gm|gn|gov|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|
    hr|ht|hu|id|ie|il|in|info|int|io|iq|ir|is|it|jm|jo|jp|ke|kg|
    kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|
    ma|mc|md|mg|mh|mil|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|museum|
    mv|mw|mx|my|mz|na|name|nc|ne|net|nf|ng|ni|nl|no|np|nr|nt|nu|
    nz|om|org|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|pro|ps|pt|pw|py|qa|
    re|ro|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|
    su|sv|sy|sz|tc|td|tf|tg|th|tj|tk|tm|tn|to|tp|tr|tt|tv|tw|tz|
    ua|ug|uk|um|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|yu|za|
    zm|zw)|(([0-9][0-9]?|[0-1][0-9][0-9]|[2][0-4][0-9]|[2][5][0-5])\.){3}([0-9][0-9]?|[0-1][0-9][0-9]|[2][0-4][0-9]|[2][5][0-5]))$/i;
    return regex.test(str);
    Remove all enter sequences inbetween lines in the above function. It vl work.
    All d Best :-)

  • Sattelite A110-178 cannot run the game The Da Vini Code

    My sattelite A110-178 can't run the game "The Da Vini Code". following error occurs:
    Exeption encountered! Would you like more info (will take several seconds to determine)?
    when I choose "yes", following lines appear:
    (Slayer)Exeption address
    [no game crash info]
    IMAGE HELP STACK:
    TArchive::operator=+A9D22
    MAP FILE STALKWALK:
    All I can do then is press "OK"
    the programm shuts down, and that's the end of it.
    I don't know what this means, is there a problem with my hard-or software?
    If anyone can help me, and translate my computers code-language, I'll be gratefull for that,
    because this is not a cheap game,
    thanks in advance,
    Davina
    Message was edited by: Davina Deleye

    Hi
    Firstly a question: Did you use the original game or maybe a copy?
    I have found some infos that some users get this error because they used not original game CD!
    But if it happens with the original and only with this single game so I presume there could be something wrong especially with the game compatibility.
    Maybe the game doesnt support the graphic driver version or something different.
    I dont know if you will find a exactly solution here in the forum because its especially a forum about common issue and problems with Toshiba units.
    Try to visit the support sites of the game manufacture. Maybe there you will find more details and FAQs about this game.

  • My new iPad2 won't sync with my MacBook running OS X 10.6.8 can anybody help please?

    I have just bought an iPad2 from eBay (great buy) but now find I can't sync it with my MacBook which is old and runs OS X 10.6.8 (Snow Leopard) I can't access my photos, music email etc.  Can anybody suggest a solution ?  Thanks

    Boot Camp Support Software 4.0.4033
    System Requirements  
    MacBook (13-in, Late 2006 & Mid 2007)
    MacBook (13-in, Late 2007)
    MacBook (13-in, Early 2008)
    MacBook (13-in, Late 2008)
    MacBook (13-in, Early 2009 & Mid 2009)
    MacBook (13-in, Late 2009)
    MacBook (13-in, Mid 2010)
    http://support.apple.com/kb/DL1630
    These are the Windows Support Software for your MacBook according to Apple.
    You can download them here:
    http://support.apple.com/downloads/DL1630/en_US/BootCamp4.0.4033.zip
    As I already had Windows 7 x32  installed on my MacBook and just upgraded to Windows 8 x32 it is difficult to say whether you can directly install Windows 8 x32 or have to do the upgrade Windows 7 x32 route.
    I would read this thread that applies to the installation of Windows 8 on non supported Macs.
    https://discussions.apple.com/thread/4897066
    This is for getting Windows 8 x64 installed but it may work for Win 8 x32 using the switching of the CD's from Windows 7 to Windows 8.
    I initially used my Windows BootCamp 3.0 drivers on the my Snow Leopard disc after using BootCamp 3.0 to install Windows 7 x32 so I would try using those 3.0 Windows drivers first and then upgrading to the Bootcamp 4.0.4033 drivers after you have booted into Windows 8.
    Also you might want to read this thread as well...
    https://discussions.apple.com/thread/4904594?start=0&tstart=0

  • Can anybody tell me that "is it possible to clean install os x 10.5 or 10.6 on a mac running 10.4.11"

    can anybody tell me that "is it possible to clean install os x 10.5 or 10.6 on a mac running 10.4.11"

    Hello Abdul,
    Yes it is, assuming your Mac can handle eother one, and you have the Retail Install Disc(s).
    Leopard requirements/10.5.x...
        *  Mac computer with an Intel, PowerPC G5, or PowerPC G4 (867MHz or faster) processor
    minimum system requirements
        * 512MB of memory (I say 1.5GB for PPC at least, 2-3GB minimum for IntelMacs)
        * DVD drive for installation
        * 9GB of available disk space (I say 30GB at least)
    You have to call Apple & likely ask for a Product Specialist to get it, if they still have it! Helps to tell them you have an iPad/iPhone & you can't run 10.6.
    There are workarounds if the 867MHz is the only hangup...
    http://sourceforge.net/projects/leopardassist/
    Snow Leopard/10.6.x Requirements...
    General requirements
       * Mac computer with an Intel processor
        * 1GB of memory (I say 2GB at least)
        * 5GB of available disk space (I say 30GB at least)
        * DVD drive for installation
        * Some features require a compatible Internet service provider; fees may apply.
        * Some features require Apple’s MobileMe service; fees and terms apply.
    Which apps work with Mac OS X 10.6?...
    http://snowleopard.wikidot.com/
    It looks like they might still have it...
    http://store.apple.com/us/product/MC573Z/A?fnode=MTY1NDAzOA
    So we know more about it...
    At the Apple Icon at top left>About this Mac, then click on More Info, then click on Hardware> and report this upto but not including the Serial#...
    Hardware Overview:
    Model Name: eMac
    Model Identifier: PowerMac6,4
    Processor Name: PowerPC G4 (1.2)
    Processor Speed: 1.42 GHz
    Number Of CPUs: 1
    L2 Cache (per CPU): 512 KB
    Memory: 2 GB
    Bus Speed: 167 MHz
    Boot ROM Version: 4.9.2f1

  • Ricoh Aficio SP C240 SF filter quit unexpectedly - running 10.9.3 on MacBook Air - can anybody help please?

    Problems with Ricoh Aficio SP C240 SF- message tells me  "filter quit unexpectedly" - running 10.9.3 on MacBook Air - can anybody help please?

    Steve --
    You have made an extra folder called "Internets" and put the Safari app in there.  It (and all other apps) need to be freestanding (not enclosed in another folder) in the HD > Applications folder.
    Because it's in this folder, it has not properly updated.  Running 10.8.2 OS, you should be up to 6.0 Safari.  But because it's in a folder, it's still way back there.

  • My macbook pro 15inch running on maverick when i try to click on wi-fi says no hardware installed please help i need wifi and and under network staus wi-fi is fail and under network airport is not connected can anybody help the wifi icon has a x and does

    my macbook pro 15inch running on maverick when i try to click on wi-fi says no hardware installed please help i need wifi and and under network staus wi-fi is fail and under network airport is not connected can anybody help the wifi icon has a x and does not even let me turn it on

    Have you attempted to reset the SMC? That would be the first step. Hold the left control, option, shift key and the power button for about 5 seconds and release. Then try to reboot. Might as well reset the PRAM as well. Hold command, option, P, R on start up until the machine restarts. If that doesnt' have any affect we'll have to dig deeper into a potential hardware failure.
    If this method doesn't work, check the webcam that will tell the problem is on the iSight & WiFi cable. If your webcam is ok, then it'll be the WiFi card problem. Hope it can help ;-)
    - xia_us9

Maybe you are looking for

  • Date functions in Oracle

    Hello I need to rewrite the following sql I used in MSSQL server to sql for Oracle: declare @lastmo_start datetime,      @lastmo_end datetime select @lastmo_start = dateadd(month, -1, getdate()) select @lastmo_end= dateadd(day, -1, getdate()) Basical

  • Can i install Adobe AIR on Samsung Galaxy S LCD I9003

    Hi, I wanted to know if we can install Adobe AIR on Samsung Galaxy S LCD I9003. The phone is powered by a 1GHz Cortex A8 CPU but I want to double check before buying this phone. The main purpose for buying this phone is to develop Android apps using

  • [SOLVED] Networking stopped working

    Hello, so this happened yesterday morning. I couldn't connect to wifi at school, but didn't think much of it as things like this sometimes happen (could've been problem on their side, or simply weak signal) and I wasn't using laptop later that day. T

  • Unable to set "Fit one full page to window" as scrolling default for every PDF

    I am trying to retain "Fit one full page to window" as default for every PDF so that when I open a document and scroll down once, it scrolls to the next full page, rather than chunks.  I then need to manually select the option from the menu bar, afte

  • Will not load mail message when clicking on mailto: link

    Firefox 7.0.1 on windows 7 pro & gmail. Up till recently I could click on an email address on a webpage and it would open a new message window where I could send a message. Now this does not work. Tried turning it off in "tools-options-applications"