Class final project need help

I have this final project due Monday for my java class. I'm having some trouble with this zoom slider which gives me 2 errors about "cannot find symbol". I've tried just about eveything i can think of and i cant come up with the solution... Here is my code:
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JFrame;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.event.*;
import javax.swing.*;
import java.util.*;
import java.awt.event.*;
import java.awt.*;
import java.io.*;
public class MenuExp extends JFrame implements MouseMotionListener,MouseListener,ActionListener
/* creates the file menus and submenus */
     JMenu fileMenu = new JMenu("File");
    JMenu plotMenu = new JMenu("Plotting");
    JMenu helpMenu = new JMenu("Help");
    JMenuItem loadAction = new JMenuItem("Load");
    JMenuItem saveAction = new JMenuItem("Save");
    JMenuItem quitAction = new JMenuItem("Quit");
    JMenuItem colorAction = new JMenuItem("Segment Colors");
    JMenuItem helpAction = new JMenuItem("Instructions");
    JButton button;
     Cursor previousCursor = new Cursor(Cursor.DEFAULT_CURSOR);
    JLabel cLabel;
    JPanel cPanel;
    private String filename = null;  // set by "Open" or "Save As"
    double scale = 1.0;
    public MenuExp(File f)
        setTitle("PlotVac");
        Container pane = getContentPane();
        ImageIcon chartImage = new ImageIcon(f.getName());
          ChartDisplay chartLabel = new ChartDisplay(chartImage);
          JScrollPane scpane = new JScrollPane(chartLabel);
          pane.add(scpane, BorderLayout.CENTER);
          chartLabel.addMouseListener(this);  //change cursor
          chartLabel.addMouseMotionListener(this); //handle mouse movement
          JPanel cPanel = new JPanel();
          cLabel= new JLabel("cursor outside chart");
          cPanel.add(cLabel);
          pane.add(cPanel, BorderLayout.NORTH);
          button = new JButton("Clear Route");
        button.setAlignmentX(Component.LEFT_ALIGNMENT);
        button.setFont(new Font("serif", Font.PLAIN, 14));
          cPanel.add(button);
          getContentPane().add(getSlider(), "Last");
/* Creates a menubar for a JFrame */
        JMenuBar menuBar = new JMenuBar();
/* Add the menubar to the frame */
        setJMenuBar(menuBar);
/* Define and add three drop down menu to the menubar */
        menuBar.add(fileMenu);
        menuBar.add(plotMenu);
        menuBar.add(helpMenu);
/* Create and add simple menu item to the drop down menu */
        fileMenu.add(loadAction);
        fileMenu.add(saveAction);
        fileMenu.addSeparator();
        fileMenu.add(quitAction);
        plotMenu.add(colorAction);
        helpMenu.add(helpAction);
         loadAction.addActionListener(this);
         saveAction.addActionListener(this);
         quitAction.addActionListener(this);
    private JSlider getSlider()
        JSlider slider = new JSlider(25, 200, 100);
        slider.setMinorTickSpacing(5);
        slider.setMajorTickSpacing(25);
        slider.setPaintTicks(true);
        slider.setPaintLabels(true);
        slider.addChangeListener(new ChangeListener()
            public void stateChanged(ChangeEvent e)
                 int value = ((JSlider)e.getSource()).getValue();
                 cPanel.zoom(value/100.0);
        return slider;
    private void zoom(double scale)
        this.scale = scale;
        cPanel.setToScale(scale, scale);
        repaint();
/* Handle menu events. */
       public void actionPerformed(ActionEvent e)
          if (e.getSource() == loadAction)
               loadFile();
         else if (e.getSource() == saveAction)
                saveFile(filename);
         else if (e.getSource() == quitAction)
               System.exit(0);
/** Prompt user to enter filename and load file.  Allow user to cancel. */
/* If file is not found, pop up an error and leave screen contents
/* and filename unchanged. */
       private void loadFile()
         JFileChooser fc = new JFileChooser();
         String name = null;
         if (fc.showOpenDialog(null) != JFileChooser.CANCEL_OPTION)
                name = fc.getSelectedFile().getAbsolutePath();
         else
                return;  // user cancelled
         try
                Scanner in = new Scanner(new File(name));  // might fail
                filename = name;
                while (in.hasNext())
                in.close();
         catch (FileNotFoundException e)
                JOptionPane.showMessageDialog(null, "File not found: " + name,
                 "Error", JOptionPane.ERROR_MESSAGE);
/* Save named file.  If name is null, prompt user and assign to filename.
/* Allow user to cancel, leaving filename null.  Tell user if save is
/* successful. */
       private void saveFile(String name)
         if (name == null)
                JFileChooser fc = new JFileChooser();
                if (fc.showSaveDialog(null) != JFileChooser.CANCEL_OPTION)
                  name = fc.getSelectedFile().getAbsolutePath();
         if (name != null)
              try
                  Formatter out = new Formatter(new File(name));  // might fail
                    filename = name;
                  out.close();
                  JOptionPane.showMessageDialog(null, "Saved to " + filename,
                    "Save File", JOptionPane.PLAIN_MESSAGE);
                catch (FileNotFoundException e)
                  JOptionPane.showMessageDialog(null, "Cannot write to file: " + name,
                   "Error", JOptionPane.ERROR_MESSAGE);
/* implement MouseMotionListener methods */     
     public void mouseDragged(MouseEvent arg0)
     public void mouseMoved(MouseEvent arg0)
          int x = arg0.getX();
          int y = arg0.getY();
          cLabel.setText("X pixel coordiate: " + x + "     Y pixel coordinate: " + y);
/*      implement MouseListener methods */
     public void mouseClicked(MouseEvent arg0)
     public void mouseEntered(MouseEvent arg0)
         previousCursor = getCursor();
         setCursor(new Cursor (Cursor.CROSSHAIR_CURSOR) );
     public void mouseExited(MouseEvent arg0)
         setCursor(previousCursor);
         cLabel.setText("cursor outside chart");
     public void mousePressed(MouseEvent arg0)
     public void mouseReleased(MouseEvent arg0)
/* main method to execute demo */          
    public static void main(String[] args)
         File chart = new File("teritory-map.gif");
        MenuExp me = new MenuExp(chart);
        me.setSize(1000,1000);
        me.setLocationRelativeTo(null);
        me.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        me.setVisible(true);
}and this is the other part:
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.geom.Line2D;
import javax.swing.Icon;
import javax.swing.JLabel;
public class ChartDisplay extends JLabel
/* line at 45 degrees from horizontal */
     private int x1=884, y1=290, x2=1084, y2=490;
/* horizontal line - x3 same as x2 */
     private int x3=1084, y3=490, x4=1384, y4=490;
     public ChartDisplay(Icon arg0)
          super(arg0);
/* This overrides inherited method to draw on image */
     protected void paintComponent(Graphics arg0)
          super.paintComponent(arg0);
/* Utility method to draw a "dot" at line ends */
     private void drawDot(Graphics g, Color c, int xDot, int yDot, int sizeDot)
          Color previousColor = g.getColor();
          g.setColor(c);
            g.fillOval(xDot-(sizeDot/2), yDot-(sizeDot/2), sizeDot, sizeDot);
            g.setColor(previousColor);   
/* Utility method to draw a wider line */
     private void drawLine(Graphics g, Color c, int lineWidth, int xStart, int yStart, int xEnd, int yEnd)
          Color previousColor = g.getColor(); // save previous color
          Graphics2D g2 = (Graphics2D) g;  // access 2D properties
            g2.setPaint(c);  // use color provided as parameter
         g2.setStroke(new BasicStroke(lineWidth)); // line width
         g.setColor(previousColor);    // restore previous color
}I've basically used the structure of other programs and incorporated them into my design. If anyone knows how i can fix the errors please let me know. The errors are found in line 91 and 100 which is where the zoom slider is occuring.
**NOTE** the program isnt fully functional in the sense that there are buttons and tabs etc.. that are missing action listeners and things like that.
Thanks for the help
Edited by: gonzale3 on Apr 17, 2008 6:55 PM

gonzale3 wrote:
The code was on the forums as the person who posted it was using it as an example in a program he used... i didnt borrow the entire code im just using the way he did the zoom method and added it into my program. I wasnt aware that it was used in the JPanel class. C'mon, it's your program. If you don't know what you are doing in this program, then you shouldn't be using it.
That is why im asking if someone can show me the right way to implement a zoom slider into my program or maybe give me an example where its used.What the fuck is a zoom slider???
Edited by: Encephalopathic on Apr 17, 2008 8:00 PM

Similar Messages

  • I'm trying to reinstall Logic Pro 9, and it says It's already installed. I have a project due for class and I need help asap. Please help!!!

    I'm trying to reinstall Logic Pro 9, and it says It's already installed. I have a project due for class and I need help asap. Please help!!!

    Yea I am. I deleted Logic Pro 9 and moved the App to the Trashcan like normal. Then when I go to install it, it says its already Installed. When I do this with other apps; it works fine, the install thing comes back up like it should once you have deleted the app

  • A Menu Applet Project (need help)

    The Dinner Menu Applet
    I would need help with those codes ...
    I have to write a Java applet that allows the user to make certain choices from a number of options and allows the user to pick three dinner menu items from a choice of three different groups, choosing only one item from each group. The total will change as each selection is made.
    Please send help at [email protected] (see the codes of the project at the end of that file... Have a look and help me!
    INSTRUCTIONS
    Design the menu program to include three soups, three
    entrees, and three desserts. The user should be informed to
    choose only one item from each group.
    Use the following information to create your project.
    Clam Chowder 2.79
    Vegetable soup 2.99
    Peppered Chicken Broth 2.49
    Chicken 12.79
    Fish 10.99
    Beef 14.99
    Vanilla Ice Cream 2.79
    Rice Pudding 2.99
    Cheesecake 4.29
    The user shouldn�t be able to choose more than one item
    from the same group. The item prices shouldn�t be visible to
    the user.
    When the user makes his or her first choice, the running
    total at the bottom of the applet should show the price of
    that item. As each additional item is selected, the running
    total should change to reflect the new total cost.
    The dinner menu should be 200 pixels wide �� 440 pixels
    high and be centered on the browser screen. The browser
    window should be titled �The Menu Program.�
    Use 28-point, regular face Arial for the title �Dinner Menu.�
    Use 16-point, bold face Arial for the dinner menu group titles
    and the total at the bottom of the applet. Use 14-point regular
    face Arial for individual menu items and their prices. If you
    do not have Arial, you may substitute any other sans-serif
    font in its place. Use Labels for the instructions.
    The checkbox objects will use the system default font.
    Note: Due to complexities in the way that Java handles
    numbers and rounding, your price may display more than
    two digits after the decimal point. Since most users are used
    to seeing prices displayed in dollars and cents, you�ll need to
    display the correct value.
    For this project, treat the item prices as integers. For example,
    enter the price of cheesecake as 429 instead of 4.29. That
    way, you�ll get an integer number as a result of the addition.
    Then, you�ll need to establish two new variables in place of
    the Total variable. Run the program using integers for the
    prices, instead of float variables with decimals.
    You�ll have the program perform two mathematical functions
    to get the value for the dollars and cents variables. First,
    divide the total price variable by 100. This will return a
    whole value, without the remainder. Then get the mod of the
    number versus 100, and assign this to the cents variable.
    Finally, to display the results, write the following code:
    System.out.println("Dinner Price is $ " + dollars +"." + cents);
    Please send code in notepad or wordpad to [email protected]
    Here are the expectations:
    HTML properly coded
    Java source and properly compiled class file included
    Screen layout as specified
    All menu items properly coded
    Total calculates correctly
    * MenuApplet.java
    import java.applet.*;
    import java.awt.*;
    import java.awt.event.*;
    * @author Rulx Narcisse
         E-mail address: [email protected]
    public class MenuApplet extends java.applet.Applet implements ItemListener{
    //Variables that hold item price:
    int clamChowderPrice= 279;
    int vegetableSoupPrice= 299;
    int pepperedChickenBrothPrice= 249;
    int chickenPrice= 1279;
    int fishPrice= 1099;
    int beefPrice= 1499;
    int vanillaIceCreamPrice= 279;
    int ricePuddingPrice= 299;
    int cheeseCakePrice =429;
    int dollars;
    int cents=dollars % 100;
    //cents will hold the modulus from dollars
    Label entete=new Label("Diner Menu");
    Label intro=new Label("Please select one item from each category");
    Label intro2=new Label("your total will be displayed below");
    Label soupsTrait=new Label("Soups---------------------------");
    Label entreesTrait=new Label("Entrees---------------------------");
    Label dessertsTrait=new Label("Desserts---------------------------");
      *When the user makes his or her first choice, the running
         total (i.e. dollars) at the bottom of the applet should show the price of
         that item. As each additional item is selected, the running
         total should change to reflect the new total cost.
    Label theDinnerPriceIs=new Label("Dinner Price is $ "+dollars +"."+cents);
      *Crating face, using 28-point, regular face Arial for the title �Dinner Menu.�
         Using 16-point, bold face Arial for the dinner menu group titles
         and the total at the bottom of the applet & using 14-point regular
         face Arial for individual menu items and their prices.
    Font bigFont = new Font ("Arial", Font.PLAIN,28);
    Font bigFont2 = new Font ("Arial", Font.BOLD,16);
    Font itemFont = new Font ("Arial", Font.PLAIN,14);
    //Here are the radiobutton on the applet...
    CheckboxGroup soupsG = new CheckboxGroup();
        Checkbox cb1Soups = new Checkbox("Clam Chowder", soupsG, false);
        Checkbox cb2Soups = new Checkbox("Vegetable Soup", soupsG, true);
        Checkbox cb3Soups = new Checkbox("Peppered Chicken Broth", soupsG, false);
    CheckboxGroup entreesG = new CheckboxGroup();
        Checkbox cb1Entrees= new Checkbox("Chicken", entreesG, false);
        Checkbox cb2Entrees = new Checkbox("Fish", entreesG, true);
        Checkbox cb3Entrees = new Checkbox("Beef", entreesG, false);
    CheckboxGroup dessertsG = new CheckboxGroup();
        Checkbox cb1Desserts= new Checkbox("Vanilla Ice Cream", dessertsG, false);
        Checkbox cb2Desserts = new Checkbox("Pudding Rice", dessertsG, true);
        Checkbox cb3Desserts = new Checkbox("Cheese Cake", dessertsG, false);
        public void init() {
            entete.setFont(bigFont);
            add(entete);
            intro.setFont(itemFont);
            add(intro);
            intro2.setFont(itemFont);
            add(intro2);
            soupsTrait.setFont(bigFont2);
            add(soupsTrait);
            cb1Soups.setFont(itemFont);cb2Soups.setFont(itemFont);cb3Soups.setFont(itemFont);
            add(cb1Soups); add(cb2Soups); add(cb3Soups);
            cb1Soups.addItemListener(this);cb2Soups.addItemListener(this);cb2Soups.addItemListener(this);
            entreesTrait.setFont(bigFont2);
            add(entreesTrait);
            cb1Entrees.setFont(itemFont);cb2Entrees.setFont(itemFont);cb3Entrees.setFont(itemFont);
            add(cb1Entrees); add(cb2Entrees); add(cb3Entrees);
            cb1Entrees.addItemListener(this);cb2Entrees.addItemListener(this);cb2Entrees.addItemListener(this);
            dessertsTrait.setFont(bigFont2);
            add(dessertsTrait);
            cb1Desserts.setFont(itemFont);cb2Desserts.setFont(itemFont);cb3Desserts.setFont(itemFont);
            add(cb1Desserts); add(cb2Desserts); add(cb3Desserts);
            cb1Desserts.addItemListener(this);cb2Desserts.addItemListener(this);cb2Desserts.addItemListener(this);
            theDinnerPriceIs.setFont(bigFont2);
            add(theDinnerPriceIs);
           public void itemStateChanged(ItemEvent check)
               Checkbox soupsSelection=soupsG.getSelectedCheckbox();
               if(soupsSelection==cb1Soups)
                   dollars +=clamChowderPrice;
               if(soupsSelection==cb2Soups)
                   dollars +=vegetableSoupPrice;
               else
                   cb3Soups.setState(true);
               Checkbox entreesSelection=entreesG.getSelectedCheckbox();
               if(entreesSelection==cb1Entrees)
                   dollars +=chickenPrice;
               if(entreesSelection==cb2Entrees)
                   dollars +=fishPrice;
               else
                   cb3Entrees.setState(true);
               Checkbox dessertsSelection=dessertsG.getSelectedCheckbox();
               if(dessertsSelection==cb1Desserts)
                   dollars +=vanillaIceCreamPrice;
               if(dessertsSelection==cb2Desserts)
                   dollars +=ricePuddingPrice;
               else
                   cb3Desserts.setState(true);
                repaint();
        }

    The specific problem is that when I load he applet, the radio buttons do not work properly and any calculation is made.OK.
    I had a look at the soup radio buttons. I guess the others are similar.
    (a) First, a typo.
    cb1Soups.addItemListener(this);cb2Soups.addItemListener(this);cb2Soups.addItemListener(this);That last one should be "cb3Soups.addItemListener(this)". The peppered chicken broth was never responding to a click. It might be a good idea to write methods that remove such duplicated code.
    (b) Now down where you respond to user click you have:
    Checkbox soupsSelection=soupsG.getSelectedCheckbox();
    if(soupsSelection==cb1Soups)
        dollars +=clamChowderPrice;
    if(soupsSelection==cb2Soups)
        dollars +=vegetableSoupPrice;
    else
        cb3Soups.setState(true);What is that last bit all about? And why aren't they charged for the broth? Perhaps it should be:
    Checkbox soupsSelection=soupsG.getSelectedCheckbox();
    if(soupsSelection==cb1Soups) {
        dollars +=clamChowderPrice;
    } else if(soupsSelection==cb2Soups) {
        dollars +=vegetableSoupPrice;
    } else if(soupsSelection==cb3Soups) {
        dollars +=pepperedChickenBrothPrice;
    }Now dollars (the meal price in cents) will have the price of the soup added to it every time.
    (c) It's not enough to just calculate dollars, you also have to display it to the user. Up near the start of your code you have
    Label theDinnerPriceIs=new Label("Dinner Price is $ "+dollars +"."+cents);It's important to realise that theDinnerPriceIs will not automatically update itself to reflect changes in the dollars and cents variables. You have to do this yourself. One way would be to use the Label setText() method at the end of the itemStateChanged() method.
    (d) Finally, the way you have written itemStateChanged() you are continually adding things to dollars. Don't forget to make dollars zero at the start of this method otherwise the price will go on and on accumulating which is not what you intend.
    A general point: If you have any say in it use Swing (JApplet) rather than AWT. And remember that both Swing and AWT have forums of their own which may be where you get the best help for layout problems.

  • Final year project need help

    hi there
    i am doing an applet for my final year project. at the end of this project i have to end up with a simple uml drawing applet. i have done some coding but am way outa my league and now i am stuck. i have managed to draw lines and rectangles but have no idea how to make the lines attch to the rectangles or how to move a rectangle around the screenonce it has been drawn. my email address is [email protected] if you mail me i can give you my program and maybe you can help me

    You are right V.V, this applet is not finished yet, try this one,
    press the oval/rectangle/desic buttons and add shapes by clicking on an empty square, after adding some shapes press the line button, by clicking on 2 shapes you will add a line to connect them. you can drag the shapes and the lines will follow.
    Use double click for text. Drag the shape out of the screen and it will be deleted.
    import java.applet.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.util.*;
    public class Flow extends Applet
         Button lineB = new Button("Line");
         Button rectB = new Button("Rect");
         Button ovalB = new Button("Oval");
         Button desiB = new Button("Desic");
         Button clirB = new Button("Clear");
         Label  typeL = new Label("             ");
         Dcanvas  canvas     = new Dcanvas();
    public void init()
         setLayout(new BorderLayout());
         add("Center",canvas);
         addButtons();
         resize(730,440);
    private void addButtons()
         lineB.addActionListener(new ButtonHandler());
         rectB.addActionListener(new ButtonHandler());
         ovalB.addActionListener(new ButtonHandler());
         desiB.addActionListener(new ButtonHandler());
         clirB.addActionListener(new ButtonHandler());
         Panel panel = new Panel();
         panel.add(lineB);
         panel.add(rectB);
         panel.add(ovalB);
         panel.add(desiB);
         panel.add(clirB);
         panel.add(typeL);
         add("North",panel);
    class ButtonHandler implements ActionListener
    public void actionPerformed(ActionEvent ev)
         String s = ev.getActionCommand();
         if(s.equals("Clear")) canvas.clear();
         if(s.equals("Line"))  canvas.setType(1);
         if(s.equals("Rect"))  canvas.setType(2);
         if(s.equals("Oval"))  canvas.setType(3);
         if(s.equals("Desic")) canvas.setType(4);
    public class Dcanvas extends Panel
         Vector    objects = new Vector();
         Vector    lines   = new Vector();
         TextField txt     = new TextField("");
         Mobject   rc,rl,rd;
         Mline     ln;
         boolean   rcd  = false;
         boolean   rcl  = false;
         boolean   rct  = false;
         Rectangle rp;
         Graphics2D G;
         int sx,sy,oi;
         int objectType = 0;     
         int maxV = 8;
         int maxH = 9;
         int sizeW = 80;
         int sizeH = 50;
    public Dcanvas()
         super();
         setLayout(null);
         addMouseListener(new MouseHandler());
         addMouseMotionListener(new MouseMotionHandler());
         setFont(new Font("",0,9));
         txt.setSize(114,23);
         txt.setFont(new Font("",0,15));
         txt.setBackground(new Color(192,220,192));
         add(txt);
         txt.setVisible(false);
         txt.addTextListener(new TextListener()     
         {     public void textValueChanged(TextEvent e)
                   rc.setText(txt.getText());     
                   repaint(rc.x,rc.y,rc.width,rc.height);
    public void clear()
         objects.removeAllElements();
         lines.removeAllElements();
         objectType = 0;
         typeL.setBackground(Color.white);
         typeL.setText("");
         txt.setVisible(false);
         repaint();
    public void setType(int i)
         if (rcl) repaint(rl.x,rl.y,rl.width+1,rl.height+1);
         objectType = i;
         typeL.setBackground(Color.pink);
         if (i == 1)     typeL.setText(" Lines");
         if (i == 2)     typeL.setText(" Rects");
         if (i == 3)     typeL.setText(" Ovals");
         if (i == 4)     typeL.setText(" Desic");
         rcl = false;
    public void dragIt(int X, int Y)
         repaint(rc.x,rc.y,rc.width,rc.height);
         rc.x = rc.x + X - sx;
         rc.y = rc.y + Y - sy;
         rc.setPaintArea();
         sx   = X;
         sy   = Y;
         repaint(rc.x,rc.y,rc.width,rc.height);
    public void moveIt(int X, int Y)
         rcd = false;
         repaint(rc.x,rc.y,rc.width,rc.height);
         rc.x = X;
         rc.y = Y;
         rc.setPaintArea();
         repaint(rc.x,rc.y,rc.width,rc.height);
         Mline ml;
         for (int i=0; i < lines.size(); i++)
              ml = (Mline)lines.get(i);
              if (ml.from == rd || ml.to == rd)
                   ml.setPaintArea();
                   repaint();
    public void deleteIt()
         rcd = false;
         Mline ml;
         for (int i=0; i < lines.size(); i++)
              ml = (Mline)lines.get(i);
              if (ml.from == rd || ml.to == rd)
                   lines.remove(i);
                   i--;
         objects.remove(rc);
         repaint();
    public void paint(Graphics g)
         rp = g.getClipBounds();
         g.setColor(Color.white);
         g.fillRect(rp.x,rp.y,rp.width,rp.height);
         g.setColor(new Color(240,240,240));
         for (int x=0; x < 721; x=x+sizeW) g.drawLine(x,0,x,400);
         for (int y=0; y < 401; y=y+sizeH) g.drawLine(0,y,720,y);
         for (int i=0; i < lines.size(); i++) ((Mline)lines.get(i)).paint(g);
         for (int i=0; i < objects.size(); i++) ((Mobject)objects.get(i)).paintW(g);
         if (rcd) rc.paintD(g);
         if (rcl) rc.paintL(g);
    public void update(Graphics g)
         paint(g);
    //     *********   mouse   ************
    class MouseHandler extends MouseAdapter
    public void mousePressed(MouseEvent e)
         txt.setVisible(false);
         for (int i=0; i < objects.size(); i++)
              if (((Rectangle)objects.get(i)).contains(e.getX(),e.getY()))
                   rc  = (Mobject)objects.get(i);
                   rd  = rc;
                   sx  = e.getX();
                   sy  = e.getY();
                   if (e. getClickCount() == 2)  
                        txt.setLocation(rc.x,rc.y+rc.height-1);
                        txt.setText(rc.getText());
                        txt.setVisible(true);
                        txt.requestFocus();
                   rcd = true;
         if (rcd && rcl)
              ln  = new Mline(rl,rc);
              lines.add(ln);
              rcd = false;
              rcl = false;
              rp.setBounds(rc);
              rp.add(rl);
              repaint(rp.x,rp.y,rp.width,rp.height);
         if (rcd && objectType == 1)
              rcd = false;
              rcl = true;
              rl  = rc;
              repaint(rc.x,rc.y,rc.width,rc.height);
    public void mouseReleased(MouseEvent e)
         int x = e.getX()/sizeW;
         int y = e.getY()/sizeH;
         x = x * sizeW + 1;
         y = y * sizeH + 1;
         if (rcd)
              if (x > maxH || y > maxV) deleteIt();
                   else                  moveIt(x,y);
              return;     
         if (objectType == 2 || objectType == 3 || objectType == 4)
              rc = new Mobject(objectType,x,y,sizeW-2,sizeH-2);
              objects.add(rc);
              repaint(rc.x,rc.y,rc.width,rc.height);
    class MouseMotionHandler extends MouseMotionAdapter
    public void mouseDragged(MouseEvent e)
         if (rcd) dragIt(e.getX(),e.getY());
    //     *********   mouse  end ************
    class Mobject extends Rectangle
         long    id;
         int     type;
         int     ax,ay,aw,ah;
         String  text = "";
         Polygon po   = new Polygon();
    public Mobject(int t, int x,int y,int w,int h)
         super(x,y,w,h);
         type = t;
         setPaintArea();
         type = t;
         id = System.currentTimeMillis();
    public void setText(String s)
         text = s;
    public String getText()
         return(text);
    public void setPaintArea()
         ax = x + 5;
         ay = y + 5;
         aw = width  - 10;
         ah = height - 10;
         if (type == 4)
              po.npoints = 0;
              po.addPoint(ax+aw/2,ay);
              po.addPoint(ax+aw,ay+ah/2);
              po.addPoint(ax+aw/2,ay+ah);
              po.addPoint(ax,ay+ah/2);
              po.addPoint(ax+aw/2,ay);
    public void paintL(Graphics g)
         g.setColor(Color.orange);
         paint(g);
    public void paintD(Graphics g)
         g.setColor(Color.red);
         paint(g);
    public void paintW(Graphics g)
         g.setColor(Color.white);
         paint(g);
    public void paint(Graphics g)
         if (type == 2) g.fillRect(ax,ay,aw,ah);
         if (type == 3) g.fillOval(ax,ay,aw,ah);
         if (type == 4) g.fillPolygon(po);
         g.setColor(Color.black);
         if (type == 2) g.drawRect(ax,ay,aw,ah);
         if (type == 3) g.drawOval(ax,ay,aw,ah);
         if (type == 4) g.drawPolygon(po);
         g.drawString(text,ax+3,ay+ah/2+2);
    class Mline
         Mobject from,to;
         int x1,y1,x2,y2;
    public Mline(Mobject f, Mobject t)
         from = f;
         to   = t;
         setPaintArea();
    public void setPaintArea()
         x1 = from.x + from.width/2;
         y1 = from.y + from.height/2;
         x2 = to.x + to.width/2;
         y2 = to.y + to.height/2;
    public void paint(Graphics g)
         g.setColor(Color.blue);
         g.drawLine(x1,y1,x2,y2);
    Noah

  • Last Project -- Need Help, Please

    Okay, this is my last project, and I am struggling with it. The specification we were given was to write a program that reads in a file of dates and outputs the dates in descending order, using a priority queue. The PriorityQueue should implement the PriorityQueueInterface interface, and should implements a priority queue using a singly linked list. The list should be maintained in sorted order. This implementation should not use a heap.
    I have the code built, but when I run it is not reading my dates fully, and I get an error message. The LinkList is already built for us, but here is the rest of my code. First I input from my dates.txt:
    11/12/2000
    04/04/2004
    01/02/1998
    import java.io.*;
    public class DateDriver {
       public static void main(String[] args) throws IOException {
          PriorityQueue pq = new PriorityQueue();
          // ... read all Date objects from the file and enqueue them in the pq object
          BufferedReader in = new BufferedReader (new FileReader("C:/Users/April/Desktop/UMUC/CMIS241/Project4/Dates.txt"));
          Date date = new Date();
          date.input(in);
          while (!date.isNull()){
               pq.add(date);
               date = new Date();
               date.input(in);
               System.out.println(date);
          // ... dequeue the pq object and display the Date objects
          System.out.println("The dates in descending order are: ");
          while (!pq.isEmpty()){
               date = (Date) pq.dequeue();
               date.output(System.out);
    import java.io.BufferedReader;
    import java.io.IOException;
    import java.io.PrintStream;
    public class Date implements InOutputable, Comparable {
       // ... define monthNames as a ?static final? array of String objects
       //  initialize the array with the first 3 characters of each month
         static final String[] monthNames = {null, "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep",
              "Oct", "Nov", "Dec"};
       // ... define the instance variables of class Date, i.e. day, month, year
         private String monthAbr, date;
         private int month, day, year;
       // ... define the default constructor (initializes the instance variables to zero)
         public Date(){
              this.date = "";
              month = 00;
              day = 00;
              year = 0000;
       // ... define the method toString
       //     This method should return the corresponding Date string in the following format: Nov, 11, 2006
         public String toString() {
               return (monthAbr + ", " + day + ", " + year);
       // ... define the methods specified by the interface InOutputable
    public boolean equals(InOutputable other) {
         Date otherDate = (Date) other;
         if (month == otherDate.month && day == otherDate.day && year == otherDate.year)
              return true;
         else
              return false;
    public void input(BufferedReader in) throws IOException {
         date = in.readLine();
         if (date == null)
              return;
         month = Integer.parseInt(date.substring(0, 2));
         day = Integer.parseInt(date.substring(3, 5));
         year = Integer.parseInt(date.substring(6, 10));
    public boolean isNull() {
         if (month == 0 && day == 0 && year == 0)
              return true;
         else
              return false;
    public void output(PrintStream writer) {
         writer.println(toString());
       // ... define the method specified by the interface Comparable
    public int compareTo(Object o) {
         Date otherDate = (Date) o;
         if(month == otherDate.month && day == otherDate.day && year == otherDate.year)
              return 0;
         else if (month >= otherDate.month && day >= otherDate.day && year >= otherDate.year)
              return 1;
         else
              return -1;
    public class PriorityQueue implements PriorityQueueInterface {   
       private RefSortedList lst = new RefSortedList();
       // ... define the methods specified by the interface PriorityQueueInterface
    public Comparable dequeue() throws EmptyQueue {
         return null;
    public void enqueue(Comparable key) throws FullQueue {
    public boolean isEmpty() {
         return false;
       // ... Use the lst object (by invoking list specific methods on it) when
       //     defining the PriorityQueueInterface methods.
       //     For example, method enqueue should be implemented by invoking list method add.
    public void add(Date date){
         lst.add(date);
    public void remove(Date date){
         lst.remove(date);
    }My output:
    Exception in thread "main" java.lang.NullPointerException
         at DateDriver.main(DateDriver.java:27)
    null, 4, 2004
    null, 2, 1998
    null, 0, 0
    The dates in descending order are:
    Can anybody please point me in the right direction? I know I am missing something, but I am unable to pinpoint it. I don't understand why the date.output(System.out) is throwing a null pointer exception. I am still working, but I thought maybe a fresh pair of eyes would help me.

    Dates implement Comparable... no need to sort them yourself
    SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy");
    LinkedList<Date> dtes = new LinkedList<Date>();
    BufferedReader in = new BufferedReader (new FileReader("C:/dates.txt"));
    while (in.read()>0){
    dtes.add(sdf.parse(in.readLine()));
    }Edited by: wpp289 on Dec 11, 2008 1:27 PM

  • Project -  need help rather quickly

    I am doing a 2 minute/ish long small project which will involve images flowing across the screen......with text which appears over them. Thats it taken down to basics.
    http://www.coremelt.com/products/products-for-final-cut-studio/imageflow-demo-re el.html
    is pretty much the effect i want to go for, but i am wondering if i can do those type of effects in FCP (i have about 3 weeks) without that plugin?
    If so can someone post some type of tutorials, to help a novice out.
    If not....i suppose i will need to buy the plugins in the video for £50.
    thanks

    Do you have only Final Cut Pro, or also Motion? This sort of animation can be done in either. But if you're not that familiar with the methods to set up the animations and managing all the tracks/objects involved it would certainly take a lot less time to use a canned animation tool like the one you linked to. It depends on whether you're getting paid to do this, I would imagine!

  • Student Project - Need Help With ViewPlatform Rotation

    Hello folks,
    I'm a student in Strathclyde University, Glasgow, and I'm currently doing a small project for one of my programming classes. I'm doing a 3D knots and crosses game but I'm having tremendous difficulty getting the rotation to work just the way I want it to. Let me decribe what I need.
    Visualise 27 cubes, arranged in a 3 x 3 x 3 structure, space out slightly: a 3D knots and crosses setup. I'm trying to get the ViewPlatform to rotate around the central cube in a spherical fashion.
    I also need this rotation to use the keyboard arrow keys, not the mouse because I am reserving the mouse for interaction using the PickMouseBehavior class as stated in my project specification.
    I have looked up various classes in the API: such as KeyNavigator, OrbitBehavior, and some VisAd class that isn't included with the Java3D API nor is it on the systems I have available at the university.
    The trouble is, all these classes that I have found do not rotate the way I need them to: as described above. They "turn left" and "turn right" the camera as opposed to "rotate left around" and "rotate right around" the central cube (i.e horizontal rotation of the camera on a wide circle around an object).
    They also "move forward" and "move backward" as opposed to "rise up around" and "drop down around" the central cube (i.e. vertical rotation on a wide circle around an object).
    I have previously tackled this problem by creating a dummy cube under the central cube using then attaching the "camera" to the dummy cube in the DarkBASIC programming language and wonder if this method is available using Java.
    I've thought about defining my own arrow key rotation class, but I have little idea how to go about doing that either.
    An additional bonus would be the ability to limit vertical rotation so as not to go over and upside-down the vertical limit.
    Any help would be appreciated.

    I appreciate the answer and I know about implementing a Behavior to do this particular function of the program: is this what you are suggesting?
    If so, could you provide some clarity onto how go about implementing a Behavior to do the type of rotations I stated in my first post? By clarity I mean a little bit more about the recipe for creating a Behavior: the API is lacking documentation on this I think.
    I'll go do a bit of reading on it and tell you where I get. Nonetheless, any further advice would be much appreciated.

  • At wit's end with imovie project -- need Help!

    Aloha:
    I am in the middle of doing a documentary movie of the yearly Air Show put on by my RC model airplane club. Over the past several years I have made a handful of other documentaries and all with out problem, they worked just fine.
    On this one, however, I have run into problems that are new and completely frustrating. I have finished editing the movie and all works well in the iMovie mode. I can play the entire movie and all the parts and pieces work just fine. But when I burn the results onto a DVD some scenes (only a few) lose camera audio. This is also true if I export it to Quicktime.
    My movie uses camera audio, imported background music and narrative voice-over. And all those play just fine in the iMovie program. But there are several spots where the camera audio doesn't come across in the final product, just total silence except for the background music or any voice-over narrations that may be present during those times. The camera audio just does not come through.
    I am at wit’s end and need some help. Has anyone come across this and what did you do to fix it?
    Thanks
    Dan Page
    Maui, Hawaii

    Hi: Thank you very much for the rapid come back, most appreciated.
    Hi Dan
    A wild guess. Can it be so that those clips are
    recorded in Your Camera with
    the sound set to 12-bit (often factory/default set).
    Should be 16-bit
    I'll check the camera for that, but the same camera was used in all the clips and only two or three were missing audio when exported.
    Try to extract the missing sounds from each clip and
    redo a disk image in
    iDVD and see if the sound is back.
    That sounds like a great diagnostic and should be far less time consuming than burning a DVD.
    Thanks for the hints.
    Dan Page
    Yours Bengt W

  • Project - need help

    Hello everyone, I am completely new to Java and am currently taking a beginner class. My instructor encouraged us to get on the forums for help so that's what I'm doing. My overall goal of the started project below is to have the user select one of the options and have a message dispaly (either a label box or a message box - doesnt matter) that states the corresponding Grade they would receive in the class. He's a huge Chiefs fan, that's why I'm doing it like this - for brownie points. I really am 100% new to all of this, any help would be greatly appreciated. I really really want all the lbls to be on one line and all the visibility to be set to false until they check one of them and the visibility comes up true until they check a diff one, etc...
    Here's what I've got so far:
    import java.applet.*;
    import java.awt.*;
    import java.awt.event.*;
    public class ListenApplet extends Applet implements ItemListener
         //Declare components
         CheckboxGroup cGrades = new CheckboxGroup();
         Checkbox optRock = new Checkbox("Chiefs Rock!", cGrades, false);
         Checkbox optGood = new Checkbox("Chiefs are Good!", cGrades, false);
         Checkbox optMaybe = new Checkbox("Chiefs Might Win!", cGrades, false);
         Checkbox optChance = new Checkbox("Chiefs Don't Have a Chance!", cGrades, false);
         Checkbox optSuck = new Checkbox("Chiefs Suck!", cGrades, false);
         Checkbox chkBold = new Checkbox("Bold");
         Font fntBold = new Font("Times New Roman", Font.BOLD, 12);
         Font fntPlain = new Font("Times New Roman", Font.PLAIN, 12);
         Label lblFontStyle = new Label("THE CHIEFS QUIZ");
         Label lblGradeA = new Label("You get an A!");
         Label lblGradeB = new Label("You get a B!");
         Label lblGradeC = new Label("You get a C!");
         Label lblGradeD = new Label("You get a D!");
         Label lblGradeF = new Label("You get an F!");
         public void init()
              //Add controls
              setBackground(Color.orange);
              Panel pnlChoices = new Panel();
              pnlChoices.setLayout(new GridLayout(20,0));
              pnlChoices.add(lblFontStyle);
              pnlChoices.add(chkBold);
              pnlChoices.add(lblGradeA);
              pnlChoices.add(lblGradeB);
              pnlChoices.add(lblGradeC);
              pnlChoices.add(lblGradeD);
              pnlChoices.add(lblGradeF);
              pnlChoices.add(new Label("Choose Wisely "));
              pnlChoices.add(optRock);
              pnlChoices.add(optGood);
              pnlChoices.add(optMaybe);
              pnlChoices.add(optChance);
              pnlChoices.add(optSuck);
              add(pnlChoices);
              chkBold.addItemListener(this);
              optRock.addItemListener(this);
              optGood.addItemListener(this);
              optMaybe.addItemListener(this);
              optSuck.addItemListener(this);
         public void itemStateChanged(ItemEvent item)
              //A check box or option button changed state. Check to see which
              //item changed and take action.
              //Get the object that caused the event
              Object eventSource = item.getSource();
              //Test for the Bold check box
              if (eventSource == chkBold)
                   if (chkBold.getState())
                   lblFontStyle.setFont(fntBold);
                   else
                   lblFontStyle.setFont(fntPlain);
    }

    There are a couple of options here:
    1) You can call setVisible(false) to hide the labels. However, that may have an effect on the layout of the container.
    2) Use a card layout and put in the label AND a blank component, and swap between them
    3) Make a subclass of JLabel. Override paintComponent, such that, if it should be displayed, it calls super.paintComponent. Otherwise, it just returns.
    (My preference is the third option).
    - Adam

  • Uni Game project, need help

    hi, i have an assignment for uni where i have to make a text game according to a given scenario, a part of the game has a bomb room and a bomb timer, where if the player doesent get the code right within 10 seconds the bomb explodes and the player has the choice to restart.
    here is the code to the bomb, im not sure if the sleep method timer is causing the problems, it runs, but when you choose y to restart it just goes into this error:
    Exception in thread "main" java.util.InputMismatchException
    at java.util.Scanner.throwFor(Scanner.java:840)
    at java.util.Scanner.next(Scanner.java:1461)
    at java.util.Scanner.nextInt(Scanner.java:2091)
    at java.util.Scanner.nextInt(Scanner.java:2050)
    at hostage.Main.main(Main.java:134)
    here is the code:
         boolean go = true;
         boolean countfinish = false;
         Scanner sc = new Scanner(System.in);
         int rn1, rn2, answer, sumofrn1rn2;
         boolean restart = true;
         System.out.println("you have entered the BOMB ROOM!!! solve the equasion within 10 seconds to defuse the bomb");
         System.out.println();
    //below is the equasion to defuse the bomb     
    rn1 = (int)(Math.random()*1000);
    rn2 = (int)(Math.random()*1000);
         System.out.print(rn1);
         System.out.print(" + ");
         System.out.print(rn2);
         System.out.print(" = ");
         answer = 0;
         sumofrn1rn2 = (rn1+rn2);
         try
    // the sleep method of the thread object is called
    Thread.sleep(10000);
    catch(InterruptedException e)
    countfinish = true;
    if (countfinish == true)
         if (sumofrn1rn2 != answer)
    System.out.println("You faild, oh and your dead... Restart? (y/n)");
    restart2 = sc.next().charAt(0);
    if (restart2 == 'y')     
         Current_Room = "ROOM 1";
         System.out.println("Welcome to the Lobby!.....again....");
         answer = sc.nextInt();
         if (answer == rn1+rn2)
              System.out.println("You have defused the bomb... fewww...");
              //go back to lobby
    any help would be appresiated, thank you

    No problem. One thing that I noticed after testing it out for a bit more...
    With those implementations, you only get 1 guess, which I suppose is accurate to real life. If you want them to be able to have multiple guesses then, here's some new implementation
    import java.util.Timer;
    import java.util.TimerTask;
    import java.io.BufferedReader;
    import java.io.InputStreamReader;
    import java.util.Random;
    public class BombGameTest
         private BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
         private boolean failed = false;
         public static void main(String[] args)
              new BombGameTest().bombTest();
         public void bombTest()
              class ExplodeBomb extends TimerTask
                   int timeLeft = 10;
                   public void run()
                        if (timeLeft != 0)
                             System.out.println(timeLeft-- + "...");
                        else
                             System.out.println();
                             failed = true;
                             System.out.println("You failed to difuse the bomb, you are now dead. Restart? [y/n] ");
                             String tmp = "";
                             try
                                  tmp = br.readLine();     //Like the Scanner.nextLine();
                             } catch(Exception ex) {}
                             if (tmp.toUpperCase().equals("Y"))
                                  //run some restart method
                             else
                                  System.exit(0);
              System.out.println("You have entered the BOMB ROOM!!! Solve the equation within 10 seconds to defuse the bomb.");
              System.out.println();
              Random randGen = new Random();
              int r1 = randGen.nextInt(1000);     //basically the same as the random() method
              int r2 = randGen.nextInt(1000);
              System.out.print(r1);
              System.out.print(" + ");
              System.out.print(r2);
              System.out.println(" = ? ");
              Timer t = new Timer();
              t.scheduleAtFixedRate(new ExplodeBomb(), 0,1000);
              int answer = 0;
              boolean incorrect = true;
              while (incorrect)
                   try
                        answer = Integer.parseInt(br.readLine());
                   } catch (Exception ex) {}
                   if (answer == r1 + r2 && !failed)
                        t.cancel();
                        System.out.println("Congrats! You defused the bomb.");
                        incorrect = false;
    }

  • Massive iDVD project-Need help breaking it up

    I have been working on a comprehensive DVD of all of my family photos dating back to 1890. I have chapters split up by decades and then submenus within divided up by years. It is almost 2000 photos (no iMovies). Each year is its own slideshow with music attached (slideshow created within iDVD). The monster is 16gigs and over 800 minutes long (according to the project info), however, if you just add up each slideshow it only adds up to about 4 hours of material. I have a red "X" in the top box of my map view that says "total menu duration exceeds 15 minutes", however when I duplicate the project and start deleting chapters it never goes away.
    Is there away to easily split this project up into 2 or 3 DVD's?
    Or perhaps make the menus smaller?
    No one slide show is more than 13 minutes long.
    I am open to suggestions on how to tame this bohemoth.
    Thanks!

    As much as you would like it to be all on one DVD, clearly you need to break it up, unless you really want to burn it to a double layer DVD, which can accomodate 4 hours. This includes all the menus.
    I would break it up into two or three DVDs, by doing just what you tried; duplicate the DVD project and then delete the parts you don't want in the duplicates,so that you end up with 2 or 3 DVDs of 2hrs or 1 1/2hrs each. Since you already have them organized into years, it should be simple enough to do.

  • New to SAP FICO - Placed in a support project - Need Help

    Hi everyone,
    I have placed for a support project in a retail industry and I have been taken FICO as my module. Can you guys help me in knowing what all things I have to do in the initial stage
    Regards,
    Prajeesh
    SAP FICO Consultant
    Moderator: Please, read and respect SDN rules

    They are in the same path in the jar file that they were when they were on your disk in the file system. Lets say you have a dir structure
    C:\dir1\dir2\dir3\dir4\file.txt
    and you cd to dir2:
    cd \dir1\dir2
    then you jar dir3:
    jar cvf jar.jar dir3/*.*
    the path to file.txt would still be /dir3/dir4/file.txt inside the jar file.
    do a jar tvf jarfile.jar and take a look.

  • Finally Rebuilding: Need Help

    Hi guys
    Now at last, after the obvious delay during the start of Euro2004, I'm rebuilding the computer!  I just want to do it right this time with connections and BIOS settings etc so I need some help.  If it crashes today after this test, it's off to the hardware store for a new psu.
    (1) I have the BIOS that came as standard pre-installed in the retail boxed MSI motherboard.  I bought this in February or early March, can't recall.... I don't know what version it is ... do I need to upgrade?  I've never "flashed" anything before ... how do I do it?  Is it worth it?
    (2) I'm connecting my two sata HDDs to the VIA controller ... not raid, just two separate drives.  When I F6 on the Windows XP installation, I insert the VIA drivers floppy that came with teh motherboard.  I install the following drivers:
           (a) VIA ATA driver for Windows XP
           (b) VIA SATA RAID driver for Windows XP
    .... is that correct or do I just want (b) ?
    (3) Before anything else, do I need to "clear the CMOS jumper"?  What exactly does this mean and how is it done?  Is it necessary?
    (4) Do I need to enable/disable any BIOS settings just to get up and running?
    (5) I want to run the following programs to test the system:
    ------ Memtest86
    ------ the newer version of Memtest from wonkanoby's site
    ------ Prime95
    I haven't got a clue how to do this or what to do ... I'm reading about "blend tests" and "torture tests" and "large FFTs" and I need some seeeerious explanation
    By the end of this test, I hope to establish that my memory and cpu are not faulty and are not overheating, so I just need to return/change the psu.  As it stands, I might have more faulty components and ned to return them too.
    Thanks for your help.
    Fizz
    p.s. .... some of you asked how I had HDD LED working on the VIA controller.  Well, the red light on the case came on whenever the HDD was doing a read or write, but there was no case light ... I probabaly had the connectors the wrong way round.  I had:
    ON JFP1-----------------------
    * Reset Switch = on pins 7 & 5 with the label facing outwards ... i.e. at the Promise controller
    * HDD LED = on pins 1 & 3, label facing same way as Reset Switch
    * Power Switch = on pins 8 & 6, label facing oposite direction from HDD LED and Reset Switch ... i.e. with the label facing the bottom of the case and the white wire connected to the "+" sign on pin 6, the black wire connected to the "-" sign on pin 8.
    * My case has no 2-pin connector for Power LED on JFP1 ... instead it has a 3pin connector for Power LED on JFP2 ... is that why I get no Power LED?
    ON JFP2---------------------
    * 3pin Power LED = on pins 1,3,5 ... label facing outwards towards Promise controller
    * 4pin Speaker = on pins 2,4,6,8 ... label facing oposite of Power LED ... i.e. facing bottom of case.

    My PC has crashed again.  This, however, is totally different to the previous problem.  That does indeed seem to have been caused by a faulty cpu cooler installation and automatic hardware shutdown due to overheating.  That problem resulted (every time) in a total hardware collapse, so that all fans would stop, the monitor would go black and essentially all electricity would stop flowing in the computer.  You would then need to go to the mains socket and turn it OFF-ON before being able to use the Power button on the case.  Once I found that the cpu cooler was loose on the motherboard (and that it could actually lose contact with the cpu when the case was upright), I reinstalled it, using the correct backplate (I had been using the wrong one before).  Since then, the same problem has nver occured and the pc has been running fine for about 10 days with no problems whatsoever.  Until now...
    This problem is different.  The fans keep spinning and there is no trouble with electricity.  Instead, Windows XP just seems to freeze.  It happened when I visited a website.  I was using a proper firewall and antivirus program (updated very recently).  It just froze for a few seconds ... I tried ctrl-alt-del but that didn't work so I just pressed the Power button on the case to shutdown.  This freezing problem occured from time to time on my Windows95 PC and pressing the Power button is the only way to fix it.  When you restart, Scandisk starts but you just exit immediately and there are no problems.  It occurs on Windows95 when I have a lot of multitasking going on, which is probably due to lack of Ram (32 mb).  This new PC, however, has 1024mb of Ram.  I've checked the Ram extensively using the Microsoft Memory Diagnostic Tool (boot from floppy) it passed every possible test configuration without any errors.  Anyway, back to my story ... when I pressed the Power button, nothing happened but a few seconds later, the PC "unfroze" and the mouse cursor became moveable again.  Windows then shutdown properly (on Win95 it just literally zaps off when you press the Power button ... XP obviously controlls the process more carefully).  
    The PC then started back fine and I went back online and then shut the PC off for the night.  This morning, whilst using the internet again, the PC froze the same way.  ... Shut the PC down and then turned it back on .... Upon restart, a blue screen saying "UNMOUNTABLE BOOT VOLUME" appeared.  I've seen this before, once or twice, with the previous problem.  Subsequent attempts at restarting the machine led to the follwing black screen.
    Windows XP was unable to start up normally, please select how you would like to start up:
    Safe Mode
    Safe Mode with Prompt
    Last Known Good Configuration
    Normal Mode
    .... Windows will start up in Normal Mode in (xx seconds [counting down])
    I tried all apart from Safe Mode with Prompt (it probably won't work if Safe Mode didn't work and I don't want to get into command line operations right now).  When you select a mode for restart, e.g. Normal Mode, it goes along fine for the first few seconds and then when the Windows XP splashscreen appears, it stalls.  The blue progress bar under the Windows XP logo keeps moving from end to end repeatedly but it doesn't move on from there.  It stays there for about 30 seconds and then the same blue screen appears again.
    It seems to be a software problem (probably with Windows) but I did notice one unusual thing with hardware.  When it froze last night whilst I was online, the hard drive started making sporadic "beep" noises that I haven't heard before.  When starting Windows up now (and failing), the same "beep" noises come again.  In addition to these "beep" noises, the hard drive starts spinning (the slight high-pitch whine noise) and then seems to restart ... i.e. the whine dies down for a second and then restarts, like spinning slows down and then the disk spins up again.  Hard drive corruption would seem a bit unlikely, as it's been running fine for a week now with no problems and the hard drives are on their own (not in the SmartDrives anymore), running at perfectly normal temperatures.
    Any suggestions?  I was thinking of running chkdsk.
    By The Way:
    I managed to transfer all my files from my Windows95 and Windows3.1 PCs, by connecting their HDDs to my new PC and using copy-paste in "My Computer".  The Windows3.1 HDD took a while longer and a couple of restarts of XP before it would show up, but it worked.  These were installed under a couple of subdirectories called something like:
    /myOldWin95PC
    /myOldWin3.1PC
    I copied the whole drive, so Windows95 and Windows3.1 and DOS were copied too.  Was this a bad idea for conflicts etc?  I deleted the Windows3.1 and DOS folders and just kept the data.  Windows XP is supposed to have protection against such conflicts anyway.
    Thanks for all your help everyone.

  • Getting codec error in  a fcp project NEED HELP ASAP

    All of my other projects seem to be working fine, but one project in Paticular when I try to export using "quickime conversion" I get a codec error....as soon as I hit enter...therefore I cannot get it to convert to a quicktime file.
    I went an checked another project and it converted fine, it's just this one. how can I trouble shoot this.

    Just copy what's in the sequence. This is just a quick fix if it works. You would still probably want to figure out what happened in the old project to avoid it in the future.
    Seems like maybe you have the wrong sequence settings or something. Others here would be better equipped to troubleshoot it.
    Good Luck.

  • Help Needed - FINAL PROJECT - SAAJ MESSAGING

    Hi there!
    currently im doing my final project and it involves sending and receiving soap messages.
    im working with sun java studio creator for the first time.
    i have done this example (excuse me for possible dumb errors im just a noobie):
    * Page1.java
    * Created on 6 de Novembro de 2006, 12:40
    package webapplication1;
    import com.sun.rave.web.ui.appbase.AbstractPageBean;
    import com.sun.rave.web.ui.component.Body;
    import com.sun.rave.web.ui.component.Form;
    import com.sun.rave.web.ui.component.Head;
    import com.sun.rave.web.ui.component.Html;
    import com.sun.rave.web.ui.component.Link;
    import com.sun.rave.web.ui.component.Page;
    import javax.faces.FacesException;
    import com.sun.rave.web.ui.component.Button;
    import com.sun.rave.web.ui.component.TextArea;
    //soap saaj
    import javax.xml.*;
    import javax.xml.soap.*;
    import java.net.URL;
    import java.net.*;
    import java.util.*;
    import javax.xml.soap.SOAPConnectionFactory;
    import javax.xml.soap.SOAPConnection;
    import javax.xml.soap.MessageFactory;
    import javax.xml.soap.SOAPMessage;
    import javax.xml.soap.SOAPPart;
    import javax.xml.soap.SOAPEnvelope;
    import javax.xml.soap.SOAPBody;
    import javax.xml.soap.SOAPElement;
    // add this import if you need soapaction
    import javax.xml.soap.MimeHeaders;
    import javax.xml.transform.TransformerFactory;
    import javax.xml.transform.Transformer;
    import javax.xml.transform.Source;
    import javax.xml.transform.stream.StreamResult;
    import com.sun.xml.messaging.saaj.*;
    import java.net.URL;
    import javax.xml.soap.*;
    import java.util.Iterator;
    import javax.xml.soap.Name;
    import javax.xml.soap.MessageFactory;
    import javax.xml.soap.SOAPMessage;
    import javax.xml.soap.SOAPBody;
    import javax.xml.soap.SOAPPart;
    import javax.xml.soap.SOAPEnvelope;
    import javax.xml.soap.SOAPBodyElement;
    import javax.xml.messaging.ReqRespListener;
    import java.text.NumberFormat;
    import javax.xml.transform.TransformerFactory;
    import javax.xml.transform.Transformer;
    import javax.xml.transform.Source;
    import javax.xml.transform.stream.StreamResult;
    import com.sun.xml.messaging.saaj.*;
    * <p>Page bean that corresponds to a similarly named JSP page. This
    * class contains component definitions (and initialization code) for
    * all components that you have defined on this page, as well as
    * lifecycle methods and event handlers where you may add behavior
    * to respond to incoming events.</p>
    import javax.xml.messaging.JAXMServlet;
    //extends JAXMServlet
    public class Page1 extends AbstractPageBean implements ReqRespListener{
    // <editor-fold defaultstate="collapsed" desc="Creator-managed Component Definition">
    private int __placeholder;
    * <p>Automatically managed component initialization. <strong>WARNING:</strong>
    * This method is automatically generated, so any user-specified code inserted
    * here is subject to being replaced.</p>
    private void _init() throws Exception {
    private Page page1 = new Page();
    public Page getPage1() {
    return page1;
    public void setPage1(Page p) {
    this.page1 = p;
    private Html html1 = new Html();
    public Html getHtml1() {
    return html1;
    public void setHtml1(Html h) {
    this.html1 = h;
    private Head head1 = new Head();
    public Head getHead1() {
    return head1;
    public void setHead1(Head h) {
    this.head1 = h;
    private Link link1 = new Link();
    public Link getLink1() {
    return link1;
    public void setLink1(Link l) {
    this.link1 = l;
    private Body body1 = new Body();
    public Body getBody1() {
    return body1;
    public void setBody1(Body b) {
    this.body1 = b;
    private Form form1 = new Form();
    public Form getForm1() {
    return form1;
    public void setForm1(Form f) {
    this.form1 = f;
    private Button button1 = new Button();
    public Button getButton1() {
    return button1;
    public void setButton1(Button b) {
    this.button1 = b;
    private TextArea textArea1 = new TextArea();
    public TextArea getTextArea1() {
    return textArea1;
    public void setTextArea1(TextArea ta) {
    this.textArea1 = ta;
    private TextArea textArea2 = new TextArea();
    public TextArea getTextArea2() {
    return textArea2;
    public void setTextArea2(TextArea ta) {
    this.textArea2 = ta;
    // </editor-fold>/*
    public MessageFactory messageFactSent= null;
    public MessageFactory messageFactReply=null;
    public MessageFactory messageFactReceiv= null;
    public SOAPConnectionFactory soapConnectionFact;
    public URL URLendpoint;
    public SOAPConnection connection ;
    public SOAPMessage messageSent;
    public SOAPPart soapPartSent;
    public SOAPEnvelope soapEnvelopeSent;
    public SOAPBody SoapBodySent;
    public SOAPMessage messageReceiv;
    public SOAPPart soapPartReceiv;
    public SOAPEnvelope soapEnvelopeReceiv;
    public SOAPBody SoapBodyReceiv;
    public SOAPMessage messageReply;
    public SOAPPart soapPartReply;
    public SOAPEnvelope soapEnvelopeReply;
    public SOAPBody SoapBodyReply;
    public SOAPMessage reply;
    public String StringAux="";
    public final String theURI = "http://172.16.5.223:8080/WebApplication1/";
    //public final String theURI = "http://172.16.5.223:8080/WebApplication1/";
    //public final String theURI = "http://172.16.5.193:8080/WebApplication1/";
    //http://localhost:8080/WebApplication1/faces/Page1.jsp
    public SOAPMessage onMessage(SOAPMessage message) {
    StringAux=StringAux+"On message called in receiving servlet\n";
    this.textArea1.setValue(StringAux);
    try {
    soapPartReceiv = message.getSOAPPart( );
    soapEnvelopeReceiv = soapPartReceiv.getEnvelope();
    SoapBodyReceiv = soapEnvelopeReceiv.getBody();
    //analise...if needed
    // Create the reply message
    messageReply = messageFactReply.createMessage();
    soapEnvelopeReply = messageReply.getSOAPPart().getEnvelope();
    SoapBodyReply= soapEnvelopeReply.getBody();
    // Remove empty header from the Envelope
    soapEnvelopeReply.getHeader().detachNode();
    Name bodyName = soapEnvelopeReply.createName("GetLastTradePrice",
    "m", "http://wombat.ztrade.com");
    SOAPBodyElement gltp = SoapBodyReply.addBodyElement(bodyName);
    Name name = soapEnvelopeReply.createName("symbol");
    SOAPElement symbol = gltp.addChildElement(name);
    symbol.addTextNode("SUNW");
    // Return a reply message back to the JAXM client
    StringAux=StringAux+"devolveu menssagem\n";
    this.textArea1.setValue(StringAux);
    return messageReply ;
    } catch(Exception e) {
    StringAux=StringAux+"Error in processi ng or replying to a message - e: " + e+"\n";
    this.textArea1.setValue(StringAux);
    return null;
    //this.getBean(name)
    public Page1() {
    // Service serve=new Service();
    // Client cli=new Client();
    // this.textArea1.setValue(serve.GetAux());
    // this.textArea2.setValue(cli.GetAux());
    // Create a MessageFactory
    try {
    URLendpoint=new URL(theURI);
    StringAux=StringAux+"depois de criar o endpoint \n";
    //Create SOAP connection
    soapConnectionFact = SOAPConnectionFactory.newInstance();
    connection = soapConnectionFact.createConnection();
    // Create a message from the message factory.
    messageFactSent = MessageFactory.newInstance();
    messageFactReply = MessageFactory.newInstance();
    messageFactReceiv = MessageFactory.newInstance();
    StringAux=StringAux+"depois de criar as message factory \n";
    this.textArea1.setValue(StringAux);
    } catch(Throwable e) {
    StringAux="erro2!\n"+StringAux+e.toString()+"\n";
    this.textArea1.setValue(StringAux);
    * <p>Return a reference to the scoped data bean.</p>
    protected ApplicationBean1 getApplicationBean1() {
    return (ApplicationBean1)getBean("ApplicationBean1");
    * <p>Return a reference to the scoped data bean.</p>
    protected RequestBean1 getRequestBean1() {
    return (RequestBean1)getBean("RequestBean1");
    * <p>Return a reference to the scoped data bean.</p>
    protected SessionBean1 getSessionBean1() {
    return (SessionBean1)getBean("SessionBean1");
    * <p>Callback method that is called whenever a page is navigated to,
    * either directly via a URL, or indirectly via page navigation.
    * Customize this method to acquire resources that will be needed
    * for event handlers and lifecycle methods, whether or not this
    * page is performing post back processing.</p>
    * <p>Note that, if the current request is a postback, the property
    * values of the components do <strong>not</strong> represent any
    * values submitted with this request. Instead, they represent the
    * property values that were saved for this view when it was rendered.</p>
    public void init() {
    // Perform initializations inherited from our superclass
    super.init();
    // Perform application initialization that must complete
    // before managed components are initialized
    // TODO - add your own initialiation code here
    // <editor-fold defaultstate="collapsed" desc="Creator-managed Component Initialization">
    // Initialize automatically managed components
    // Note - this logic should NOT be modified
    try {
    _init();
    } catch (Exception e) {
    log("Page1 Initialization Failure", e);
    throw e instanceof FacesException ? (FacesException) e: new FacesException(e);
    // </editor-fold>
    // Perform application initialization that must complete
    // after managed components are initialized
    // TODO - add your own initialization code here
    * <p>Callback method that is called after the component tree has been
    * restored, but before any event processing takes place. This method
    * will <strong>only</strong> be called on a postback request that
    * is processing a form submit. Customize this method to allocate
    * resources that will be required in your event handlers.</p>
    public void preprocess() {
    * <p>Callback method that is called just before rendering takes place.
    * This method will <strong>only</strong> be called for the page that
    * will actually be rendered (and not, for example, on a page that
    * handled a postback and then navigated to a different page). Customize
    * this method to allocate resources that will be required for rendering
    * this page.</p>
    public void prerender() {
    * <p>Callback method that is called after rendering is completed for
    * this request, if <code>init()</code> was called (regardless of whether
    * or not this was the page that was actually rendered). Customize this
    * method to release resources acquired in the <code>init()</code>,
    * <code>preprocess()</code>, or <code>prerender()</code> methods (or
    * acquired during execution of an event handler).</p>
    public void destroy() {
    public String button1_action() {
    try {
    StringAux=StringAux+"antes de criar a messagem para enviar\n";
    messageSent = messageFactSent.createMessage();
    soapEnvelopeSent = messageSent.getSOAPPart().getEnvelope();
    //SoapBodySent = messageSent.getSOAPPart().getEnvelope().getBody();
    SoapBodySent = soapEnvelopeSent.getBody();
    Name bodyName = soapEnvelopeSent .createName("GetLastTradePrice",
    "m", "http://wombat.ztrade.com");
    SOAPBodyElement gltp = SoapBodySent.addBodyElement(bodyName);
    Name name = soapEnvelopeSent.createName("symbol");
    SOAPElement symbol = gltp.addChildElement(name);
    symbol.addTextNode("SUNW");
    StringAux=StringAux+"\nContent of the message: \n"+messageSent.toString()+"\n";
    // Send the SOAP message and get reply
    StringAux=StringAux+"Sending message to URL: \n"+ URLendpoint+"\n"+this.URLendpoint.getPath()+"\n";
    reply = connection.call(messageSent,URLendpoint);
    StringAux=StringAux+"\n\n Content of the reply message: \n"+reply.toString()+"\n";
    this.textArea1.setValue(StringAux);
    //tratamento da resposta
    connection.close();
    } catch(Throwable e) {
    StringAux="erro!\n"+StringAux+e.toString()+"\n";
    this.textArea1.setValue(StringAux);
    return null;
    Very simple , on a click of the button a message was supost to be sent. and receive on the other machine. i have launched the same war file on both pcs
    but now nothing happens just a exception message
    com.sun.xml.messaging.saaj.SOAPExceptionImpl: java.security.PrivilegedActionException: com.sun.xml.messaging.saaj.SOAPExceptionImpl: Invalid Content-Type:text/html. Is this an error message instead of a SOAP
    ....could someone help me out here ,even share a wprking project with this goal
    thank you in advance
    DMS
    Message was edited by:
    DaniDaOne

    One time, after quitting IM and re-launching it later, my project disappeared from the project list.
    Apple Support told me to do this.
    1) quit IM
    2) with the finder, move the project out of the project directory
    3) launch IM
    4) quit IM
    5) with the finder, put the project back into the project directory
    6) launch IM
    My project re-appeared. He said these steps forces a project index to be rebuilt.
    Your symptoms are different but maybe the cure is the same --- good luck.

Maybe you are looking for