How to use KeyEvent listeners

i made the progeam below to try to move a box around the screen by typing on the key bourd. but it doesnt work. what am i doing wrong.
import java.applet.Applet;
import java.awt.*;
import java.awt.event.*;
import java.awt.event.KeyEvent.*;
public class GTest extends Applet implements KeyListener{
     private int X,Y;
     public void paint(Graphics g){
          g.setColor(Color.black);
          g.drawRect(0,0,200,200);
          g.setColor(Color.white);
          g.fillRect(1,1,199,199);
          g.setColor(Color.black);
          g.fillRect(X,Y,X+10,Y+10);
     public void keyTyped(KeyEvent e){
     public void keyPressed(KeyEvent e){
          char c=e.getKeyChar();
          if(c=='5'){Y++;}
          else if(c=='2'){Y--;}
          else if(c=='3'){X++;}
          else if(c=='1'){X--;}
          repaint();
     public void keyReleased(KeyEvent e){}
}

Hey BigNester,
In the init() method of your applet, you have to add your class as a keyListener to your applet.
add the following methods:
// register this class as a key listener
public void init() {
addKeyListener(this);
// unregister this class as a key listener
public void destory() {
removeKeyListener(this);
Later,
Bud

Similar Messages

  • How to use Remote listeners

    I've been using RMI a lot recently and have found a pretty slick way to deal with listeners via Remote calls and I figured I would share this information with everyone as it might help someone or someone may have a better idea how to do this.
    Anyway, lets say you have a single server and multiple clients and those clients need to be notified whenever a certain event occurs. A simple chat server is a good example, whenever a new String message comes into the chat server, it needs to disseminate that String to all of its clients. To do this two Remote interfaces are needed, the first is the server and the second is for the clients remote listener.
    public interface IChatServer extends java.rmi.Remote {
        // Called by a client on the server when it wants to generate a new message
        public void sendMessage(String message) throws java.rmi.RemoteException;
        // Called by a client to add a new IChatServerListener to the server
        public void addChatServerListener(IChatServerListener listener) throws java.rmi.RemoteException;
        // Called by a client to remove a IChatServerListener from the server
        public void removeChatServerListener(IChatServerListener listener) throws java.rmi.RemoteException;
    public interface IChatServerListener extends java.rmi.Remote {
        // Called by the server whenever a new message is generated.
        public void newMessage(String message) throws java.rmi.RemoteException;
    }Ok, that sets up your two Remote interfaces, pretty simple. The next step is to implement the ChatServer object.
    public class ChatServer implements IChatServer {
        private Registry m_reg;
        private java.util.Vector m_listeners;
        public static final int REG_PORT = 4000;
        public static final String SERVER_NAME = "ChatServer";
        public ChatServer() {
            // This is where we will store all of the IChatServerListener objects
            m_listeners = new java.util.Vector();
        // Exports the server object, creates the RMI Registry and then binds the server into that Registry
        private void startServer() throws java.rmi.RemoteException {
            java.rmi.server.UnicastRemoteObject.exportObject(this);
            m_reg = java.rmi.registry.LocateRegistry.createRegistry(REG_PORT);
            m_reg.rebind(SERVER_NAME, this);
        public static void main(String[] args) {
            try {
                new ChatServer().startServer();
            // startServer() throws a RemoteException if something goes wrong so we need to deal with that
            catch(java.rmi.RemoteException re) {
                System.out.println("Failed to start server.");
                re.printStackTrace();
        // Implementation of the sendMessage(String) method from the IChatServer interface
        public void sendMessage(String message) {
            // Call our helper method that actually calls newMessage() on each of the listeners
            fireNewMessage(message);
        // Implementation of the addChatServerListener() method from the IChatServer interface
        public void addChatServerListener(IChatServerListener listener) {
            // Simply add the new listener to our Vector of listeners
            m_listeners.add(listener);
        // Implementation of the removeChatServerListener() method from the IChatServer interface
        public void removeChatServerListener(IChatServerListener listener) {
            // Simply remove the new listener to our Vector of listeners
            m_listeners.remove(listener);
        // Iterate over the Vector of listeners calling newMessage() on each one
        private void fireNewMessage(String message) {
            java.util.Iterator iter = m_listeners.iterator();
            while(iter.hasNext()) {
                IChatServerListener listener = (IChatServerListener)iter.next();
                try {
                    listener.newMessage(message);
                catch(java.rmi.ConnectException ce) {
                    System.out.println("Unable to Connect to Listener, removing it.");
                    iter.remove();
                catch(java.rmi.RemoteException re) {
                    re.printStackTrace();
    }Ok, most of that class is pretty straighforward, the only real complex stuff is in the startServer() method where the RMI Registry is created, and in the fireNewMessage() method. First an Iterator is generated from the Vector storing the IChatServerListener objects. Then we go into a while loop and pull out the next available IChatServerListener and try to call newMessage() on it. Note that this is a Remote call as it is calling the newMessage() method that is implemented within the clients so we must catch java.rmi.RemoteException. An explicit catch for java.rmi.ConnectException is used because it is not uncommon for clients to exit inappropriately or die unexpectedly. If this happens then we need to remove the IChatServerListener from our Vector so we dont get an exception every time a new message is generated. Note that you must use iter.remove() to remove the object while using an Iterator.
    Ok, now for the ChatClient class.
    public class ChatClient {
        private IChatServer m_chatServer;
        private IChatServerListener m_chatServerListener;
        public ChatClient() {
            m_chatServerListener = new IChatServerListener() {
                public void newMessage(String message) {
                    System.out.println("New message: " + message);
        private void connectToChatServer() throws java.rmi.RemoteException, javax.naming.NamingException {
            String connectString = new String("rmi://localhost:" + ChatServer.REG_PORT + "/");
            System.out.println("Attempting to connect to Chat Server on: " + connectString);
            InitialContext ic = new InitialContext();
            NamingEnumeration bindings = ic.listBindings(connectString);
            while (bindings.hasMore()) {
                Binding bd = (Binding)bindings.next();
                if(bd.getObject() instanceof IChatServer) {
                    m_chatServer = (IChatServer)bd.getObject();
            if(m_chatServer != null) {
                m_chatServer.addChatServerListener(m_chatServerListener);
                m_chatServer.sendMessage("HELLO!");
        public static void main(String[] args) {
            try {
                new ChatClient().connectToChatServer();
            catch(Exception e) {
                System.out.println("Failed to connect to Chat Server.");
                e.printStackTrace();
    }Ok, now two things are going on here. First, in the ChatClient constructor a new anonymous instance of IChatServerListener is created. It implements the single method newMessage() and simply does a System.out.println() to print out the incoming message. This is the actual object that is actually sent to the ChatServer (well, more appropriately, it's _Stub class is what's sent) and as such the newMessage() method will be called whenever the server receives a call to sendMessage().
    The real meat of this class comes in the connectToChatServer() method. The first thing the client must do is lookup the IChatServer instance in an RMI Registry somewhere. In this example I just use localhost for a ChatServer running on the same machine, but that is easy enough to change. A new InitialContext object is created to facilitate JNDI calls, then a list of all the bindings is retrieved. A binding is a String, Object pair where the String is the name the Object was bound under and the Object is a Remote Stub class.  In this case we are looking for an instance of IChatServer so as we are iterating over the list of bindings we check each bound object as an instanceof IChatServer and when one is found we assign it to our mchatServer member variable. Once a reference to the ChatServer has been obtained we must add our listener to it and then we send a message to all clients "HELLO!" which because it was called after we added our own listener we should receive that very same message.
    I know some of this can seem a bit complex and daunting, but it's very doable once you break it down piece by piece. If you have any problems or questions feel free to ask them here and I'll do my best to respond.

    I genuinely respect anyone who posts code to help others, so please do not interpret my responses as criticism, rather some things to think about; advice from an old-timer, if you will.
    Your current approach will get into trouble very easily. However with a little thought, it is fixable.
    In the online gaming vernacular, there is an attrocious misnomer, which unfortunately stuck, so I will use it here:
    - How can your design accomodate varying 'ping' times?
    For example, let's suppose a client connects to your chat server by dial-up, and yes these accounts still exist, those machines can be several orders of magnitude slower than your other clients. Your whole system will only go as fast as its slowest member. This was a big problem in early online games, so you are in very good company.
    - Calling a dead client will take several minutes or more!
    This is because a Sun's RMI implementation cannot easily distinguish between a disconnected client vs. a very slow one. Again, each one will delay your chat relays.
    Overall you have a very good initial design. If you think these issues through, and post your code here, I think you'll get some excellent help. Best of all, as you must have been thinking when you made this post, everyone reading along will also benefit.
    Highest regards!
    John

  • How 2 use KeyEvent 2 choose a JButton

    Basically I have a form with a textfield, an OK button n a Cancel button. How can I after key in the text in the textfield alredi n when I press enter it'll execute the command under the OK button?
    Below is my portion of the code
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class client extends JFrame
    JTextField msgField;
    JButton okButton, cancelButton;
    public client()
              super("Client");
              Container x = getContentPane();
              x.setLayout(new FlowLayout());
    msgField = new JTextField(15);
    okButton = new JButton("OK");
    cancelButton = new JButton("Cancel");
    msgField.requestFocus();
    x.add (msgField);
    x.add (okButton);
    x.add (cancelButton);
    actionHandler act = new actionHandler();
    okButton.addActionListener(act);
    setSize(200,150);
    setVisible(true);
    private class actionHandler implements ActionListener
         public void actionPerformed(ActionEvent e)
         if(e.getSource()==okButton)
    JOptionPane.showMessageDialog(null, "Hello " +
    msgField.getText());
    public static void main(String args[])
    client c = new client();
    c.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);     
    }

    If I use the first way (put the actionListener in the
    JTextField), how can I call the actionListener if I
    also has an actionListener 4 the cancelButton? In tat
    case I alredi cannot remove my if statement.Yeah, if you're going to use the same handler, you'll need the if statement then.

  • How to use KeyEvent in paint?

    I want to continue in the while loop till any key is pressed, after that make some changes in variable value and return to the while loop with repaint. here is the portion of my code.
              while(!KeyEvent)
                   g.setColor(new Color(255,0,0));
                   for(int j=0;j<20;j++)
                        if(level[0][j]==1)
                             g.setColor(new Color(255,0,0));
                             g.fillRoundRect(j*50,30,45,45,10,10);
                        else if(level[0][j]==0)
                             g.setColor(new Color(0,0,0));
                             g.fillRoundRect(j*50,30,45,45,10,10);
                   delay();
                   if(yposball==650)
                        constant=650-xposball;
                        slope=0-slope;
                   else if(xposball==0)
                        constant=yposball;
                        slope=0-slope;
                   else if(xposball==950)
                        constant=950-yposball;
                        slope=0-slope;
                        gamewon=1;
                   else if(yposball==80)
                        constant=xposball;
                        slope=0-slope;
                        level[0][xposball/50]=0;
                   yposball=slope*xposball+constant;
                   xposball+=50;
                   g.setColor(new Color(0,0,0));
                   g.fillRoundRect(xposball-50,yposball-50,45,45,10,10);     
                   g.setColor(new Color(0,255,0));
                   g.fillRoundRect(xposball,yposball,45,45,10,10);
                   g.setColor(new Color(0,0,0));
                   g.fillRoundRect(xposhandlerp,700,250,50,10,10);
                   g.setColor(new Color(0,0,255));
                   g.fillRoundRect(xposhandler,700,250,50,10,10);
              }

    dear experts, i think maybe my program was misunderstood by you people or I was not able to convey my ideas to you properly. Actually I am making the well known ball and pad game. What I have to do in this is that when ever any key is pressed the control should move out of the paint(and the while loop) ,do some changes and return to paint( ). that is to say that on detecting any key event my while loop should stop executing. to avoid confusion I am adding my whole program below.I have temporarily used some other condition in the while loop.the program is still in very early stages.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.imageio.ImageIO;
    public class game1 extends JFrame implements KeyListener
         int level[][]=      {{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
                        {0,1,1,0,1,0,1,0,0,0,1,1,0,1,0,1,1,0,1,0},
                        {0,1,0,1,0,1,0,1,0,1,0,0,1,0,1,1,0,1,1,1}};
         int gamewon=0;          // for winning the game
         int gamecomplete=0;          //for completion of the game
         int constant=0;          //cnstent of the equation y=x+constant
         int xposball=0;          // x coordinate of the ball
         int yposball=650;          // y coordinate ofthe ball
         int xposballp=0;          // previous x coordinate of the ball
         int yposballp=650;
         int xposhandler=0;               // x coordinate of the ball handler
         int xposhandlerp=0;               // x position of the ball handler before key press
         int slope=1;               // slope of the path which ball follows
         String line;
         private int increment=50;
         public game1()
              super(" BALL HANDLER");
              addKeyListener(this);
         public void keyPressed(KeyEvent e)
         public void keyTyped(KeyEvent e)
         public void keyReleased(KeyEvent e)
              line=String.format(e.getKeyText(e.getKeyCode()));
              if(line=="Left")
                   if(xposhandler==0)
                        xposhandlerp=xposhandler;
                        xposhandler=750;
                   else
                        xposhandlerp=xposhandler;
                        xposhandler+=50;
              if(line=="Right")
                   if(xposhandler>=750)
                        xposhandler=0;
                        xposhandlerp=750;
                   else
                        xposhandlerp=xposhandler;
                        xposhandler-=50;
              repaint();
         public void paint(Graphics g)
              g.setColor(new Color(0,0,0));
              g.fillRect(0,0,getWidth(),getHeight());
              setFocusable(true);
              while(gamecomplete!=15)     // should be 20 instead of 15
                   // for drawing the upper blocks which have to be hit
                   for(int j=0;j<20;j++)
                        if(level[0][j]==1)
                             g.setColor(new Color(255,0,0));
                             g.fillRoundRect(j*50,30,45,45,10,10);
                        else if(level[0][j]==0)
                             g.setColor(new Color(0,0,0));
                             g.fillRoundRect(j*50,30,45,45,10,10);
                   try
                        Thread.sleep(400);                
                   catch (InterruptedException ie)
                   if(yposball==650)
                        constant=650-xposball;
                        slope=0-slope;
                        //xposballp=xposball;
                        //yposballp=yposball;                    
                   else if(xposball==0)
                        constant=yposball;
                        slope=0-slope;
                        increment=50;
                        //xposballp=xposball;
                        //yposballp=yposball;
                   else if(xposball==950)
                        constant=950-yposball;
                        slope=0-slope;
                        increment=-50;
                        //xposballp=xposball;
                        //yposballp=yposball;
                   else if(yposball==80)
                        constant=xposball;
                        slope=0-slope;
                        level[0][xposball/50]=0;
                   //     xposballp=xposball;
                   //     yposballp=yposball;                    
                   xposball+=increment;     
                   yposball=slope*xposball+constant;
                   //g.setColor(new Color(0,0,0));
                   //g.fillRoundRect(xposballp,yposballp,45,45,10,10);     
                   g.setColor(new Color(0,255,0));
                   g.fillRoundRect(xposball,yposball,45,45,10,10);
                   gamecomplete=0;
                   for(int j=0;j<20;j++)
                        //if(level[0][j]==0)
                   gamecomplete++;
                   //**********for movement of the bottom pad********
                   /*g.setColor(new Color(0,0,0));
                   g.fillRoundRect(xposhandlerp,700,250,50,10,10);*/
                   g.setColor(new Color(0,0,255));
                   g.fillRoundRect(xposhandler,700,250,50,10,10);
         public static void main(String args[])
              game1 gm=new game1();
              gm.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              gm.setExtendedState(JFrame.MAXIMIZED_BOTH);
              gm.setVisible(true);
    BTW:sorry for replying late was busy in embedded systems

  • How to specify multiple listeners in the init/spfile

    hi experts,
    can u explain me How to specify multiple listeners in the init/spfile ?

    you do not specify linsteners in spfile.
    The easiest way to configure more listeners is to use Net Configuration Assistant tool.

  • How to use Ctrl+X

    Hello friends
    I want to trap Ctrl+x to achieve some short key, I have written this code but it is not working. In this code if we change isControlDown() to isAltDown() or isShiftDown() then it is working for Alt and Shift key but not for Control Key.
    addKeyListener(new KeyAdapter() {
    public void keyPressed(KeyEvent KEv) {
    if(KEv.isControlDown() && KEv.getKeyCode() == KeyEvent.VK_X) {
                             System.out.println("Ctrl+X");
    Please help me, how to use Control Key?

    hello... I am not sure if this solve your problem but... it is not this
    if(KEv.isControlDown() && KEv.getKeyCode() == KeyEvent.VK_X)
    it this
    if(KEv.isControlDown() && (KEv.getKeyCode() == KeyEvent.VK_X))
    if not, please post the message.

  • Learning how to use Layout Managers

    The code that is included in this post is public code from the SUN tutorials. I am trying to learn how to use the layouts and add individual programs that were created to each component in the layouts.
    This is what I am exploring:
    I want to have a tabbed layout like the example TabbedPaneDemo located at http://java.sun.com/docs/books/tutorial/uiswing/examples/components/index.html#TabbedPaneDemo. Below is the code.
    In one of the tabs, I want to place a button and report in it. When the button is clicked, I want the report refreshed. Eventually I will be populating an array with data. The report I want to use the example SimpleTableDemo located at http://java.sun.com/docs/books/tutorial/uiswing/examples/components/SimpleTableDemoProject/src/components/SimpleTableDemo.java. Below is the code.
    From what I have learned, you can place a container inside a container. So I should be able to place the SimpleTableDemo inside the tab 4 of the TabbedPaneDemo.
    If this is indeed correct, then how do I put these two things together? I am getting a little lost in all the code.
    Any assistance in helping me learn how to create and use layout managers would be appreciated.
    package components;
    * TabbedPaneDemo.java requires one additional file:
    *   images/middle.gif.
    import javax.swing.JTabbedPane;
    import javax.swing.ImageIcon;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    import javax.swing.JFrame;
    import javax.swing.JComponent;
    import javax.swing.SwingUtilities;
    import javax.swing.UIManager;
    import java.awt.BorderLayout;
    import java.awt.Dimension;
    import java.awt.GridLayout;
    import java.awt.event.KeyEvent;
    public class TabbedPaneDemo extends JPanel {
        public TabbedPaneDemo() {
            super(new GridLayout(1, 1));
            JTabbedPane tabbedPane = new JTabbedPane();
            ImageIcon icon = createImageIcon("images/middle.gif");
            JComponent panel1 = makeTextPanel("Panel #1");
            tabbedPane.addTab("Tab 1", icon, panel1,
                    "Does nothing");
            tabbedPane.setMnemonicAt(0, KeyEvent.VK_1);
            JComponent panel2 = makeTextPanel("Panel #2");
            tabbedPane.addTab("Tab 2", icon, panel2,
                    "Does twice as much nothing");
            tabbedPane.setMnemonicAt(1, KeyEvent.VK_2);
            JComponent panel3 = makeTextPanel("Panel #3");
            tabbedPane.addTab("Tab 3", icon, panel3,
                    "Still does nothing");
            tabbedPane.setMnemonicAt(2, KeyEvent.VK_3);
            JComponent panel4 = makeTextPanel(
                    "Panel #4 (has a preferred size of 410 x 50).");
            panel4.setPreferredSize(new Dimension(410, 50));
            tabbedPane.addTab("Tab 4", icon, panel4,
                    "Does nothing at all");
            tabbedPane.setMnemonicAt(3, KeyEvent.VK_4);
            //Add the tabbed pane to this panel.
            add(tabbedPane);
            //The following line enables to use scrolling tabs.
            tabbedPane.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT);
        protected JComponent makeTextPanel(String text) {
            JPanel panel = new JPanel(false);
            JLabel filler = new JLabel(text);
            filler.setHorizontalAlignment(JLabel.CENTER);
            panel.setLayout(new GridLayout(1, 1));
            panel.add(filler);
            return panel;
        /** Returns an ImageIcon, or null if the path was invalid. */
        protected static ImageIcon createImageIcon(String path) {
            java.net.URL imgURL = TabbedPaneDemo.class.getResource(path);
            if (imgURL != null) {
                return new ImageIcon(imgURL);
            } else {
                System.err.println("Couldn't find file: " + path);
                return null;
         * Create the GUI and show it.  For thread safety,
         * this method should be invoked from
         * the event dispatch thread.
        private static void createAndShowGUI() {
            //Create and set up the window.
            JFrame frame = new JFrame("TabbedPaneDemo");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            //Add content to the window.
            frame.add(new TabbedPaneDemo(), BorderLayout.CENTER);
            //Display the window.
            frame.pack();
            frame.setVisible(true);
        public static void main(String[] args) {
            //Schedule a job for the event dispatch thread:
            //creating and showing this application's GUI.
            SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    //Turn off metal's use of bold fonts
              UIManager.put("swing.boldMetal", Boolean.FALSE);
              createAndShowGUI();
    package components;
    * SimpleTableDemo.java requires no other files.
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.JTable;
    import java.awt.Dimension;
    import java.awt.GridLayout;
    import java.awt.event.MouseAdapter;
    import java.awt.event.MouseEvent;
    public class SimpleTableDemo extends JPanel {
        private boolean DEBUG = false;
        public SimpleTableDemo() {
            super(new GridLayout(1,0));
            String[] columnNames = {"First Name",
                                    "Last Name",
                                    "Sport",
                                    "# of Years",
                                    "Vegetarian"};
            Object[][] data = {
                {"Mary", "Campione",
                 "Snowboarding", new Integer(5), new Boolean(false)},
                {"Alison", "Huml",
                 "Rowing", new Integer(3), new Boolean(true)},
                {"Kathy", "Walrath",
                 "Knitting", new Integer(2), new Boolean(false)},
                {"Sharon", "Zakhour",
                 "Speed reading", new Integer(20), new Boolean(true)},
                {"Philip", "Milne",
                 "Pool", new Integer(10), new Boolean(false)}
            final JTable table = new JTable(data, columnNames);
            table.setPreferredScrollableViewportSize(new Dimension(500, 70));
            table.setFillsViewportHeight(true);
            if (DEBUG) {
                table.addMouseListener(new MouseAdapter() {
                    public void mouseClicked(MouseEvent e) {
                        printDebugData(table);
            //Create the scroll pane and add the table to it.
            JScrollPane scrollPane = new JScrollPane(table);
            //Add the scroll pane to this panel.
            add(scrollPane);
        private void printDebugData(JTable table) {
            int numRows = table.getRowCount();
            int numCols = table.getColumnCount();
            javax.swing.table.TableModel model = table.getModel();
            System.out.println("Value of data: ");
            for (int i=0; i < numRows; i++) {
                System.out.print("    row " + i + ":");
                for (int j=0; j < numCols; j++) {
                    System.out.print("  " + model.getValueAt(i, j));
                System.out.println();
            System.out.println("--------------------------");
         * Create the GUI and show it.  For thread safety,
         * this method should be invoked from the
         * event-dispatching thread.
        private static void createAndShowGUI() {
            //Create and set up the window.
            JFrame frame = new JFrame("SimpleTableDemo");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            //Create and set up the content pane.
            SimpleTableDemo newContentPane = new SimpleTableDemo();
            newContentPane.setOpaque(true); //content panes must be opaque
            frame.setContentPane(newContentPane);
            //Display the window.
            frame.pack();
            frame.setVisible(true);
        public static void main(String[] args) {
            //Schedule a job for the event-dispatching thread:
            //creating and showing this application's GUI.
            javax.swing.SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    createAndShowGUI();
    }

    Before I did what you suggested, which I appreciate your input, I wanted to run the code first.
    I tried to run the SimpleTableDemo and received the following error:
    Exception in thread "main" java.lang.NoClassDefFoundError: SimpleTableDemo (wrong name: componets/SimpleTableDemo)
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.security.SecureClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader...
    there are several more lines but as I was typing them out I thought that maybe the code is not written to run it in the command window. The errors seem to be around the ClassLoader. Is that correct? On the SUN example page when you launch the program a Java Web Start runs. So does this mean that the code is designed to only run in WebStart?

  • How to use one email adress for multiple recipients

    Hello,
    I'd like to know how to use one email adress for multiple recipients. 
    this would be very useful or projects. for example;
    if i send one mail to [email protected], all people in this project get an email.
    I will add the people in this project myself. 
    I know it is possible, but I don't know how to do it ;-)
    please help me! 

    Hope this help.
    _http://technet.microsoft.com/en-us/library/cc164331(v=exchg.65) .aspx

  • Can't figure out how to use home sharing

    Since the latest couple iTunes updates, my family and I can not figure out how to use home sharing. Everyone in our household has their own iTunes, and for a long time we would just share our music through home sharing. But with the updates, so much has changed that we can no longer figure out how to use it.
    I have a lot of purchased albums on another laptop in the house, that im trying to move it all over to my own iTunes, and I have spent a long time searching the internet, and everything. And I just can't figure out how to do it. So.... how does it work now? I would really like to get these albums from my moms iTunes, onto mine. I would hate to have to buy them all over again.
    If anyone is able to help me out here, that would be great! Thanks!

    The problem im having is that after I am in another library through home sharing, I can't figure out how to select an album and import it to my library. They used to have it set up so that you just highlight all of the songs you want, and then all you had to do was click import. Now I don't even see an import button, or anything else like it. So im lost... I don't know if it's something im doing wrong, or if our home sharing system just isn't working properly.
    Thanks for the help.

  • How to use the same POWL query for multiple users

    Hello,
    I have defined a POWL query which executes properly. But if I map the same POWL query to 2 portal users and the 2 portal users try to access the same page simultaneously then it gives an error message to one of the users that
    "Query 'ABC' is already open in another session."
    where 'ABC' is the query name.
    Can you please tell me how to use the same POWL query for multiple users ?
    A fast reply would be highly appreciated.
    Thanks and Regards,
    Sandhya

    Batch processing usually involves using actions you have recorded.  In Action you can insert Path that can be used during processing documents.  Path have some size so you may want to only process document that have the same size.  Look in the Actions Palette fly-out menu for insert path.  It inserts|records the current document work path into the action being worked on and when the action is played it inserts the path into the document as the current work path..

  • How to use airport time capsule with multiple computers?

    I'm sure there are some thread about this but i couldn't find it... so sorry for that but hear me out! =)
    I bought the AirPort Time Capsule to back up my MBP
    And so i did.
    then i thought "let give this one a fresh start" so i erased all of it with the disk utility and re-installed the MBP from the recovery disk.
    I dont want all of the stuff i backed up just a few files and some pictures so i brought that back.. so far so good.
    Now i want to do a new back up of my MBP so i open time machine settings, pick the drive on the time capsule and then "Choose" i wait for the beck up to begin, and then it fails.  It says (sorry for my bad english, im swedish haha) "the mount /Volume/Data-1/StiflersMBP.sparsebundle is already in use for back up.
    this is what i want:
    i want the "StiflersMBP.sparsebundle" to just be so i can get some stuf when i need them. it's never to be erased.
    i want to make a new back up of my MBP as if it's a second computer...
    so guys and girls, what is the easiest and best solution?
    Best regards!

    TM does not work like that.
    If you want files to use later.. do not use TM.
    Or do not use TM to the same location. Plug a USB drive into the computer and use that as the target for the permanent backup.
    Read some details of how TM works so you understand what it will do.
    http://pondini.org/TM/Works.html
    Use a clone or different software for a permanent backup.
    http://pondini.org/TM/Clones.html
    How to use TC
    http://pondini.org/TM/Time_Capsule.html
    This is helpful.. particularly Q3.
    Why you don't want to use TM.
    Q20 here. http://pondini.org/TM/FAQ.html

  • How to use multiple ipods on one account

    I have an Ipod classic and just bought my sons two nano's how do I use these on the same account without changing my account info?

    Take a look here:
    How to use multiple iPods with one computer
    Forum Tip: Since you're new here, you've probably not discovered the Search feature available on every Discussions page, but next time, it might save you time (and everyone else from having to answer the same question multiple times) if you search a couple of ways for a topic, both in the relevant forums, in the User Tips Library and in the Apple Knowledge Base before you post a question.
    Regards.

  • How to use a Table View in AppleScriptObjC

    How can I use a table view and add data to it? And how can I display a button cell and image cell in the table? Thanks.

    Hi all,
    Actually i need some more clarification. How to use the same select statement, if i've to use the tabname in the where clause too?
    for ex : select * from (tab_name) where....?
    Can we do inner join on such select statements? If so how?
    Thanks & Regards,
    Mallik.

  • How to use '|' delimited as seprator in GUI_DOWNLOAD ? Plz suggest me ,,

    how to use '|' delimited as seprator in GUI_DOWNLOAD ? Plz suggest me ,,
    i want the output should be seprated by '|' delimited when i download the file.

    Hi,
    We will pass the seperator to the WRITE_FIELD_SEPARATOR parameter as
    CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
    filename = v_file
    write_field_separator = '|'
    TABLES
    data_tab = itab[] . "Our internal talbe filled with data
    Re: Why Function GUI_DOWNLOAD can create XML file but not a flat file?
    Award points if useful
    Thanks,
    Ravee...

  • ** How to use TO_DATE function in Stored Proc. for JDBC in ABAP-XSL mapping

    Hi friends,
    I use ABAP-XSL mapping to insert records in Oracle table. My Sender is File and receiver is JDBC. We use Oracle 10g database. All fields in table are VARCHAR2 except one field; this is having type 'DATE'.
    I use Stored procedure to update the records in table. I have converted my string into date using the Oracle TO_DATE function. But, when I use this format, it throws an error in the Receiver CC. (But, the message is processed successfully in SXMB_MONI).
    The input format I formed like below:
    <X_EMP_START_DT hasQuot="No" isInput="1" type="DATE">
    Value in Payload is like below.
    <X_EMP_START_DT hasQuot="No" isInput="1" type="DATE">TO_DATE('18-11-1991','DD-MM-YYYY')</X_EMP_START_DT>
    Error in CC comes as below:
    Error processing request in sax parser: Error when executing statement for table/stored proc. 'SP_EMP_DETAILS' (structure 'STATEMENT'): java.lang.NumberFormatException: For input string: "TO_DATE('18"
    Friends, I have tried, but unable to find the correct solution to insert.
    Kindly help me to solve this issue.
    Kind Regards,
    Jegathees P.
    (But, the same is working fine if we use direct method in ABAP-XSL ie. not thru Stored Procedure)

    Hi Sinha,
    Thanks for your reply.
    I used the syntax
    <xsl:call-template name="date:format-date">
       <xsl:with-param name="date-time" select="string" />
       <xsl:with-param name="pattern" select="string" />
    </xsl:call-template>
    in my Abap XSL.  But, its not working correctly. The problem is 'href' function to import "date.xsl" in my XSLT is not able to do that. The system throws an error. Moreover, it is not able to write the command 'extension-element-prefixes' in my <xsl:stylesheet namespace>
    May be I am not able to understand how to use this.
    Anyway, I solved this problem by handling date conversion inside Oracle Stored Procedure. Now, its working fine.
    Thank you.

Maybe you are looking for

  • Sales/Stock data via IDOC for replenishment

    How to capture customer sales and stock data through IDOC for customer replishnment. We want to see stock update in Tcode WVM4 (w10t --> Logistics  -->  Retailing -->  Sales  --> Replenishment  --> Overview > Stock / Sales> WVM4).I am not sure the co

  • Sync call logging?

    Hi, We have a scenario where we make a sync call from a BPM to web-service. The logging for successful sync call is turned off, we would like to turn on so that we can see the successful sync calls as well. Does anyone knows how to do this? Your help

  • When I tap a contact to make a call I get an email page instead.

    Hi, Please HELP if you can,When I tap on a contact to make a phone call, all I get is an email page. What am I to do ?

  • Which MacBook Pro Processor for Photoshop and IMovie Projects?

    I am a fine art photographer. I use my compuer mostly for Photoshop work. I am now starting to do some video, but nothing too intensive. I am currently using IMovie. I doubt I will ever use finalcut but you never know. So I am planning to get a 15" M

  • Solution Manager and Quality Centre Integration

    Hi guys,             I was trying to send business blueprint from solar01 transaction to QC where I can define test cases and execute them. But the option "Send data to Quality Centre" is faded out under 'Business Blueprint' in the menu bar. Any idea