Again...  photos into imovie...   why doesn't this work at all???!!!

alright.
made it a couple times. no problem. but for right now either i have a problem with my mac or here are some nervewrecking coincidences going on to make my life just that more complicated:
as in every youtube-tutorial about how to get pictures into imovie and in lots of macusers logic to get a photo into imovie you do this with the function of the mediacenter at the center-right. so you go there click on the iphoto and to fast forward everything go for the searchbar and look for the photo you want, drag it to the upper left side or if you changed setting bottom left side and then, what comes next...    yep...   right...   you drop it....   well yeah, if there would be the possibility => i got no possibility to drop my pictures.
however, this is no problem for me with my videos, with my audio but for some random reason photos are unpossible for me to drag there.
somebody an advice? something with the setting? it's normal jpeg, it's imovie from the year 2009 which is version 8

alright, you guys, forget about what i just said...   i know why it's not working, it is a file that is not as a quadratic picture but one that is just cut out of a quadratic picture. so it's probably that's why it is not working....
so let's take this thing to a different level:
how can i get things that i cut out from editors like gimp and made a jpeg file out of it get into imovie when they are not quadratic? 
My idea is to make a video and add in the foreground some little pictures. something like a logo that i can't make with the writing software of imovie. So hoy can i add such a thing or is it even possible?

Similar Messages

  • Networking - Why Doesn't This Work?

    Hey all
    Just wondering if any of you have any ideas why this code isn't working properly - for the Client to connect the Server has to be restarted. Is there a solution to this problem?
    The Client Class:
    import java.awt.Container;
    import java.awt.Color;
    import java.awt.Font;
    import java.awt.FlowLayout;
    import java.awt.Dimension;
    import java.awt.GridBagLayout;
    import java.awt.GridBagConstraints;
    import java.awt.Insets;
    import java.awt.event.ActionListener;
    import java.awt.event.ActionEvent;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JColorChooser;
    import javax.swing.ButtonGroup;
    import javax.swing.Box;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.BoxLayout;
    import javax.swing.JTextArea;
    import javax.swing.JTextField;
    import javax.swing.JLabel;
    import javax.swing.JComboBox;
    import javax.swing.JOptionPane;
    import javax.swing.JRadioButton;
    import java.io.*;
    import java.net.*;
    * This is the user class and holds all the details for the GUI. The gui contains listeners
    * ans it sends messages to the server and also recieves messages from the server. This class
    * works primarily with the ClienttoServer class.
    * Help was used to create this class, mainly from the Java GUI devlopment book by Varan Piroumian
    * as this hsowed the basic components needed to create a GUI and which imports were the most essential
    * in order to have an interactive interface for the chat application.
    public class Client extends JFrame implements ActionListener
         private static final long serialVersionUID = 1L;
         private JTextArea conversationDisplay;
         private JTextField createMsg, hostfield, portnumfd, usernamey;
         private JScrollPane scrolly;
         private JLabel hosty, portnum, convoLabel, msgLabel, netwrk, netwrk2, talk2urself, fonts, nickName, ustatus, econs;
         private JPanel lpanel, rpanel, lpanel1, lpanel2, lpanel3, lpanel4, lpanel5, rpanel1, rpanel2, rpanel3, rpanel4, rpanel5;
         private JButton sendMsgButton, colourButton, exitButton, connect, dropconnection;
         private JRadioButton talk2urselfOn, talk2urselfOff;
         private JComboBox fontcombiBox, statusbox, emoticons;
         private JColorChooser colourchoo;
         private Container theWholeApp;
         private String username;
         private PrintWriter writer;
         private Socket socky;
         //for the self comm button
         private boolean talktoself = true;
         //used as when a msg is sent to the server the name & msg are sent in 2 parts (\n function) i.e
         //2 different messages. So in self comm mode then the next message needs to be ignored
         private boolean ignoreyourself = false;
          * The Constructor or the class
         public Client()
              makeGUI();
              System.out.println("Loading the GUI....");
          * Creates the GUI for the user to see/use
         public void makeGUI()
              //create the whole window
              JFrame.setDefaultLookAndFeelDecorated(true);
              //set the title of the whole app
              this.setTitle("Welcome To Elliot's Chat Network...");
              //set the app window size
              this.setSize(600, 575);
              //create the outer container for the app
              theWholeApp = getContentPane();
              //make new gridbag layout
              GridBagLayout layoutgridbag = new GridBagLayout();
              //create some restraints for this...
              GridBagConstraints gbconstraints = new GridBagConstraints();
              //make the app use this gridbag layout
              theWholeApp.setLayout(layoutgridbag);
              //this is where elements are added into the application's window
              //creates and adds the convo label
              convoLabel = new JLabel("Your Conversation:");
              gbconstraints = new GridBagConstraints();
              gbconstraints.gridx = 0;
              gbconstraints.gridy = 0;
              gbconstraints.gridheight = 1;
              gbconstraints.gridwidth = 1;
              gbconstraints.weightx = 5;
              gbconstraints.weighty = 1;
              gbconstraints.anchor = GridBagConstraints.WEST;
              layoutgridbag.setConstraints(convoLabel, gbconstraints);
              theWholeApp.add(convoLabel);
              //create & add the exit button
              exitButton = new JButton("Exit");
              gbconstraints = new GridBagConstraints();
              gbconstraints.gridx = 10;
              gbconstraints.gridy = 0;
              gbconstraints.gridheight = 1;
              gbconstraints.gridwidth = 1;
              gbconstraints.weightx = 1;
              gbconstraints.weighty = 1;
              gbconstraints.anchor = GridBagConstraints.EAST;
              layoutgridbag.setConstraints(exitButton, gbconstraints);
              theWholeApp.add(exitButton);
              exitButton.addActionListener(this);
              //create & add the txt area
              conversationDisplay = new JTextArea(15,15);
              scrolly = new JScrollPane(conversationDisplay);
              gbconstraints = new GridBagConstraints();
              gbconstraints.gridx = 0;
              gbconstraints.gridy = 1;
              gbconstraints.gridheight = 4;
              gbconstraints.gridwidth = 11;
              gbconstraints.weightx = 10;
              gbconstraints.weighty = 20;
              gbconstraints.anchor = GridBagConstraints.WEST;
              gbconstraints.fill = GridBagConstraints.BOTH;
              gbconstraints.insets = new Insets(10, 10, 15, 15);
              //so the clients cant write in the display area...
              conversationDisplay.setEditable(false);
              layoutgridbag.setConstraints(scrolly, gbconstraints);
              theWholeApp.add(scrolly);
              //create & add the nick name area
              nickName = new JLabel("Your nick \nthis is required");
              gbconstraints = new GridBagConstraints();
              gbconstraints.gridx = 0;
              gbconstraints.gridy = 5;
              gbconstraints.gridheight = 1;
              gbconstraints.gridwidth = 1;
              gbconstraints.weightx = 5;
              gbconstraints.weighty = 1.5;
              gbconstraints.anchor = GridBagConstraints.WEST;
              gbconstraints.fill = GridBagConstraints.HORIZONTAL;
              gbconstraints.insets = new Insets(3, 10, 0, 0);
              layoutgridbag.setConstraints(nickName, gbconstraints);
              theWholeApp.add(nickName);
              //create & add the nick name box
              usernamey = new JTextField(10);
              gbconstraints = new GridBagConstraints();
              gbconstraints.gridx = 0;
              gbconstraints.gridy = 6;
              gbconstraints.gridheight = 1;
              gbconstraints.gridwidth = 1;
              gbconstraints.weightx = 1;
              gbconstraints.weighty = 1;
              gbconstraints.anchor = GridBagConstraints.WEST;
              gbconstraints.fill = GridBagConstraints.HORIZONTAL;
              gbconstraints.insets = new Insets(0, 10, 0, 0);
              layoutgridbag.setConstraints(usernamey, gbconstraints);
              theWholeApp.add(usernamey);
              //create & add the your message label
              msgLabel = new JLabel("Your Message:");
              gbconstraints = new GridBagConstraints();
              gbconstraints.gridx = 0;
              gbconstraints.gridy = 7;
              gbconstraints.gridheight = 1;
              gbconstraints.gridwidth = 1;
              gbconstraints.weightx = 1;
              gbconstraints.weighty = 1;
              gbconstraints.anchor = GridBagConstraints.WEST;
              gbconstraints.fill = GridBagConstraints.BOTH;
              gbconstraints.insets = new Insets(0, 10, 0, 0);
              layoutgridbag.setConstraints(msgLabel, gbconstraints);
              theWholeApp.add(msgLabel);
              //create & add the create message box
              createMsg = new JTextField(15);
              gbconstraints = new GridBagConstraints();
              gbconstraints.gridx = 0;
              gbconstraints.gridy = 8;
              gbconstraints.gridheight = 2;
              gbconstraints.gridwidth = 10;
              gbconstraints.weightx = 10;
              gbconstraints.weighty = 1;
              gbconstraints.anchor = GridBagConstraints.WEST;
              gbconstraints.fill = GridBagConstraints.HORIZONTAL;
              gbconstraints.insets = new Insets(3, 10, 0, 0);
              layoutgridbag.setConstraints(createMsg, gbconstraints);
              theWholeApp.add(createMsg);
              createMsg.addActionListener(this);
              createMsg.setActionCommand("Press Enter!");
              //create & add the send message button
              sendMsgButton = new JButton("Send Msg");
              gbconstraints = new GridBagConstraints();
              gbconstraints.gridx = 10;
              gbconstraints.gridy = 8;
              gbconstraints.gridheight = 1;
              gbconstraints.gridwidth = 1;
              gbconstraints.weightx = 1;
              gbconstraints.weighty = 1;
              gbconstraints.anchor = GridBagConstraints.EAST;
              layoutgridbag.setConstraints(sendMsgButton, gbconstraints);
              theWholeApp.add(sendMsgButton);
              sendMsgButton.addActionListener(this);
              //create & add the left panel
              lpanel = new JPanel();
              gbconstraints = new GridBagConstraints();
              gbconstraints.gridx = 0;
              gbconstraints.gridy = 10;
              gbconstraints.gridheight = 3;
              gbconstraints.gridwidth = 4;
              gbconstraints.weightx = 5;
              gbconstraints.weighty = 0;
              gbconstraints.anchor = GridBagConstraints.WEST;
              gbconstraints.insets = new Insets(0, 10, 0, 0);
              layoutgridbag.setConstraints(lpanel, gbconstraints);
              theWholeApp.add(lpanel);
              //create & add the right panel
              rpanel = new JPanel();
              gbconstraints = new GridBagConstraints();
              gbconstraints.gridx = 5;
              gbconstraints.gridy = 10;
              gbconstraints.gridheight = 3;
              gbconstraints.gridwidth = 4;
              gbconstraints.weightx = 5;
              gbconstraints.weighty = 0;
              gbconstraints.anchor = GridBagConstraints.EAST;
              layoutgridbag.setConstraints(rpanel, gbconstraints);
              theWholeApp.add(rpanel);
              //add to the left JPanel - set the layout for this
              lpanel.setLayout(new BoxLayout(lpanel, BoxLayout.Y_AXIS));
              //add panels into this left panel...
              lpanel1 = new JPanel();
              lpanel2 = new JPanel();
              lpanel3 = new JPanel();
              lpanel4 = new JPanel();
              lpanel5 = new JPanel();
              lpanel.add(lpanel1);
              lpanel.add(lpanel2);
              lpanel.add(lpanel3);
              lpanel.add(lpanel4);
              lpanel.add(lpanel5);
              //set FlowLyout for each of these panels
              lpanel1.setLayout(new FlowLayout(FlowLayout.LEFT));
              lpanel2.setLayout(new FlowLayout(FlowLayout.LEFT));
              lpanel3.setLayout(new FlowLayout(FlowLayout.LEFT));
              lpanel4.setLayout(new FlowLayout(FlowLayout.LEFT));
              lpanel5.setLayout(new FlowLayout(FlowLayout.LEFT));
              //add in the network items...
              netwrk = new JLabel("Network Details:");
              lpanel1.add(netwrk);
              //create and add instructions for this
              netwrk2 = new JLabel("Please enter the details for \nthe person you want to chat to...");
              lpanel2.add(netwrk2);
              //create/add the ip addy label
              hosty = new JLabel("Host:");
              lpanel3.add(hosty);
              lpanel3.add(Box.createRigidArea(new Dimension(5,0)));
              hostfield = new JTextField("Enter Hostname",10);
              lpanel3.add(hostfield);
              //port num next
              portnum = new JLabel("Port Number:");
              lpanel4.add(portnum);
              lpanel4.add(Box.createRigidArea(new Dimension(5, 0)));
              portnumfd = new JTextField("2250", 10);
              lpanel4.add(portnumfd);
              //create & add the connect butt
              connect = new JButton("Connect");
              lpanel5.add(connect);
              dropconnection = new JButton("Disconnect");
              lpanel5.add(dropconnection);
              connect.addActionListener(this);
              dropconnection.addActionListener(this);
              //start the creation of the right hand panel.
              rpanel.setLayout(new BoxLayout(rpanel, BoxLayout.Y_AXIS));
              //create the panels again
              rpanel1 = new JPanel();
              rpanel2 = new JPanel();
              rpanel3 = new JPanel();
              rpanel4 = new JPanel();
              rpanel5 = new JPanel();
              rpanel.add(rpanel1);
              rpanel.add(rpanel2);
              rpanel.add(rpanel3);
              rpanel.add(rpanel4);
              rpanel.add(rpanel5);
              rpanel1.setLayout(new FlowLayout(FlowLayout.LEFT));
              rpanel2.setLayout(new FlowLayout(FlowLayout.LEFT));
              rpanel3.setLayout(new FlowLayout(FlowLayout.LEFT));
              rpanel4.setLayout(new FlowLayout(FlowLayout.LEFT));
              rpanel5.setLayout(new FlowLayout(FlowLayout.LEFT));
         //now start putting things into them again
              //add in the font settings
              String[] fonty = {"Normal", "Bold", "Italic"};
              fonts = new JLabel("Set your text style:");
              fontcombiBox = new JComboBox(fonty);
              rpanel2.add(fonts);
              rpanel2.add(Box.createRigidArea(new Dimension(4,0)));
              rpanel2.add(fontcombiBox);
              //default text will be plain..
              fontcombiBox.setSelectedIndex(0);
              String[] userstatus = {"Online", "Away", "Be Right Back", "Busy", "Out To Lunch", "On The Phone"};
              ustatus = new JLabel("Select a status:");
              statusbox = new JComboBox(userstatus);
              rpanel2.add(ustatus);
              rpanel2.add(Box.createRigidArea(new Dimension(2,0)));
              rpanel2.add(statusbox);
              //add in some emotion to the conversations
              String[] emotion = {"Angry", "Happy", "Sad", "Crying", "Shocked", "Laughing", "Laughing My Ass Off!"};
              econs = new JLabel("Select an emoticon:");
              emoticons = new JComboBox(emotion);
              rpanel3.add(econs);
              rpanel3.add(Box.createRigidArea(new Dimension(3,0)));
              rpanel3.add(emoticons);
              //self comm options
              talk2urself = new JLabel("Set Self Communication Mode:");
              rpanel4.add(talk2urself);
              talk2urselfOn = new JRadioButton("On", true);
              rpanel4.add(talk2urselfOn);
              rpanel4.add(Box.createRigidArea(new Dimension(4, 0)));
              talk2urselfOff = new JRadioButton("Off", false);
              rpanel4.add(talk2urselfOff);
              //create a group that will hold both these buttons together
              ButtonGroup groupy = new ButtonGroup();
              //add them to the group
              groupy.add(talk2urselfOn);
              groupy.add(talk2urselfOff);
              //create and add the change backgrd button
              colourButton = new JButton("Alter Background");
              rpanel5.add(colourButton);
              //add in some listeners
              talk2urselfOn.addActionListener(this);
              talk2urselfOff.addActionListener(this);
              fontcombiBox.addActionListener(this);
              colourButton.addActionListener(this);
              statusbox.addActionListener(this);
              //add in the 'X' button in the top right corner of app
              setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              //put all elements together
              this.pack();
              //show the GUI for the user..
              this.show();
          * Creates a new client and GUI as its the main method
         public static void main(String args[])
              new Client();
          * This method listens for actions selected by the user and then performs the
          * necessary tasks in order for the correct events to take place...!
          * This method was mainly created thanks to the Developing Java GUI book which has already
          * been mentioned as it covers listeners and event handling...
         public void actionPerformed(ActionEvent event)
              //if the send button is clicked or if hard carriage return after message
              if((event.getSource() == (sendMsgButton)) || (event.getSource().equals(createMsg)))
                   //if theres no text dont send message
                   if(createMsg.getText().equals(""))
                        JOptionPane.showMessageDialog(this, "There's no text to send!");
                   else
                        String str  = createMsg.getText();
                        printMessage(str);
              //if the exit button is clicked
              if(event.getSource() == (exitButton))
                   //quit the chat app
                   JOptionPane.showMessageDialog(this, "Thanks For Using Elliot's Chat Network! \nSee You Again Soon!");
                   System.exit(0);
              //if the self comm option is turned on
              if(event.getSource() == (talk2urselfOn))
                   talktoself = true;
                   JOptionPane.showMessageDialog(this, "You have begun self communication \nmessages you send are now displayed");
              //if the self comm option is turned off
              if(event.getSource() == (talk2urselfOff))
                   talktoself = false;
                   JOptionPane.showMessageDialog(this, "You have stopped self communication \nmessages you send are no longer displayed");
              //for the normal font option
              if(fontcombiBox.getSelectedItem().equals("Plain"))
                   //makes a new font style plain...
                   conversationDisplay.setFont(new Font("simple", Font.PLAIN, 12));
                   createMsg.setFont(new Font("simple", Font.PLAIN, 12));
              //for the bold font option
              if(fontcombiBox.getSelectedItem().equals("Bold"))
                   conversationDisplay.setFont(new Font("simple", Font.BOLD, 12));
                   createMsg.setFont(new Font("simple", Font.BOLD, 12));
              //for the italic font option
              if(fontcombiBox.getSelectedItem().equals("Italic"))
                   conversationDisplay.setFont(new Font("simple", Font.ITALIC, 12));
                   createMsg.setFont(new Font("simple", Font.ITALIC, 12));
               *      //the status events if they didnt create null points...
              if(statusbox.getSelectedItem().equals("Online"))
                   String status = "<Online>";
                   printMessage(status);
              if(statusbox.getSelectedItem().equals("Away"))
                   String status = "<Away>";
                   printMessage(status);
              if(statusbox.getSelectedItem().equals("Be Right Back"))
                   String status = "<Be Right Back>";
                   printMessage(status);
              if(statusbox.getSelectedItem().equals("Busy"))
                   String status = "<Busy>";
                   printMessage(status);
              if(statusbox.getSelectedItem().equals("Out To Lunch"))
                   String status = "<Out To Lunch>";
                   printMessage(status);
              if(statusbox.getSelectedItem().equals("On The Phone"))
                   String status = "<On The Phone>";
                   printMessage(status);
              //the emoticons events...
              if(emoticons.getSelectedItem().equals("Angry"))
                   String status = "<Angry>";
                   printMessage(status);
              if(emoticons.getSelectedItem().equals("Sad"))
                   String status = "<Sad>";
                   printMessage(status);
              if(emoticons.getSelectedItem().equals("Shocked"))
                   String status = "<Shocked>";
                   printMessage(status);
              if(emoticons.getSelectedItem().equals("Happy"))
                   String status = "<Happy>";
                   printMessage(status);
              if(emoticons.getSelectedItem().equals("Crying"))
                   String status = "<Crying>";
                   printMessage(status);
              if(emoticons.getSelectedItem().equals("Laughing"))
                   String status = "<Laughing>";
                   printMessage(status);
              if(emoticons.getSelectedItem().equals("Laughing My Ass Off!"))
                   String status = "<Laughing My Ass Off!>";
                   printMessage(status);
              //if the colour button is clicked
              if(event.getSource() == colourButton)
                   //create a new colour chooser
                   colourchoo = new JColorChooser();
                   //create the dialog its shown in
                   JColorChooser.createDialog(colourButton, "Choose your background colour", true, colourchoo, this, this);
                   //now show the dialog
                   Color col = JColorChooser.showDialog(sendMsgButton, "Choose your background colour", Color.GRAY);
                   //when a colour is chosen it becomes the bg colour
                   theWholeApp.setBackground(col);
                   rpanel1.setBackground(col);
                   rpanel2.setBackground(col);
                   rpanel3.setBackground(col);
                   rpanel4.setBackground(col);
                   rpanel5.setBackground(col);
                   lpanel1.setBackground(col);
                   lpanel2.setBackground(col);
                   lpanel3.setBackground(col);
                   lpanel4.setBackground(col);
                   lpanel5.setBackground(col);
              //if the connect button is clicked
              if(event.getSource() == (connect))
                   //get the txt entered into ip addy field & port num fields with a text check...
                   if(hosty.getText().equals("") || portnumfd.getText().equals("") || nickName.getText().equals(""))
                        JOptionPane.showMessageDialog(this, "You cant connect! \nThis is because the either the \n0 - HostName\n 0 - Port Number \n0 - Your Nick \nIs Missing...");
                   else
                        //get details and connect
                        username = nickName.getText();
                        String ipay = hostfield.getText();
                        String porty = portnumfd.getText();
                        connectto(ipay,porty);
          * This method is similar to an append method in that it allows msgs recieved by the server to
          * be displayed in the conversation window. It also deals with the self comm mode as if its disabled
          * then no messages from the sender will be displayed.
         public void moveTextToConvo(String texty)
              //check
              if(ignoreyourself == true)
                   ignoreyourself = false;
              else
                   //If self comm is on the send message as normal
                   if(talktoself)
                        conversationDisplay.setText(conversationDisplay.getText() + texty);
                   else
                        //check message isnt sent by the current client - if it is ignore it!
                        if(texty.startsWith(nickName.getText()))
                             ignoreyourself = true;
                        else
                             conversationDisplay.setText(conversationDisplay.getText() + texty);
              //allows the scroll pane to move automatically with the conversation
              conversationDisplay.setCaretPosition(conversationDisplay.getText().length());
          * This method (connectto) is called if the button's clicked and also sets up a relation
          * between the client and clienttoserver class
         public void connectto(String ipa,String portNO)
              //portNO needs to be changed from string to int
              int portNum = new Integer(portNO).intValue();
              try
                   //creates a socket
                   socky = new Socket(ipa, portNum);
                   writer = new PrintWriter(socky.getOutputStream(), true);
                   ClienttoServer cts = new ClienttoServer(socky, this);
                   cts.runit();
                   //give user a prompt
                   JOptionPane.showMessageDialog(this, "You're now connected!");
              catch(UnknownHostException e)
                   System.err.println("Unknown host...");
                   //prompt the user
                   JOptionPane.showMessageDialog(this, "Failed to connect! \nPlease try again...");
              catch(IOException e)
                   System.err.println("Could Not Connect!");
                   //prompt user
                   JOptionPane.showMessageDialog(this, "Error! \nCould not connect - please try again!");
          * This method sends msgs from current client to server, sends username and then the message.
          * This is split into two different messages as the "\n" is used.
         public void printMessage(String mess)
              writer.println(usernamey.getText() + " says: \n" + mess);
              //then clear the text in the message creation area...
              createMsg.setText("");
          * Accessor method to retrieve userName
         public String getUName()
              return username;
          * Disconnect this user from the server so that they can no longer recieve/send messages
         public void dropconnection()
              try
                   //Start to close everything - informing user
                   writer.close();
                   socky.close();
                   //Give the user info on whats happening
                   JOptionPane.showMessageDialog(this, "You are now disconnected \nYou will no longer be able to \nsend and recieve messages");
                   System.out.println("A user has left the conversation...");
              catch (IOException e)
                   System.err.println("IOException " + e);
    The Server Class:
    import java.net.*;
    import java.io.*;
    * This class works in sync with the ServertoClient class in order to read
    * messages from clients and then send back out to all the active clients. Due to
    * the usage of threading multiple clients can use this server.
    * Once again some of this code is from Florians 2005 tutorial work.
    public class Server
         private ServerSocket server;
         private ServertoClient threads[];
         private static int portNo  = 2250;
         private static String Host = ""; //find method to retrieve ip
         private int maxPeeps = 20; //20 people can talk together but this can be altered
          * 1st Constructor - has no params
         public Server()
          * 2nd Constructor - allows for port number setting
         public Server(int portnumber)
              portNo = portnumber;
          * 3rd Constructor - allows for port number & max users
         public Server(int portnumber, int maxiusers)
              portNo = portnumber;
              maxPeeps = maxiusers;
          * This method is to constantly listen for possible messages from clients
         public void listener()
              //set the time out of method to just under a minute
              final int waitingTime = 500000000;
              //a boolean variable to keep it waiting
              boolean keepWait = true;
              //create a threads array of length maxpeeps
              threads = new ServertoClient[maxPeeps];
              //define a variable that will be used as a count of the no of threads
              int x = 0;
              try
                   //open a new socket on this port number
                   server = new ServerSocket(portNo);
              catch (IOException e)
                   System.err.println("IOException " + e);
                   return;
              //while the keepWait is true and the no. of threads is less than the max...
              while(keepWait && x < maxPeeps)
                   try
                        //set the timeout, this is the waitingTime (50 secs)
                        server.setSoTimeout(waitingTime);
                        //listen for connection to accept
                        Socket socky = server.accept();
                        System.out.println("A New User Has Connected");
                        //creates a new thread and adds it to array
                        threads[x] = new ServertoClient(this, socky);
                        //the thread begins
                        threads[x].start();
                   catch (InterruptedIOException e)
                        System.err.println("The Connection Timed Out...");
                        keepWait = false;
                   catch (IOException e)
                        System.err.println("IOException " + e);
                   x++; //increment no. of threads
              //if waitingTime is reached or there are too many threads then server closes
              try
                   server.close();
              catch(IOException e)
                   System.err.println("IOException " + e);
                   return;
          * This prints the string to all active threads
         public void printAll(String printy)
              for(int x = 0; x < threads.length; x++)
                   if(threads[x] !=null && threads[x].isAlive())
                        threads[x].sendMsg(printy);
          * Main method for the server, creates a new server and then continues to listen
          * for messages from different users
         public static void main(String[] args)
              Server chatsession = new Server();
              System.out.println("The Server Is Now Running on port NO: " + portNo);
              System.out.println("And IP Address: " + Host);
              chatsession.listener();
    [/code
    The ServertoClient Classimport java.lang.Thread;
    import java.net.*;
    import java.io.*;
    * This is the ClienttoServer class that acts as an intermediary between the server
    public class ClienttoServer extends Thread
         private Socket socky;
         private BufferedReader bready;
         private boolean active;
         private Client client;
         * This is the constructor to create a new client service
         public ClienttoServer(Socket socket, Client cli)
              socky = socket;
              active = false;
              client = cli;
              //try to read from the client
              try
                   bready = new BufferedReader(new InputStreamReader(socky.getInputStream()));
              catch (IOException e)
                   System.err.println("IOException " + e);
         * This method reads in from the client
         public void runit()
              active = true;
              while(active == true)
              {//continue to read in and then change the text in the conversation window
                   try
                        String message = bready.readLine();
                        client.moveTextToConvo(message + "\n");
                   catch (IOException e)
                        System.err.println("IOException " + e);
                        active = false;
    And finaly the servertoclient class
    import java.net.*;
    import java.io.*;
    import java.lang.Thread;
    * This clas provides the services that the server uses
    public class ServertoClient extends Thread
         private Socket socky;
         private Server server;
         private BufferedReader bready;
         private PrintWriter writer;
          * This constructor sets up the socket
         public ServertoClient(Server theServer, Socket theSocket)throws IOException
              socky = theSocket;
              server = theServer;
              //sets up the i/o streams
              writer = new PrintWriter(socky.getOutputStream(), true);
              bready = new BufferedReader(new InputStreamReader(socky.getInputStream()));
          * This method keeps listening until user disconnects
         public void run()
              boolean keepRunning = true;
              try
                   //keep listening 'til user disconnects
                   while(keepRunning = true)
                        final String tempmsg = bready.readLine();
                        //is there a message (if yes then print it!)
                        if(tempmsg == null)
                        else
                             server.printAll(tempmsg);
                   dropconnection();
              catch (IOException e)
                   System.err.println("IOException in thread " + Thread.currentThread() + ": " + e);
          * This method is for when a user disconnects from the server...
         public void dropconnection()
              try
                   bready.close();
                   writer.close();
                   socky.close();
              catch (IOException e)
                   System.err.println("IOException in thread " + Thread.currentThread() + ": " + e);
              System.out.println("A User Has Disconnected...");
          * This method prints the message
         public void sendMsg(String msg)
              writer.println(msg);
    }Thats it any help would be much appreciated
    Cheers.

    Like the previous poster indicated: try to find a minimal example that shows the error your experiencing.
    One thing that seems bogus is the Server.listener() method. For one thing, it can increment x even if no new connection has been established (e.g., x will be incremented if an exception is caught).

  • Erratic file naming. Why doesn't this work?

    The Finder allows certain names for files and folders sometimes, but then doesn't allow them at other times. What's happenig? Here's an example. I created a folder with this name: "National Geog> Africa (4 parts, 1hr each)" with no problem. Later I wanted to change the "4" to a "6". Sounds simple enough. I highlighted the 4 and typed the 6—but the Finder rejected that simple change, with this message: The [new name] cannot be used. Try using another name, with fewer characters or no punctuation marks."
    Why would it like the name with a 4 in it, but not like the name with a 6 instead of the 4?
    I can provide this much a clue. The folder resides on an external LaCie hard disk. I don't recall how that particular folder got there, but I have discovered I can create a folder with the desired name on my desktop and then successfully copy it to my external disk with no problem. But I cannot create the folder on the external disk in give it the desired name (I get the error message), nor can I change an existing folder name on the external disk to that name.
    This is not the world's worst problem, but if anyone has any comments about this, I'd appreciate them.

    Strange...when I create a folder on my desktop with that exact name I can change the 4 to a 6 perfectly fine. Are you able to change the name to other things?
    Are you able to create new files on the disk, or are you only able to copy files to it via the finder?

  • Why doesn't this work?help?

    I am writting an application to diaplay the lyrics of a song. I need to use 2 switch sturctures.( one switch print day the other verse of tweleve days of christmas)
    I can not use arrays or myMethod concept.
    This is what I have
    import javax.swing.JOptionPane;
    import javax.swing.JTextArea;
    import javax.swing.JScrollPane;
    public class Exercise526
         public static void main(String args[] )
         JTextArea outputTextArea = new JTextArea( 18,30 );
         JScrollPane scroller = new JScrollPane(outputTextArea);
         String outputDay = "",
         outputVerse = "";
         for (int day=0; day >= 12; day++ )
         switch (day)
    case 1:
    outputDay = ("1st"); break;
    case 2:
    outputDay =("2nd"); break;
    case 3:
    outputDay = ("3rd"); break;
    case 4:
    outputDay = ("4th"); break;
    case 5:
    outputDay = ("5th"); break;
    case 6:
    outputDay = ("6th"); break;
    case 7:
    outputDay = ("7th"); break;
    case 8:
    outputDay = ("8th"); break;
    case 9:
         outputDay = ("9th"); break;
    case 10:
    outputDay = ("10th"); break;
    case 11:
         outputDay = ("11th"); break;
    case 12:
         outputDay = ("12th"); break;
         for ( int words=0; words >= 12; words++ )
         switch (words)
         case 12:
         outputVerse = "Tweleve lords a-leaping\n";
         case 11:
         outputVerse = "Eleven ladies dancing/n";
         case 10:
         outputVerse = "Ten pipers piping\n";
         case 9:
         outputVerse = "Nine drummers drumming\n";
         case 8:
         outputVerse = "Eight maids a-milking\n";
         case 7:
         outputVerse = "Seven swans swimming\n";
         case 6:
         outputVerse = "Six geese a-laying\n";
         case 5:
         outputVerse = "Five golden rings\n";
         case 4:
         outputVerse = "Four colly birds\n";
         case 3:
         outputVerse = "Three french hens\n";
         case 2:
         outputVerse = "Two turtle doves and\n";
         case 1:
         outputVerse = "A partridge in a pear tree\n";
    outputTextArea.setText(outputDay);
    outputTextArea.setText(outputVerse);
    outputTextArea.append("\tThe Tweleve Days of Christmas\n");
    outputTextArea.append("\nOn the"+outputDay+"day of Christmas my true love gave to me"+ outputVerse);
    outputTextArea.append("\n\tProgrammed by: Carly Murphey");
    JOptionPane.showMessageDialog( null, outputTextArea,
         "The Tweleve Days of Christmas",
         JOptionPane.PLAIN_MESSAGE );
         System.exit(0);
    I can not figure out how to diaplay in JTextarea what the switch data is. Please help. This is due real soon.
    Carly

    // Also remember to put "break;" after each case;otherwise they all mush together
    Actually, mushing together is the whole point of the
    exercise here. You want to print "12 lords... 11
    ladies..." and so on. This is the first situation I
    have ever seen where you would actually NOT want the
    breaks in your switch statement!Look at the code again. The "12 lords... 11 ladies" part sets a variable rather than printing. Therefore, you do need the breaks.
    If the assignments were changed to prints, then you could remove the loop and the breaks. However, this program would be much simpler with arrays instead of switch statements. Maybe that's the next exercise...

  • Why doesn't this work?

    I'm trying to combine 4 of the same image into a 4x4 tile. For some reason when I call drawImage() it only paints 1 of the tiles. I've found that if i move the 1 image at all, the rest is off-screen. The image itself is 34x34 pixels and the panel I'm trying to draw it on is at least 10 times larger. Here is a snip-it of my code if anyone could please look over it and give me any advice or tell me what I'm doing wrong I'd greatly appreciate it.
    public void paint(Graphics g) {
    int size = 34;
    int grassx, grassy;
    grassx = size * 7;
    grassy = size * 0;
    int spritex, spritey;
    spritex = sprite.intFromDouble(spriteDimensions.getWidth());
    spritey = sprite.intFromDouble(spriteDimensions.getHeight());
    g.drawImage(img,0,0,size,size,grassx,grassy,grassx + size,grassy + size,
    null);
    g.drawImage(img,size,0,size,size,grassx,grassy,grassx + size,grassy +
    size,null);
    g.drawImage(img,0,size,size,size,grassx,grassy,grassx + size,grassy + size,null);
    g.drawImage(img,size,size,size,size,grassx,grassy,grassx + size,grassy + size,null);
    g.drawImage(sprite.getCharacters(),0,0,size,size,spritex,spritey, spritex+size,spritey + size,null);
    }img is an Image created by ImageIO.read(new File(location.toURI()))The code only visibly draws the image at 0,0 and the sprite that is also located at 0,0.
    Any help anyone can give me would be very appreciated.

    & i also look at your fifth till eighth parameter.
    they are same... you can simplify your code by creating sub image first, instead of croping them each time you need them.
    fortunately, u are using BufferedImage that already support subimage.
    BufferedImage img = ImageIO.read(new File(location.toURI()));
    Image cropedImg = img.subImage(grassx, grassy, size, size); // here, 3rd & 4th are width & height.
    g.drawImage(cropedImg, 0, 0, this); // lot simpler...
    g.drawImage(cropedImg, 0, size, this);
    g.drawImage(cropedImg, size, 0, this);
    g.drawImage(cropedImg, size, size, this);

  • SQLite and PHP - Why doesn't this work?

    I've noticed that, with the bundled installs of SQLite3 and PHP, SQLite seems not to work. Checking phpinfo(), I noticed that the linked library is of version 2, but SQLite 2 is not bundled.
    I've tirelessly searched the net, but this issue seems largely undocumented. Short of compiling my own version of PHP (I'd rather not), is there any solution to 'upgrade' the SQlite library in PHP?

    I wrote a little PHP script to create a SQLite database, load a few records and print them in a web browser. Works fine. From the terminal, the sqlite3 command will open the db but even just trying to list the .databases will produce Error: file is encrypted or is not a database. The PHP script is creating a SQLite2 database. You can open the db in TextWrangler or BBEdit to see the version number. I guess we will have to wait for a version of PHP that is compatible with SQLite3.

  • I imported videos from photo into iMovie when I set up iMovie (obvious mistake) and now iMovie doesn't work properly, nor can I move specific videos into a folder where I want them. How do I fix this?

    I imported videos from photo into iMovie when I set up iMovie (obvious mistake) and now iMovie doesn't work properly, nor can I move specific videos into a folder where I want them. How do I fix this? I even tried deleting iMovie, bought a new copy and installed it, but the folder "iPhoto Videos" is still there and I can't get new clips loaded to iMovie, especially where I want them. Please help.

    The iPhoto Videos do occasionally have problems. I've seen a lot of people write messages to this Discussion group describing similar problems. The only thing that seems to get around this problem is to pull the video clips out of iPhoto then import them directly into iMovie. Once the troubles with iPhoto Videos starts, I haven't yet seen anyone write back with something that they did to fix it.
    The most difficult part of doing this is the movies in iPhoto might be a little difficult to track down. But you can create a smart alum that does that for you. Go to iPhoto > File Menu > New Smart Album:
    Set the first pulldown menu to keyword, second to contains, then in the last box type Movie with a capital 'M'. Then click OK. This smart album more or less does as search of the whole iPhoto Library and only displays items that match your search tearm of "Movie" exactly. In that smart album then you can find the original Movies you want to move out of iPhoto and into iMovie, <CTRL> click on the Movie clip, then choose Reveal in Finder. That will jump you out of iPhoto temporarily and into the iPhoto Library folder. From there you can move that movie file to the desktop. Move all the clips you want, once they're all collected up go to iMovie and go to the File Menu > Import Files. Then point it to the desktop where you moved your video clips.
    This will put all those videos into an Event folder in iMovie and bypass iPhoto Videos altogether.

  • Trouble Importing Photos into iMovie

    I am trying to import photos into iMovie and am having trouble. They look like they are importing OK, and when the import is through (the red bar has finished loading) the picture disappears and the clip becomes blank. This is happening when I import from the finder, from iPhoto, or from FILE>Import, and with lots of different photo sizes, none seem to work. My iMovie project file is located on an external drive with tons of space. I have plenty of space of the startup disk, so I don't know why this is happening, and it was working fine a few days ago. Any ideas?

    I had this problem last year (August-Sept 2007), and I'm having it again now (August 2008). When I import jpeg photos from iPhoto to iMovie, they turn black and are not accessible in iMovie. In addition, this time when I imported several photos, the replay of the iMovie became jerky. When I threw out the photos, the movie became smoother, the way it was originally. There seems to be some sort of bug that has not been fixed in over a year.

  • I recently bought a lightning to 30 pin adapter for my new iPad so that I could continue to use my 30 pin to VGA cord, but when I plug the VGA cord into it it says it is not supported. They are all apple products, so why doesn't it work?

    I recently bought a lightning to 30 pin adapter for my new iPad so that I could continue to use my 30 pin to VGA cord, but when I plug the VGA cord into it it says it is not supported. They are all apple products, so why doesn't it work?

    If it is a lightning to 30 pin adaptor, and you have a 7th Generation Nano it has to fit the Nano.
    This is lightning to 30 pin adapter: http://www.bestbuy.com/site/Apple%26%23174%3B---Lightning-to-30-Pin-Adapter/6651 936.p?id=1218803450821&skuId=6651936#tab=overview
    Is this what you bought?
    You need to contact Sony and see if they model you have is compatible with the docking adapter. It may not be.

  • Photos into iMovie: yes, it's been addressed, but...

    ... I can't find exactly my issue, at least not recently.
    Many of the posts on this topic seem to be about exporting to iDVD, but that's not my problem. It starts earlier. My photos get compressed and look terrible as soon as they're imported into iMovie. I have '09, but the local Apple Store didn't think upgrading to '11 would help, because -- such as I understand -- a single large photo is much bigger than a frame of video or something more or less like that.
    Now, I pretty much just want to do slideshows, high-quality slideshows, and I don't even care about Ken Burns effects. But before you say: DON'T do this in iMovie! That's not what it's for! Do it in something else! Consider:
    -People I know who use Final Cut Pro (which is more than I want to invest, anyway) say that it, too, has problems importing and manipulating photos. No one I know has Final Cut Express to play around with, and there's no Free Demo, obviously.
    -I've now dabbled in both FotoMagico and Photo to Movie, and they seem to have some things going for them, but I can't seem to control audio in them as well as in iMovie, and that's a huge problem. I need to control fades precisely, and I need multiple audio tracks to layer and cross-fade.
    -Other programs I've dabbled with, such as Aperture 3 and Sounds Slides, also have limited ability to manipulate sound and/or adjust the length of individual slides.
    -One responder in a forum last year named Klaus  suggested an elegant work-around: create the slideshow in Photo to Movie (which he uses) or FotoMagico (which he guessed would work ok), and then bring it back into iMovie as a .dv video clip for sound editing and finishing. I tried this, but P2M compressed the images when I saved as a .dv (back to square one), and I couldn't figure out a way to export in FM that iMovie would recognize.
    So . . .
    Is there a better way to import photos into iMovie to preserve integrity? (I don't think so)
    Is there a better way to export video out of FotoMagico or P2M into iMovie?
    Is there something I'm missing about their sound editing capabilities?
    Can Final Cut Express do what I want without much more excess capacity than I need and a huge learning curve?
    Are there any other programs?
    Klaus, Bengt, others -- please weigh in!!!
    Thanks, Danke, Merci . . .
    Fred

        Understanding your data use is important, Rustyhinges! There are many things that can factor into a sudden increase in data. Thank you for ensuring Facebook Video is off. You can also view which applications are using the most data by going to Settings, Data Usage and scrolling to the bottom. As Android_Optimizer mentioned, making sure the device is not syncing to cloud services and restricting background data are great steps to keeping the phone data use, controlled. Please let us know if you have further concerns on this. Thank you.
    TanishaS1_VZW
    Follow us on Twitter @VZWSupport

  • When I drag photos into iMovie, the image quality is degraded.  Can I somehow prevent the degradation?

    When I drag photos into iMovie, the image quality is degraded.  Can I somehow prevent the degradation?

    Hi
    A very common origin to jumpy picture is
    • Recorded material in one frame rate e.g. 29.97fps (NTSC) and iDVD set to do a 25fps (PAL) project - OR the other way around.
    It delivers a DVD but a very bad one.
    I do convert all my material to same fps as the DVD I want to do (e.g. PAL) - before any editing etc.
    I use JES_Deinterlacer or Compressor to do this and the result is so much better.
    JES_Deinterlacer is free on Internet and makes a Great job - Professional alternatives comes at an astronomical cost and the quality is not hardly no better.
    Yours Bengt W

  • Exporting photos into iMovie

    I import photos from my camera into iphoto as raw.
    When I want to import photos into imovie they come in as raw, how can I change the format into jpeg, and still keep the raw file in iphoto?
    Thank you

    Merelyn:
    Upon import into iPhoto, RAW files get a jpg version generated by iPhoto for use and editing. No editor will or can modify the original RAW file. The edits are always saved to some other format, jpg, tiff, etc. Those jpgs should be the ones that are exported/imported into iMovie for use via the Media Browser. iMovie will copy them in and resize to the size it uses. So there should not be a problem with the large RAW files.
    TIP: For insurance against the iPhoto database corruption that many users have experienced I recommend making a backup copy of the Library6.iPhoto database file and keep it current. If problems crop up where iPhoto suddenly can't see any photos or thinks there are no photos in the library, replacing the working Library6.iPhoto file with the backup will often get the library back. By keeping it current I mean backup after each import and/or any serious editing or work on books, slideshows, calendars, cards, etc. That insures that if a problem pops up and you do need to replace the database file, you'll retain all those efforts. It doesn't take long to make the backup and it's good insurance.
    I've created an Automator workflow application (requires Tiger), iPhoto dB File Backup, that will copy the selected Library6.iPhoto file from your iPhoto Library folder to the Pictures folder, replacing any previous version of it. It's compatible with iPhoto 08 libraries and Leopard. iPhoto does not have to be closed to run the application, just idle. You can download it at Toad's Cellar. Be sure to read the Read Me pdf file.

  • Import non-iPhoto photo into iMovie

    How do you import a non-iPhoto photo into iMovie? I cannot figure out a way to do this.
    I use Adobe's Lightroom for all of my photo needs and would like to avoid iPhoto if possible.

    You can drag and drop a photo into your project from the Finder. JPEG or PNG will work best.

  • How get photo into iMovie

    I have been trying to get a photo  into iMovie from iPhoto or from my desktop. BUT It won't drop into my movie. What am I doing wrong?

    Thanks much for responding. I have done all of those things, but the photo doesn't even show up in my choices once I click the camera. So it's something perhaps about how the photos are uploaded to iPhoto? They show up when I am in iPhoto, but they won't show up in iMovie when I navigate over to iPhoto. They are jpegs. I'm using iMovie / iPhoto from last year--that is, not the latest version.
    Thanks for any more insight!
    A.

  • Can't import photos from new "Photo" into iMovie 9.0.

    Since upgrading to the new Photo app, iMovie 9.0 only recognizes Photo Booth.  Previously I could drag and drop selected photos into iMovie, but now can't import them that way or through the Photo Browser in iMovie.  Any suggestions?

    Thanks for your insight.  Over the course of about a week, I did persistently try to upgrade to iMovie 10 but, despite the help of the Apple Support Community, could not get all my projects to migrate properly from iMovie 9 to 10.  Many of them Many of the 300 short projects come in a jumbled mess.  So I'm stuck with iMovie 9, which, in turn, means Photos won't connect properly when working with iMovie.  At least I know to stop trying and I'm able to go back to iPhoto without suffering any repercussions.

Maybe you are looking for

  • Issue with PR conversion to PO using ME59 withqty of similar line items

    Hi All, I'm having an issue with PR conversion to PO using ME59 I have a PR with the following line items with all same details except quantity ex 1 Mat  Qty  Unit Plant   St Loc M1   1    EA   P1      S1 M1   29   EA   P1      S1 The PR brings in th

  • ORABPEL Err: 10007 while deploying SOAOrderBooking appln.

    When i tried to deploy the SOAOrderBooking Appln...iam getting this compilation err: ORABPEl err:1007 ...tell me some suggestions pls... Error is: Error(453): [Error ORABPEL-10007]: unresolved messageType [Description]: in line 453 of "I:\downloads\c

  • Balance display with minor incorrect entry

    hi, in fs10n or fk10n or fd10n, i would like to clarify this. when i double click credit, it should show only credit balance but i still able to see there are few lines of debit balance. likewise also happen for debit balance where there are few line

  • Ctrl-f - copy the code into an action

    ctrl-f - apply last filter - can this code be easily formulated into an action or a script (analogous to a screen-grab perhaps?)

  • SRM iViews open in New Window instead of Portal Content Area

    Hi folks, We are implementing SRM 7.0 business package on our Enterprise Portal 7. By default, all the SRM iViews open in a New Window. But, when I change the iViews to open in the Content Area, only the first iView that I try to open will open in th