HELP, most probably a very simple solution!

I can compile the following file but I can't get it to run. I know something very simple is needed but I am still learning this java business and am currently brain dead. Please help as this is quite important for me! Any advice is much appreciated, thanks. It is basically meant to be a program to give co-ordinates in a JPanel etc... Please don't abuse me for not understanding!!! lol
import javax.swing.*;
import javax.swing.event.*;
import java.awt.*;
import java.awt.event.*;
//import com.borland.jbcl.layout.*;
public class Picker extends JPanel
     String imageFile = "Images/knob.jpg";
     // Create JPanel and set the dimensions so that the crosshairs go in the right place
     Image img = Toolkit.getDefaultToolkit().getImage(imageFile);
     JPanel hSPickerPanel = new JPanel()
          public Dimension getPreferredSize(){return new Dimension(100, 100);}
          public Dimension getMaximumSize(){return getPreferredSize();}
          public Dimension getMinimumSize(){return getPreferredSize();}
          //PaintComponent method for this JPanel Component. Each component needs
          //its own so that each can be redrawn.
          public void paintComponent(Graphics g)
               super.paintComponent(g);
               //     Graphics2D g2D = (Graphics2D)g;
               g.setClip(0, 0, getSize().width, getSize().height);
               // g2D.drawImage(BC, null, 0, 0);
               g.setXORMode(Color.WHITE);
               //Problem.
               // Draws the cross relating to the coordinates of the whole JPanel.
               // Not hSPickerPanel. Sorted. 01/08/03. each panel wants to have its
               //own paintComponent method.
               g.drawImage(img, xCoord, yCoord,15,15,this);
               // g.drawOval(xCoord, yCoord, 15, 15);
               //g.fillOval(xCoord, yCoord, 15,15);
               // g.drawLine(xCoord + 10 , yCoord,xCoord - 10 , yCoord);
               // g.drawLine(xCoord, yCoord + 10, xCoord, yCoord - 10);
               g.drawString(String.valueOf(xCoord) + ":" + String.valueOf(100 - yCoord), 54, 47);
     JLabel HueSatTitleLabel = new JLabel();
     JLabel hueSatLabel = new JLabel();
     int xCoord = 50;
     int yCoord = 50;
     String coordinates;
     String xString;
     String yString;
     GridBagLayout gridBagLayout1 = new GridBagLayout();
     JButton jButton1 = new JButton();
     public Picker()
          try
               jbInit(); // calls the method below that adds the button to 'this'
          catch(Exception e)
               e.printStackTrace();
     //dddddddddddddddddddddddddddddddddddddddddddddddddddddddd
     // BrtnsCtrstPckrPnl = new JPanel() creates JPanel.
     //     public void paintComponent(Graphics g)
     /*     super.paintComponent(g);
               Graphics2D g2D = (Graphics2D)g;
               g2D.setClip(0, 0, getSize().width, getSize().height);
               // g2D.drawImage(BC, null, 0, 0);
               g2D.setXORMode(Color.WHITE);
               g2D.drawLine(xCoord - 10, yCoord, xCoord + 10, yCoord);
               g2D.drawLine(xCoord, yCoord - 10, xCoord, yCoord + 10);
               g2D.drawString(String.valueOf(xCoord) + ":" + String.valueOf(100 - yCoord), 54, 47);
     /*          super.paintComponent(g);
               //     Graphics2D g2D = (Graphics2D)g;
                         g.setClip(0, 0, getSize().width, getSize().height);
                         // g2D.drawImage(BC, null, 0, 0);
                         g.setXORMode(Color.WHITE);
                         g.drawLine(xCoord + 10 , yCoord,xCoord - 10 , yCoord);
                         g.drawLine(xCoord, yCoord + 10, xCoord, yCoord - 10);
                         g.drawString(String.valueOf(xCoord) + ":" + String.valueOf(100 - yCoord), 54, 47);
     //ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
     private void jbInit() throws Exception
          this.setLayout(gridBagLayout1);
          hSPickerPanel.setBorder(BorderFactory.createEtchedBorder());
          HueSatTitleLabel.setBorder(BorderFactory.createEtchedBorder());
          HueSatTitleLabel.setText("Hue & Saturation");
          hueSatLabel.setBorder(BorderFactory.createEtchedBorder());
          xString = Integer.toString(xCoord);
          yString = Integer.toString(yCoord);
          coordinates = xString +" : "+ yString;
          hueSatLabel.setText(coordinates);
          hSPickerPanel.addMouseListener(new MouseAdapter()
                    public void mouseReleased(MouseEvent e)
                         xCoord = Math.max(Math.min(e.getX(), 100), 0);
                         yCoord = Math.max(Math.min(e.getY(), 100), 0);
                         displayCoordinates(xCoord,yCoord);
                         hSPickerPanel.repaint();
                    public void mousePressed(MouseEvent e)
                         xCoord = Math.max(Math.min(e.getX(), 100), 0);
                         yCoord = Math.max(Math.min(e.getY(), 100), 0);
                         displayCoordinates(xCoord,yCoord);
                         hSPickerPanel.repaint();
          hSPickerPanel.addMouseMotionListener(new MouseMotionAdapter()
                    public void mouseDragged(MouseEvent e)
                         xCoord = Math.max(Math.min(e.getX(), 100), 0);
                         yCoord = Math.max(Math.min(e.getY(), 100), 0);
                         displayCoordinates(xCoord,yCoord);
                         hSPickerPanel.repaint();
          //Add components to Back Panel (this)
          this.setMaximumSize(new Dimension(118, 165));
          this.setMinimumSize(new Dimension(118, 165));
          jButton1.setText("Reset");
          jButton1.addActionListener(new java.awt.event.ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                         jButton1_actionPerformed(e);
          this.add(hSPickerPanel, new GridBagConstraints(0, 1, 2, 1, 1.0, 1.0
               ,GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 3, 0, 0), 101, 102));
          this.add(HueSatTitleLabel, new GridBagConstraints(0, 0, 2, 1, 0.0, 0.0
               ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(2, 3, 0, 0), 30, 1));
          this.add(hueSatLabel, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0
               ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 3, 5, 0), 4, 3));
          this.add(jButton1, new GridBagConstraints(1, 2, 1, 1, 0.0, 0.0
               ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 3, 0));
     public void displayCoordinates(int x, int y)
          xString = Integer.toString(x);
          yString = Integer.toString(y);
          coordinates = xString +" : "+ yString;
          hueSatLabel.setText(coordinates);
     void jButton1_actionPerformed(ActionEvent e)
          xCoord = 50;
          yCoord = 50;
          displayCoordinates(xCoord, yCoord);
          hSPickerPanel.repaint();

Use a URL object to locate your image instead of a string. To do that, import the java.net.* library and create a URL object for your image:
import javax.swing.*;
import javax.swing.event.*;
import java.awt.*;
import java.awt.event.*;
//import com.borland.jbcl.layout.*;
import java.net.*;
public class Picker extends JPanel
    //String imageFile = "Images/knob.jpg";
    Class cl = ((Picker) this).getClass();
    URL imageURL=cl.getResource("Images/knob.jpg");
    // Create JPanel and set the dimensions so that the crosshairs go in the right place
    Image img = Toolkit.getDefaultToolkit().getImage(imageURL);
    JPanel hSPickerPanel = new JPanel()
}To view your Panel, you have to add a "main" method and create a frame to display your panel:
public class Picker extends JPanel
    void jButton1_actionPerformed(ActionEvent e)
    public static void main(String[] args)
     Picker p=new Picker();
     JFrame frame=new JFrame("Picker Example");
     frame.getContentPane().add(p);
     frame.setVisible(true);
     frame.pack();
}You can see your panel by:
- compiling: javac Picker.java
- and running your application with the "main" method: java Picker

Similar Messages

  • Plz help me on this very simple error

    hello everybody...i'm very new to java programming...i'm unable to execute my program though it has been compiled...my coding is something like this and is very easy>>
    class abc
    public static void main(String [] args)
    System.out.println("hello");
    and at the time of execution...this error is shown up>>
    C:\Documents and Settings\Ishan\Desktop>java abc
    Exception in thread "main" java.lang.NoClassDefFoundError: abc
    Caused by: java.lang.ClassNotFoundException: abc
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    Could not find the main class: abc. Program will exit.
    plz help me on this. thanks.

    Follow the instructions in this tutorial:
    http://java.sun.com/docs/books/tutorial/getStarted/cupojava/index.html
    See problem solutions here:
    http://java.sun.com/docs/books/tutorial/getStarted/problems/index.html

  • BreezySwing help requested (should be very simple)

    My final project for my beginning programming class is to create a calculator, much like the one built into Windows. It only needs to do what the basic one does, not the scientific.
    All I have so far is the GUI. The buttons do nothing yet.
    ////////////////////////////-A-//////////////////////////////////
    ///////////////////////-CALCULATOR-//////////////////////////////
    //////////////////////-FINAL PROJECT-////////////////////////////
    //////////////////////////-FOR-//////////////////////////////////
    ///////////////////////-MR. KAU'S-///////////////////////////////
    /////////////////-INTRODUCTION TO COMPUTERS-/////////////////////
    //////////////////////////-CLASS-////////////////////////////////
    //Imports
    import javax.swing.*;
    import BreezySwing.*;
    //Title
    public class Calculator extends GBFrame{
    //Vars
    private JButton CB, SevenB, EightB, NineB, DivideB, SquareRootB,
    FourB, FiveB, SixB, TimesB, PercentB, OneB, TwoB, ThreeB, MinusB,
    OneOverXB, ZeroB, NegativeB, DecimalB, AddB, EqualB;
    private DoubleField Window;
    //Constructor
    public Calculator(){
    //Fields
    Window = addDoubleField   (0    ,1,1,5,1);
    //Buttons
    CB = addButton ("C" ,2,3,1,1);
    SevenB = addButton ("7" ,3,1,1,1);
    EightB = addButton ("8" ,3,2,1,1);
    NineB = addButton ("9" ,3,3,1,1);
    DivideB = addButton ("/" ,3,4,1,1);
    SquareRootB = addButton ("sqrt" ,3,5,1,1);
    FourB = addButton ("4" ,4,1,1,1);
    FiveB = addButton ("5" ,4,2,1,1);
    SixB = addButton ("6" ,4,3,1,1);
    TimesB = addButton ("*" ,4,4,1,1);
    PercentB = addButton ("%" ,4,5,1,1);
    OneB = addButton ("1" ,5,1,1,1);
    TwoB = addButton ("2" ,5,2,1,1);
    ThreeB = addButton ("3" ,5,3,1,1);
    MinusB = addButton ("-" ,5,4,1,1);
    OneOverXB = addButton ("1/x" ,5,5,1,1);
    ZeroB = addButton ("0" ,6,1,1,1);
    NegativeB = addButton ("+/-" ,6,2,1,1);
    DecimalB = addButton ("." ,6,3,1,1);
    AddB = addButton ("+"  ,6,4,1,1);
    EqualB = addButton ("=" ,6,5,1,1);
    //Button Method, yo
    public void buttonClicked (JButton buttonObj){
    //EXE-CUTE-R OLO!!1!
    public static void main (String[] args){
    Calculator SCGUI = new Calculator();
    SCGUI.setLookAndFeel("MOTIF");
    SCGUI.setSize (250, 250);
    SCGUI.setVisible (true);
    } I'm sure there are easier ways to go about it than using BreezySwing, but that's what we were taught with, so... :sweat:
    I'm drawing a total blank on how to do this with a single Field. If someone could guide me in the correct direction, it would be much appreciated. I'm not asking for someone to finish my program, maybe just make it so it will add, and from that I'll figure out the division, multiplication, sqrt, etc. etc.
    Thanks in advance.

    Alright.
    I now seem to have come across a different problem. Being VERY new to Java, I am unable to make it so that the numbers 'add up' so to speak in the field. I press 5 and 5 shows up. I press 6, and 6 replaces the 5.
    if (buttonObj == TwoB){
    Window.setNumber(2.0);
    }I know that using setNumber will end up replacing it, but I'm not even sure how to get it so that when I press the 5 key, then the 6 key, that 56 will be in the field.
    Would I use getNumber, and then somehow add the setNumber? Should I not use setNumber at all?

  • Help!b prob. a simple solution...

    Everytime i execute a project i get this error message:
    Exception in Thread "main" java.lang.NoClassDefFoundError: project
    Press any key to continue...
    Could some one plz help me?

    Check this page.
    http://java.sun.com/learning/new2java/index.html
    If you want more help here, post the code, post what you are typing in, and post the full, exact error message.
    Some hints: Java is case sensitive. The java.exe command expects an argument that is the CLASS NAME not a file or path name.

  • HELP please.. Very simple, but I can't do it...

    Hi,
    How can i make and int be between 1 and 10? I'm using bluej. So I'm declaring the variable enjoyability as an int and then starting directly in the constructor like:
    public class Book
    private String author;
    private String title;
    private String cost;
    private String numberOfPages;
    private int enjoyability;
    private String genre;
    public Book(String author, String title, String cost, String numberOfPages, int enjoyability, String genre)
    this.author = author;
    this.title = title;
    this.cost = cost;
    this.numberOfPages = numberOfPages;
    this.enjoyability = enjoyability;
    this.genre = genre;
    public String author()
    return author;
    public String title()
    return title;
    public String cost()
    return cost;
    public String numberOfPages()
    return numberOfPages;
    public int enjoyability()
    return enjoyability;
    public String genre()
    return genre;
    public void print()
    System.out.println("\n############ LIBRARY ############");
    System.out.println("----------Book Details-----------");
    System.out.println(" Author: " + author() );
    System.out.println(" Title: " + title() );
    System.out.println(" Cost: " + cost() );
    System.out.println(" Number of pages: " + numberOfPages() );
    System.out.println(" Enjoyability: " + enjoyability() );
    System.out.println(" Genre: " + genre() );
    and then I have another class that stores the book I made and print it to the console:
    public class Library
    private ArrayList items;
    * Constructor for objects of class Library
    public Library()
    items = new ArrayList();
    public void addBook(Book newBook)
    items.add(newBook);
    public void alphaAdd()
    public int numberOfItems()
    return items.size();
    public void print()
    for(Iterator iter = items.iterator(); iter.hasNext(); ){
    Book book = (Book)iter.next();
    book.print();
    System.out.println();
    How can i limited it to be between 1 and 10?? Thanks

    public class Book
    private String author;
    private String title;
    private String cost;
    private String numberOfPages;
    private int enjoyability;
    private String genre;
    public Book(String author, String title, String cost, String numberOfPages, int enjoyability, String genre)
    this.author = author;
    this.title = title;
    this.cost = cost;
    this.numberOfPages = numberOfPages;
    this.enjoyability = enjoyability;
    this.genre = genre;
    public String author()
    return author;
    public String title()
    return title;
    public String cost()
    return cost;
    public String numberOfPages()
    return numberOfPages;
    public int enjoyability()
    return enjoyability;
    public String genre()
    return genre;
    public void print()
    System.out.println("\n############ LIBRARY ############");
    System.out.println("----------Book Details-----------");
    System.out.println(" Author: " + author() );
    System.out.println(" Title: " + title() );
    System.out.println(" Cost: " + cost() );
    System.out.println(" Number of pages: " + numberOfPages() );
    System.out.println(" Enjoyability: " + enjoyability() );
    System.out.println(" Genre: " + genre() );
    and then I have another class that stores the book I made and print it to the console:
    public class Library
    private ArrayList items;
    * Constructor for objects of class Library
    public Library()
    items = new ArrayList();
    public void addBook(Book newBook)
    items.add(newBook);
    public void alphaAdd()
    public int numberOfItems()
    return items.size();
    public void print()
    for(Iterator iter = items.iterator(); iter.hasNext(); ){
    Book book = (Book)iter.next();
    book.print();
    System.out.println();
    }

  • Help!!  2 very simple questions about Tomcat 5

    1. How can I run a servlet within a package?
    * I add the package to Tomcat 5.0\webapps\servlets-examples\WEB-INF\classes
    * I add the following to Tomcat 5.0\webapps\servlets-examples\WEB-INF\web.xml
    <web-app>
    <servlet>
    <servlet-name>ServletName</servlet-name>
    <servlet-class>Package.ServletName</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name> ServletName </servlet-name>
    <url-pattern> /servlet/ServletName </url-pattern>
    </servlet-mapping>
    </web-app>
    * I type in the address line the following:
    http://localhost/servlets-examples/servlet/ServletName
    But it does not work!
    2. I can run servlets and JSP files only when they are saved inside the following packages:
    Tomcat 5.0\webapps\servlets-examples\
    Tomcat 5.0\webapps\jsp-examples\
    How can I make my own folder if I want to use Tomcat 5?
    Any answer will be appreciated. Thanks in advance!

    1. How can I run a servlet within a package?
    Define package XXX for your servlet
    For eg : package xxx;
    class ServletTest extends HttpServlet
    * I add the package to Tomcat
    5.0\webapps\servlets-examples\WEB-INF\classes
    * I add the following to Tomcat
    5.0\webapps\servlets-examples\WEB-INF\web.xml
    <web-app>
    <servlet>
    <servlet-name>ServletName</servlet-name>
    <servlet-class>Package.ServletName</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name> ServletName </servlet-name>
    <url-pattern> /servlet/ServletName
    letName </url-pattern>
    </servlet-mapping>
    </web-app>
    * I type in the address line the following:
    http://localhost/servlets-examples/servlet/ServletName
    But it does not work!
    http://localhost/servlets-examples/servlet/ServletName
    What is the error being thrown here >>> 404 not found?
    2. I can run servlets and JSP files only when they are
    saved inside the following packages:
    Tomcat 5.0\webapps\servlets-examples\
    Tomcat 5.0\webapps\jsp-examples\
    How can I make my own folder if I want to use Tomcat
    5?
    create a folder under webapps for eg :
    myfirstapp
    and follow a similar directory structure that has been followed for the example applications.Register your context with the server.xml located at tomcat\conf\server.xml
    -Regards
    manikantan

  • Help with Logo and Banner  (probably a really simple task)

    This is most likely a very simple task...
    I am new to DW -- I was asked to learn it by my employer.
    Here's what I have done...
    Created a container DIV
    within container:
    banner DIV
    navigation DIV
    left column DIV
    Right Column DIV
    Footer
    An after thought was how I want to format the banner.  I want to divide the banner div into a left and right column.  Left side is the logo.  Right side is the text.
    Can someone lend me a hand or even offer a better solution?

    Within the banner container div either float the logo left or the content right.  No need to do both.
    http://www.w3schools.com/css/css_float.asp
    This is all depending on the amount of text and where you need it.  If you have a fixed size container and need things in a specific position, you could forget the float and absolutely position the elements within the parent (banner) container.
    http://www.w3schools.com/css/css_positioning.asp
    A word of advice though.  Pick up Fireworks, Photoshop, Illustrator or similar graphics editing program first and draw up a prototype of the design before you start coding things.  Make sure this is 100% (or at least 75%) sure what they want before you spend the time coding something.  You can ignore this comment if you already have completed this step, but I just thought I would throw it out there anyways.

  • FCP/FCE anamorphic to iDVD - A simple solution?

    I posted this over in the iDVD forum, but I would like to get some response from you guys on this matter too.
    I have seen a lot of discussions about how hard it is to get anamorphic material from FCP/FCE into iDVD. There seem to be a few complex workarounds using third party software etc.
    Today I suddenly came to think about a possible very simple solution.
    1. Export to QuickTime from FCP/FCE
    2. Open the clip in QuickTime Pro
    3. Choose the Window menu and choose Show Movie Properties
    4. Select the Video Track and click the Visual Settings tab
    5. Uncheck Preserve Aspect Ratio
    6. Change the width to 854 (DV-NTSC) or to 1024 (DV-PAL)
    7. Save the clip and quit QuickTime
    8. Open iDVD and start a new 16:9 Widescreen project
    9. Import your modified QuickTime clip
    10. Author and burn your DVD
    Is it really this easy? Are there any downsides to doing it this way?
    I just tested this workflow, and the finished DVD looked fine.
    I prefer using Compressor/DVD Studio Pro my self, but it would be nice to have a simple solution to offer those who ask about bringing anamorphic material from FCP/FCE into iDVD.
    I wonder why Apple has not implemented an anamorphic checkbox or something like that inside iDVD. I have not yet found any guidance from Apple on this matter. Have I missed something here?

    I gave the usual dimensions for Standard Definition DV Anamorphic as an example. The actual dimensions for DV Anamorphic NTSC and PAL are: 720x480 and 720x576, but when stretched, the right width is 854 and 1024 as mentioned in my first post. The dimentions you are mentioning are for High Definition 1080i/p
    If you are editing 720p, the dimentions are: 1280 × 720.
    This might be of help:
    http://en.wikipedia.org/wiki/Image:CommonVideoResolutions.svg

  • FCP/FCE anamorphic to iDVD widescreen - A simple solution?

    I have seen a lot of discussions about how hard it is to get anamorphic material from FCP/FCE into iDVD. There seem to be a few complex workarounds using third party software etc.
    Today I suddenly came to think about a possible very simple solution.
    1. Export to QuickTime from FCP/FCE
    2. Open the clip in QuickTime Pro
    3. Choose the Window menu and choose Show Movie Properties
    4. Select the Video Track and click the Visual Settings tab
    5. Uncheck Preserve Aspect Ratio
    6. Change the width to 854 (DV-NTSC) or to 1024 (DV-PAL)
    7. Save the clip and quit QuickTime
    8. Open iDVD and start a new 16:9 Widescreen project
    9. Import your modified QuickTime clip
    10. Author and burn your DVD
    Is it really this easy? Are there any downsides to doing it this way? The modified QuickTime clip's Movie Info in QuickTime says: Format: DV, 720 x 576 (1024 x 576)
    I just tested this workflow, and the finished DVD looked fine.

    I gave the usual dimensions for Standard Definition DV Anamorphic as an example. The actual dimensions for DV Anamorphic NTSC and PAL are: 720x480 and 720x576, but when stretched, the right width is 854 and 1024 as mentioned in my first post. The dimentions you are mentioning are for High Definition 1080i/p
    If you are editing 720p, the dimentions are: 1280 × 720.
    This might be of help:
    http://en.wikipedia.org/wiki/Image:CommonVideoResolutions.svg

  • Simple solution to iChat AV 10.4.3 Problem

    I know I will receive lots of criticism from certain quarters but there is a very simple solution to the countless problems that thousands of iChat users are getting - go back to 10.4.2.
    Clearly there is a major problem with 10.4.3 and iChat AV, and I have been searching this forum for the last 2 weeks to try and solve it. I have read so many posts that talk about opening ports and various reconfigurations of the router and in the majority of cases these have not been successful and are far too complicated for the vast majority of Mac users.
    This is clearly a major problem, there are over 800 views of one thread alone. This must just be the tip of the iceberg, there must be tens of thousands of users who no longer can get iChat working. Apple really need to take note of this and do something about it. Mac users expect stuff to work out of the box - iChat used to - now it often doesn't.
    Reading all the posts the problem is very complicated. In my own case I can use iChat AV with some of my friends and not with others. All of us are on 10.4.3. After days of frustration I re-installed 10.4 out of the box and upgraded it to 10.4.2. It all now works fine, just as it did before the dreaded upgrade.
    The solution is simple - just re-install 10.4.2 and come back here and tell me it now works.
    PowerMac G4   Mac OS X (10.4.2)  

    Hello David,
    I cannot agree with you I am afraid. iChat works fine for me on 10.4.3. I am sure it works fine for many others too. There are some set up issues, they seem to get resolved pretty quickly in here.
    Not a criticism as such David - But suggesting that the best fix is a retro grade one is perhaps not the best resolution to a problem.
    I am not saying I can fix your problem - there are many here better than me at sorting out problems ( I won't name names but they know who they are! ) :-)))
    Why not post back with some more information about the problem. The set up there. Any error messages you get.... I'll bet you a Pound of Apples and a large Pineapple that some one can get you chatting happily on 10.4.3.
    Now theres a challenge!!!
    Best regards
    Ian

  • HT3775 For some reason my QuickTime player has stopped playing all my .avi movies, I can't seem to upgrade and it doesn't offer any solutions except that it may need additional software but not what or where to obtain it from? Help most of my movie are in

    For some reason my QuickTime player has stopped playing all my .avi movies, I can't seem to upgrade and it doesn't offer any solutions except that it may need additional software but not what or where to obtain it from? Help most of my movie are in .avi!!

    Google 'Perian' and 'Flip4Mac' — these are the extensions that will make QT play other file formats.
    However, a simpler solution is just to abandon QT in favour of the free, open-source player VLC, which plays just about everything natively without further downloads.
    Download the free VLC Player from here:
    http://www.videolan.org
    Plays just about everything, including avi & mpg, without add ons.

  • Very Simple Problem-- Need help in method selection process

    Hello,
    It's difficult to explain the background of the program I am making-- but I am stuck at a very simple problem, that I can only solve with a very long block of if statements:
    I have 3 possible numbers-- 1, 2, or 3.
    Imagine two numbers are already taken-- say 1 and 2. I want a variable to set itself to the number that's not taken (3).
    So, again: If two numbers were taken say 2 or 3-- I want the variable to be sent to the other one that isn't taken-- 1.
    Thank you for your help,
    Evan.

    Actually, I'll just tell you the context of the program-- here is what I have so far:
    This program is meant to simulate Monty Hall Problem:
    http://en.wikipedia.org/wiki/Monty_Hall_problem
    The program sets up an array of three possible values. Each one of those values represents a door with either a goat or a car behind it. It then randomly sets one of those values to 1 (in order to represent a car as per the Monty Hall problem), and 0's represent goats.
    The user, which is simulated by the program (does not involve actual interaction), chooses a door initially.
    The game show hosts then reveals a door that is not the users initial choice, but IS a goat ( an array value of 0).
    For example if the array was [0][0][1]
    The user could pick door one (array position 0). Which is a goat.
    The game show host then reveals a goat that is not the users choice-- which would be array position 1.
    After the game show host reveals the goat-- I want the user to always switch his decision to the only other remaining door that was not his first choice.
    Then I wanted the computer to test to see if his final choice is the one with a car. And to tally up the amount of times he got it right.
    --Sorry that was long winded:
    import TerminalIO.*;//imports TerminalIO package for system.out.println
    import java.util.*;//import java.util for random
    public class Monty_Problem
         int doors[]= {0,0,0};
         Random rand= new Random();
         double wins,totals=0;
         public void carAssignment()
              int car_door= rand.nextInt(3);
              doors[car_door]=1;
         public int judgesChoice(int judgeDoor, int initialChoice)
              if(judgeDoor != initialChoice && doors[judgeDoor]!=1)
                   return judgeDoor;
              else
                   return judgesChoice(rand.nextInt(3), initialChoice); //infinite loop right here that I cannot remedy.  I want the program to have the judge pick a location that is not occupied by a  '1' and is not the user's choice. 
         public void gamePlaySwitches()
              int initialChoice= rand.nextInt(3);
              int judgeDoor = 0;
              int secondChoice= 0;
              judgeDoor= judgesChoice(rand.nextInt(3), initialChoice);
              //This part is meant to have the user switch choices from his initial choice
                   // to the only other choice that hasn't been revealed by the judge. 
              while(secondChoice == initialChoice || secondChoice== judgeDoor)
                   secondChoice++;
              if(doors[secondChoice]==1)
                   wins++;
                   totals++;
              else
                   totals++;          
         public static void main(String [] args)//creates the main menu
              Monty_Problem a= new Monty_Problem();
              int games=0;
              while(games!=100)
                        a.carAssignment();
                        a.gamePlaySwitches();
                        games++;
              System.out.println(a.wins/a.totals);
    }Edited by: EvanD on Jan 11, 2008 4:17 PM

  • Need help with a very simple example.  Trying to reference a value

    Im very new to Sql Load and have created this very simple example of what I need to do.
    I just want to reference the ID column from one table to be inserted into another table as DEV_ID.
    Below are my: 1) Control File, 2) Datafile, 3) Table Description, 4) Table Description
    1) CONTROL FILE:
    LOAD DATA
    INFILE 'test.dat'
    APPEND
    INTO TABLE p_ports
    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
    DEV_id REF(CONSTANT 'P_DEVICES',NAME),
    NAME FILLER ,
    PORT_NO
    2) DATAFILE:
    COMM881-0326ES09,6
    3) TABLE DESCRIPTION:
    SQL> describe p_ports
    Name Null? Type
    ID NOT NULL NUMBER(10)
    DEV_ID NOT NULL NUMBER(10)
    PORT_NO     NUMBER(3)

    hi,
    i managed to do this for my app. (think i referred to viewTransitions sample code and modified quite a bit)
    i can't remember this well cos i did this quite a while back, but i will try to help as much as possible
    1) from the appdelegate i initialize a root controller (view controller class)
    2) this root controller actually contains two other view controllers, let's call it viewAController and viewBController, for the screens which u are going to toggle in between. and there's also a function, let's call it toggleMenu, which will set the menus to and fro. i copied this whole chunk from the sample code. it actually defines the code on what to do, i.e. if current view is A switch to B and vice versa.
    3) inside the controller files, you need to implement the toggleMenu function too, which basically calls the rootController's toggleMenu
    4) we also need viewA and viewB files(view class)
    5) need to add the .xib files for the respective views and link them up to the controller class. i did not use the .xib files for ui layout though, because of my app's needs. however, it will not work properly without the .xib files.
    5) inside the view class of both views, i.e. viewA.m and viewB.m, you need to create a button, that will call the toggleMenu function inside the respective controller class.
    it will look something like this:
    [Button addTarget:ViewAController action:@selector(toggleMenu:) forControlEvents:UIControlEventTouchUpInside];
    so the flow is really button (in view)-> toggleMenu(viewController) -> toggleMenu(rootController)
    i'm sorry it sounds pretty hazy, i did this part weeks before and can't really remember. i hope it helps.

  • My iphone is at tech service and since it is in guarantee period most probably they will give a new one.Thats why I want to deactivate or sign out my apple ID from that Iphone. Please help me, what shoud I do?

    My iphone is at tech service and since it is in guarantee period most probably they will give a new one.Thats why I want to deactivate or sign out my apple ID from that Iphone. Please help me, what shoud I do?

    Wow... you seriously over paid for an iPhone.
    That probably explains why you have/had no clue you were purchasing a locked device and think it's an Apple problem to get it unlocked.

  • HT1386 hi - i have recently upgraded to an iphone and find that when i open my MS Outlook on my computer, the emails that were on the iphone get wiped out. Has anyone got a solution to this problem? I'm sure it's very simple when you know the answer! Than

    hi - i have recently upgraded to an iphone and find that when i open my MS Outlook on my computer, the emails that were on the iphone get wiped out. Has anyone got a solution to this problem? I'm sure it's very simple when you know the answer! Thanks.

    Pay no attention to iinami, the amount of replies to people saying their handsets must have been jailbroken everytime iTunes throws out an error is tremendous. (Clearly you don't need to have any real knowledge to get to level 3 on these forums, let's hope apple's geniuses know a lot more than some of their customers.)
    http://support.apple.com/kb/TS3694
    Solution below.
    Error 9
    This error occurs when the device unexpectedly loses its USB connection with iTunes. This can occur if the device is manually disconnected during the restore process. This issue can be resolved by performing USB troubleshooting, using a different USB dock-connector cable, trying another USB port, restoring on another computer, or by eliminating conflicts from third-party security software.

Maybe you are looking for