Why does this code crash the flash 10.2 plugin?

A very simple piece of code that causes the flash 10.2 plugin container to crash on all platforms, but does not crash on 10.1 player.
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="300" minHeight="200">
     <fx:Script>
          <![CDATA[
               import mx.controls.Alert;
               private function crash(type:int, ...additionalArgs):void {
                    var msg:String;
                    switch (type) {
                         case 1: msg = "Crashes!"; break;
                         case 2: msg = additionalArgs[0]; break;
                    Alert.show("Crash : " + msg);
               private function notCrash(type:int, ...additionalArgs):void {
                    // Does nothing at all, but stops the crash....
                    if (additionalArgs) {}
                    var msg:String;
                    switch (type) {
                         case 1:msg = "Not crash"; break;
                         case 2: msg = additionalArgs[0]; break;
                    Alert.show("NotCrash : " + msg);
          ]]>
     </fx:Script>
     <s:Button label="Does not crash flash" click="notCrash(2,'value')" x="10" y="10"/><s:Button label="Crash flash" click="crash(2,'value')" x="150" y="10"/>
</s:Application>

Crash long on Safari :
Process:         WebKitPluginHost [43418]
Path:            /System/Library/Frameworks/WebKit.framework/WebKitPluginHost.app/Contents/MacOS/WebKitPluginHost
Identifier:      com.apple.WebKit.PluginHost
Version:         6533 (6533.13)
Build Info:      WebKitPluginHost-75331300~12
Code Type:       X86 (Native)
Parent Process:  WebKitPluginAgent [43105]
PlugIn Path:       /Library/Internet Plug-Ins/Flash Player.plugin/Contents/PlugIns/FlashPlayer-10.6.plugin/Contents/MacOS/FlashPlayer-10.6
PlugIn Identifier: com.macromedia.FlashPlayer-10.6.plugin
PlugIn Version:    10.2.152.26 (10.2.152.26)
Date/Time:       2011-02-22 21:56:12.733 +0200
OS Version:      Mac OS X 10.6.6 (10J567)
Report Version:  6
Exception Type:  EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x0000000000000010
Crashed Thread:  0  Dispatch queue: com.apple.main-thread
Thread 0 Crashed:  Dispatch queue: com.apple.main-thread
0   ...dia.FlashPlayer-10.6.plugin     0x140043ee main + 1461822
1   ???                                0x1d9db79f 0 + 496875423
2   ???                                0x1d9db8b3 0 + 496875699
3   ???                                0x1d9db937 0 + 496875831
4   ...dia.FlashPlayer-10.6.plugin     0x140068c6 main + 1471254
5   ...dia.FlashPlayer-10.6.plugin     0x140087d7 main + 1479207
6   ...dia.FlashPlayer-10.6.plugin     0x13a9f658 0x139ca000 + 874072
7   ...dia.FlashPlayer-10.6.plugin     0x13a989e1 0x139ca000 + 846305
8   ...dia.FlashPlayer-10.6.plugin     0x13aa48de 0x139ca000 + 895198
9   ...dia.FlashPlayer-10.6.plugin     0x13ba6572 0x139ca000 + 1951090
10  ???                                0x194083b5 0 + 423658421
11  ???                                0x1c7fee20 0 + 478146080
12  ???                                0x1dbe2844 0 + 499001412
13  ???                                0x1db3d61c 0 + 498325020
14  ???                                0x1db3dcfc 0 + 498326780
15  ???                                0x1db37b5c 0 + 498301788
16  ...dia.FlashPlayer-10.6.plugin     0x13a9f658 0x139ca000 + 874072
17  ...dia.FlashPlayer-10.6.plugin     0x13aa06b6 0x139ca000 + 878262
18  ...dia.FlashPlayer-10.6.plugin     0x13bb42be 0x139ca000 + 2007742
19  ...dia.FlashPlayer-10.6.plugin     0x13d407c8 0x139ca000 + 3631048
20  ...dia.FlashPlayer-10.6.plugin     0x13d40eab 0x139ca000 + 3632811
21  ...dia.FlashPlayer-10.6.plugin     0x13ea39c7 main + 17431
22  com.apple.CoreFoundation           0x950184cb __CFRunLoopDoSources0 + 1563
23  com.apple.CoreFoundation           0x95015f8f __CFRunLoopRun + 1071
24  com.apple.CoreFoundation           0x95015464 CFRunLoopRunSpecific + 452
25  com.apple.CoreFoundation           0x95015291 CFRunLoopRunInMode + 97
26  com.apple.HIToolbox                0x901a8004 RunCurrentEventLoopInMode + 392
27  com.apple.HIToolbox                0x901a7dbb ReceiveNextEventCommon + 354
28  com.apple.HIToolbox                0x901a7c40 BlockUntilNextEventMatchingListInMode + 81
29  com.apple.AppKit                   0x9130978d _DPSNextEvent + 847
30  com.apple.AppKit                   0x91308fce -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 156
31  com.apple.AppKit                   0x912cb247 -[NSApplication run] + 821
32  com.apple.WebKit.PluginHost        0x1842240f 0x18421000 + 5135
33  com.apple.WebKit.PluginHost        0x1842204d 0x18421000 + 4173

Similar Messages

  • Why does firefox 7 crashes the system if Quadro NVS 135M graphics driver is installed?

    Why does firefox 7 crashes the system with a Quadro NVS 135M graphics cards installed?
    It happens immediately after opening Firefox on a two screen system. You get a message saying the Graphics Driver stopped responding, but that it managed to recover, but after a while the system freezes completely. You can't even CTRL+ALT+DEL.

    I get this too on with my nVidia GTX460 card. In my case the screen goes black. It happens once every few days, and for a while I could not figure out why. I was forcing a shutdown to get the screen back.
    But I put the computer to sleep and woke it up, since that restarts the video, and this let me see what was wrong. The only error message is it reports that Firefox hung. There is nothing else in the Event logs.
    I'm running Windows 7 with all the updates from Windows Update, and my video driver is 285.62, but his also happened with the 260.26 driver.
    I imagine this is happening a lot, but people aren't able to isolate the cause.
    I'm looking for a fix, not a bypass.

  • After I Repair The Permissions On My Mac Pro, Then I Verify The Permissions And They Have To Be Repaired Again And Again.  Why Does This Happen All The Time.   Please Reply,  James

    Hi, 
    After I Repair The Permissions On My Mac Pro, Then I Verify The Permissions And They Have To Be Repaired Again And Again. 
    Why Does This Happen All The Time. 
    Please Reply, 
    James

    As long as the report ends up with 'Permissions repair complete' then, as far as permissions go, you are fine. You can ignore the various statements in the report:
    Permissions you can ignore on 10.5 onwards:
    http://support.apple.com/kb/TS1448
    Using 'should be -rw-r--r-- , they are lrw-r--r--' as an example, you will see the that the permissions are not changed, but the | indicates a different location. This is because an update to Leopard onwards changed the location of a number of system components.
    Poster rccharles has provided this description of what it all means:
    drwxrwxrwx
    d = directory
    r = read
    w = write
    x = executeable program
    drwxrwxrwx
    |  |  |
    |  |   all other users not in first two types
    |  | 
    |  group

    owner

  • Why does this code always gotoAndStop at the same frame?

    The symbol "alldoor" contains the following six frames in sequential order: "door1","red_door1","door2","red_door2","door3" and "red_door3".
    var doors:Array =["door1", "door2", "door3"];
    var doorSelector:String = doors[newDoors(0, doors.length - 1)]
    function newDoors (min:Number, max:Number):Number
    var  doorColors:Number = Math.round(Math.random() * (min - max) + max);
    return doorColors;
    alldoor.gotoAndStop(doorSelector);
    alldoor.addEventListener(MouseEvent.CLICK,changeColors );
    function changeColors(e:MouseEvent)
        if (e.currentTarget.currentLabel == doorSelector)
            e.currentTarget.gotoAndStop(currentFrame + 1);
         I am attempting to get this code select one of the frames starting with the string "door" at start up. Then, the door should move to the frame
    directly following it on the timeline when clicked. However, as the code is written, the frame always jumps to the second frame in the symbol,regardless of what the current label is. What should I change?

    either:
    1.  those frames aren't loaded when that code executes or
    2.  you don't have those labels on the timeline that contains that code or
    3.  there is other code executing after your goto changing your frame
    use the trace() function to debug and find which is your problem.

  • Why does this reloadData crash my program?

    Can anyone help me figure out why [tableView reloadData] is crashing my program? I have a grouped tableView where I want to allow the user to reorder rows. Each of the rows is dynamically numbered in cellForRowAtIndexPath, so when the cell draws the rows are consecutively numbered. Whenever the user makes a change to the list order such as from:
    1. Name A
    2. Name B
    3. Name C
    to: (switch 1 & 3)
    3. Name C
    2. Name B
    1. Name A
    I want it to say
    1. Name C
    2. Name B
    3. Name A
    Here is the code, but I get * Terminating app due to uncaught exception 'NSRangeException', reason: '* -[NSCFArray objectAtIndex:]: index (1) beyond bounds (1)'
    Here is the Code:
    - (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath {
    if (fromIndexPath.section == 0) {
    NSDictionary *currentName =[[[bNameChoices objectAtIndex:fromIndexPath.row] retain] autorelease];
    [bNameChoices removeObjectAtIndex:fromIndexPath.row];
    [bNameChoices insertObject:currentName atIndex:toIndexPath.row];
    } else if (fromIndexPath.section == 1) {
    NSDictionary *currentName =[[[gNameChoices objectAtIndex:fromIndexPath.row] retain] autorelease];
    [gNameChoices removeObjectAtIndex:fromIndexPath.row];
    [gNameChoices insertObject:currentName atIndex:toIndexPath.row];
    [tableView reloadData];
    Any help on this would be appreciated!

    gpmoore wrote:
    I found a work around which I am a bit embarrassed by but it works (I hate cheating like this but I didn't want to waste time):
    Doing it correctly is not a waste of time. I suspect that you have other things going on that are causing your crash. How far do you want to go with this program? If you want to support drag-n-drop and other fancy things then you'll have to get this resolved.
    There has been some side discussion here that you may or may not have seen. I don't know what is going on with your autorelease. For all I know you are giving your object to some random autorelease pool from the context of whomever is calling this delegate function.
    Full support of drag and drop can be complicated. Essentially, what I do is this:
    1) Remove all selected row objects (which may be a discontiguous set) and move them to a new array.
    2) Find the insertion point. You will need to do some calculations to find where it will be.
    3) Move all the objects from the temp array into the new location.
    Here is an example straight from my code:
    // Move rows to a new row.
    - (void) moveRows: (NSIndexSet *) rows toRow: (unsigned int) row
    // Get an array of the rows I'll be moving.
    NSArray * movedRows = [myData objectsAtIndexes: rows];
    // Remove the rows from the list.
    [myData removeObjectsAtIndexes: rows];
    unsigned int offset = 0;
    // Now that I've removed the rows. I need to calculate the new
    // insert location, taking into account rows that I just removed.
    for(unsigned int i = [rows firstIndex]; i != NSNotFound;
    i = [rows indexGreaterThanIndex: i])
    if(i < row)
    ++offset;
    // Build a new set of rows, taking the offset into account.
    NSIndexSet * newRows =
    [NSIndexSet indexSetWithIndexesInRange:
    NSMakeRange(row - offset, [rows count])];
    // Now put the rows where they need to be.
    [myData insertObjects: movedRows atIndexes: newRows];
    // Redisplay the table.
    [myTableView reloadData];
    // Select the new rows.
    [myTableView selectRowIndexes: newRows byExtendingSelection: NO];
    if(myUndoManager)
    // Allow this operation to be undone.
    [[myUndoManager prepareWithInvocationTarget: self]
    moveRowsAtRow: row - offset toRows: rows];
    // Update the change counter.
    if(myDocument)
    [myDocument updateChangeCount:
    ([myUndoManager isUndoing] ? NSChangeUndone : NSChangeDone)];

  • Why does osx yosemite crash the wifi router?

    Upgraded to Yosemite, with MBP retina and my wifi router a Netgear CG 3100 D 28 PAUS crashes every time I connect up. I have turned off wifi and then forgot the connection and then reconnected with no joy. It continued to crash the router forcing it to reboot. I reinstalled back to mavericks and there was no problem and the wifi and router were stable and worked well. Does anyone else have this problem? Any suggestions?

    Hi,
    I have the same problem than you. After updating to Yosemite yesterday, my internet connection through a Netgear CG 3100 cable modem stopped, but only with the updated computer, the rest of my devices seems to connect well. After going back to Mavericks, everything work well again.
    Is there might be an incompatibility between Yosemite and this cable modem?
    iMac CoreDuo, 12 GB RAM, OS X Mavericks (again)

  • Why does this code not work?

    String answer = new String("");
    in = new BufferedReader(new InputStreamReader( connection.getInputStream ()));
    String test = new String("");
    for (int i = 0 ; i < 1000 ; i++)
    answer = in.readLine();
    if (answer == null)
    System.out.println ("null");
    break;
    else
    test += answer;
    System.out.println ("answer: " + answer);
    System.out.println ("test: " + test);
    Many times, the loop will go through 2 iterations but each time, test is only equal to the first answer. The second, third, fourth etc.time it goes through the loop, it should concatenate the value of answer to the end of the string variable test. So why is it that whenever i run the program that has this code, the loop might lloop many times (let's say 2 time) but the value of test is only the first answer, and not the first answer concatenated with the second answer.

    It worked for me...my code looks like this...i used FileInputStream instead of connection..
    import java.io.*;
    class Forum {
      public static void main(String a[]) throws IOException{
        String answer = new String("");
        BufferedReader in = new BufferedReader(new InputStreamReader( new FileInputStream("hi.txt")));
        String test = new String("");
        for (int i = 0 ; i < 1000 ; i++)
        answer = in.readLine();
        if (answer == null)
        System.out.println ("null");
        break;
        else
        test += answer;
        System.out.println ("answer: " + answer);
        System.out.println ("test: " + test);
    my hi.txt is like this:
    fasd rea reks krie
    fsdfasd
    asdfasd
    sfasdf
    asdfasd
    The output is
    answer: fasd rea reks krie
    answer: fsdfasd
    answer: asdfasd
    answer: sfasdf
    answer: asdfasd
    null
    test: fasd rea reks kriefsdfasdasdfasdsfasdfasdfasd
    Is this not the way u want???

  • Simple Question: Why does this code not exit properly?

    This code is pretty simple. All I want to do is load and play a sound file in an application, but this code to load the sound file does not exit properly. I know that some resources must be allocated which I need to deallocate in order to shut down the process, but I don't know what to call to do a proper shut-down. Any help would be appreciated.
    -adam
    import java.applet.Applet;
    import java.applet.AudioClip;
    import java.net.MalformedURLException;
    import java.net.URL;
    public class PlaySoundTest extends java.applet.Applet
    public static void main( java.lang.String[ ] aryArgs )
    java.net.URL urlSound = null;
    try
    urlSound = new java.net.URL( "file:/" + aryArgs[ 0 ] );
    catch( java.net.MalformedURLException murle )
    murle.printStackTrace( );
    System.exit( 1 );
    java.applet.AudioClip acSound = java.applet.Applet.newAudioClip( urlSound );

    HI , If u'r still looking for the solution, this code is working on my system -
    import java.applet.Applet;
    import java.applet.AudioClip;
    import java.net.MalformedURLException;
    import java.net.URL;
    public class PlaySoundTest extends java.applet.Applet
    public static void main( java.lang.String[ ] aryArgs ){
    java.net.URL urlSound = null;
    try{  //rahul
    try
    urlSound = new java.net.URL( "file:" + aryArgs[ 0 ] );
    catch( java.net.MalformedURLException murle )
    murle.printStackTrace( );
    System.exit( 1 );
    urlSound = new java.net.URL( "file:" + aryArgs[ 0 ] );
    java.applet.AudioClip acSound = java.applet.Applet.newAudioClip( urlSound );
    if(acSound != null){
    acSound.play();
    catch( Exception murle )
    {        //rahul
    murle.printStackTrace( );
    System.exit( 1 );
    }//main
    The only change I made was in the URL part - file: instead of file:/ .
    The other was of course to play the soundclip ...... :- ) I got really confused the first time I played it .

  • Why does this code fail in command line?

    I am using the "ListDemo" from the java swing tutorial. If I compile it on the command line
    javac ListDemo.java
    It compiles fine. Then when I run it, it says:
    C:\Development\Java\Projects\Projects>java ListDemo
    Exception occurred during event dispatching:
    java.lang.NoSuchMethodError
    at ListDemo.createAndShowGUI(ListDemo.java:196)
    at ListDemo.access$400(ListDemo.java:7)
    at ListDemo$1.run(ListDemo.java:217)
    at java.awt.event.InvocationEvent.dispatch(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)
    Yet when I load up the same file into Netbeans, it compiles and runs fine! Here is the file:
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    /* ListDemo.java is a 1.4 application that requires no other files. */
    public class ListDemo extends JPanel
                          implements ListSelectionListener {
        private JList list;
        private DefaultListModel listModel;
        private static final String hireString = "Hire";
        private static final String fireString = "Fire";
        private JButton fireButton;
        private JTextField employeeName;
        public ListDemo() {
            super(new BorderLayout());
            listModel = new DefaultListModel();
            listModel.addElement("Alan Sommerer");
            listModel.addElement("Alison Huml");
            listModel.addElement("Kathy Walrath");
            listModel.addElement("Lisa Friendly");
            listModel.addElement("Mary Campione");
            listModel.addElement("Sharon Zakhour");
            //Create the list and put it in a scroll pane.
            list = new JList(listModel);
            list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
            list.setSelectedIndex(0);
            list.addListSelectionListener(this);
            list.setVisibleRowCount(5);
            JScrollPane listScrollPane = new JScrollPane(list);
            JButton hireButton = new JButton(hireString);
            HireListener hireListener = new HireListener(hireButton);
            hireButton.setActionCommand(hireString);
            hireButton.addActionListener(hireListener);
            hireButton.setEnabled(false);
            fireButton = new JButton(fireString);
            fireButton.setActionCommand(fireString);
            fireButton.addActionListener(new FireListener());
            employeeName = new JTextField(10);
            employeeName.addActionListener(hireListener);
            employeeName.getDocument().addDocumentListener(hireListener);
            String name = listModel.getElementAt(
                                  list.getSelectedIndex()).toString();
            //Create a panel that uses BoxLayout.
            JPanel buttonPane = new JPanel();
            buttonPane.setLayout(new BoxLayout(buttonPane,
                                               BoxLayout.LINE_AXIS));
            buttonPane.add(fireButton);
            buttonPane.add(Box.createHorizontalStrut(5));
            buttonPane.add(new JSeparator(SwingConstants.VERTICAL));
            buttonPane.add(Box.createHorizontalStrut(5));
            buttonPane.add(employeeName);
            buttonPane.add(hireButton);
            buttonPane.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
            add(listScrollPane, BorderLayout.CENTER);
            add(buttonPane, BorderLayout.PAGE_END);
        class FireListener implements ActionListener {
            public void actionPerformed(ActionEvent e) {
                //This method can be called only if
                //there's a valid selection
                //so go ahead and remove whatever's selected.
                int index = list.getSelectedIndex();
                listModel.remove(index);
                int size = listModel.getSize();
                if (size == 0) { //Nobody's left, disable firing.
                    fireButton.setEnabled(false);
                } else { //Select an index.
                    if (index == listModel.getSize()) {
                        //removed item in last position
                        index--;
                    list.setSelectedIndex(index);
                    list.ensureIndexIsVisible(index);
        //This listener is shared by the text field and the hire button.
        class HireListener implements ActionListener, DocumentListener {
            private boolean alreadyEnabled = false;
            private JButton button;
            public HireListener(JButton button) {
                this.button = button;
            //Required by ActionListener.
            public void actionPerformed(ActionEvent e) {
                String name = employeeName.getText();
                //User didn't type in a unique name...
                if (name.equals("") || alreadyInList(name)) {
                    Toolkit.getDefaultToolkit().beep();
                    employeeName.requestFocusInWindow();
                    employeeName.selectAll();
                    return;
                int index = list.getSelectedIndex(); //get selected index
                if (index == -1) { //no selection, so insert at beginning
                    index = 0;
                } else {           //add after the selected item
                    index++;
                listModel.insertElementAt(employeeName.getText(), index);
                //If we just wanted to add to the end, we'd do this:
                //listModel.addElement(employeeName.getText());
                //Reset the text field.
                employeeName.requestFocusInWindow();
                employeeName.setText("");
                //Select the new item and make it visible.
                list.setSelectedIndex(index);
                list.ensureIndexIsVisible(index);
            //This method tests for string equality. You could certainly
            //get more sophisticated about the algorithm.  For example,
            //you might want to ignore white space and capitalization.
            protected boolean alreadyInList(String name) {
                return listModel.contains(name);
            //Required by DocumentListener.
            public void insertUpdate(DocumentEvent e) {
                enableButton();
            //Required by DocumentListener.
            public void removeUpdate(DocumentEvent e) {
                handleEmptyTextField(e);
            //Required by DocumentListener.
            public void changedUpdate(DocumentEvent e) {
                if (!handleEmptyTextField(e)) {
                    enableButton();
            private void enableButton() {
                if (!alreadyEnabled) {
                    button.setEnabled(true);
            private boolean handleEmptyTextField(DocumentEvent e) {
                if (e.getDocument().getLength() <= 0) {
                    button.setEnabled(false);
                    alreadyEnabled = false;
                    return true;
                return false;
        //This method is required by ListSelectionListener.
        public void valueChanged(ListSelectionEvent e) {
            if (e.getValueIsAdjusting() == false) {
                if (list.getSelectedIndex() == -1) {
                //No selection, disable fire button.
                    fireButton.setEnabled(false);
                } else {
                //Selection, enable the fire button.
                    fireButton.setEnabled(true);
         * Create the GUI and show it.  For thread safety,
         * this method should be invoked from the
         * event-dispatching thread.
        private static void createAndShowGUI() {
            //Make sure we have nice window decorations.
            JFrame.setDefaultLookAndFeelDecorated(true);
            //Create and set up the window.
            JFrame frame = new JFrame("ListDemo");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            //Create and set up the content pane.
            JComponent newContentPane = new ListDemo();
            newContentPane.setOpaque(true); //content panes must be opaque
            frame.setContentPane(newContentPane);
            //Display the window.
            frame.pack();
            frame.setVisible(true);
        public static void main(String[] args) {
            //Schedule a job for the event-dispatching thread:
            //creating and showing this application's GUI.
            javax.swing.SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    createAndShowGUI();

    You are not running this code under JDK 1.4
    The setDefaultLookAndFeelDecorated method requires JDK 1.4 version.

  • Why does this message appear: The item you've requested is not currently available in the U.S. store. When I open iTunes?

    For no discernible reason when I opened iTunes and selected the iTunes Store, this message appeared:
    The item you've requested is not currently available in the U.S. store.
    rebooted computer. Flushed iTunes cache. I see lots of references to this in older posts (2012 and earlier) but nothing recent.

    There are several posts about this in the last 15 minutes
    Look around. 
    Be patient, itunes will correct their issue.

  • Repaint() an applet from a swing applet, why does this code not work?

    below are three files that work as planned except for the call to repaint(). This is envoked when a button is hit in one applet and it should repaint another applet. I opened them up in a html file that simply runs both applets. If you could see why the repaint doesn't work I'd love to know. good luck.
    //speech1
    import java.awt.*;
    import java.applet.Applet;
    import java.awt.event.*;
    //java extension packages
    import javax.swing.*;
    public class speechapp1 extends JApplet implements ActionListener{
    // setting up Buttons and Drop down menus
    char a[];
    Choice choicebutton;
    JLabel resultLabel;
    JTextField result;
    JLabel enterLabel;
    JTextField enter;
    JButton pushButton;
    TreeTest PicW;
    // setting up applets G.U.I
    public void init(){
    // Get content pane and set it's layout to FlowLayout
    Container container = getContentPane();
    container.setLayout( new FlowLayout() );
    // initialise buttons and shit
    a = new char[30];
    choicebutton = new Choice();
    enterLabel = new JLabel("Test");
    enter = new JTextField(30);
    resultLabel= new JLabel("speech label");
    result = new JTextField(30);
    result.setEditable(false);
    // Add items to Choice Button
    choicebutton.addItem("abc");
    choicebutton.addItem("def");
    choicebutton.addItem("ghi");
    choicebutton.addItem("jkl");
    pushButton = new JButton("Click to continue");
    // Add new Tree from file TreeTest.java
    PicW = new TreeTest();
    // Add buttons to container.
    container.add(resultLabel);
    container.add(result);
    container.add(enterLabel);
    System.out.println("");
    container.add(choicebutton);
    System.out.println("");
    container.add(pushButton);
    pushButton.addActionListener(this);
    //choicebutton.addActionListener( this );
    // Set the text in result;
    result.setText("Hello");
    //public void paint(Graphics gg){
    // result.setText("Hello");
    public void actionPerformed(ActionEvent event){
    // continue when action performed on pushButton
    String searchKey = event.getActionCommand();
    System.out.println("");
    if (choicebutton.getSelectedItem().equals("abc"))
    PicW.getPicWeight(1);
    if (choicebutton.getSelectedItem().equals("def"))
    PicW.getPicWeight(2);
    if (choicebutton.getSelectedItem().equals("ghi"))
    PicW.getPicWeight(3);
    if (choicebutton.getSelectedItem().equals("jkl"))
    PicW.getPicWeight(4);
    System.out.println("repainting from actionPerformed method()");
    PicW.repaint();
    import java.applet.Applet;
    import java.awt.*;
    import java.util.*;
    public class TreeTest extends Applet{
    Tree BackgroundImageTree;
    Tree PlayerImageTree;
    Image snow,baby;
    int weight;
    public void getPicWeight(int w){
    weight = w;
    System.out.println("the new weight has been set at: "+weight);
    this.repaint();
    public void init()
    // initialising trees for backgound images and player images
    BackgroundImageTree = new Tree();
    PlayerImageTree = new Tree();
    // initialising images and correcting size of images to correctly fit the screen
    snow = getImage(getDocumentBase(),"snow.gif");
    baby = getImage(getDocumentBase(),"baby.gif");
    // inserting images into correct tree structure
    System.out.println("inserting images into tree: ");
    // inserting background images into tree structure
    BackgroundImageTree.insertImage(1,snow);
    // inserting players into tree structure
    PlayerImageTree.insertImage(1,baby);
    public void paint(Graphics g){
    System.out.println("Searching for selected Image");
    if((BackgroundImageTree.inorderTraversal(1)==null)&&(PlayerImageTree.inorderTraversal(1)==null)){
    System.out.println("There is no tree with the selected value in the trees");
    }else{
    g.drawImage(BackgroundImageTree.inorderTraversal(1),1,3,this);
    //g.drawImage(PlayerImageTree.inorderTraversal(1),55,150,this);
    import java.awt.*;
    import java.applet.Applet;
    class TreeNode {
    TreeNode left;
    Image data;
    TreeNode right;
    int value;
    public TreeNode(int weight,Image picture){
    left = right = null;
    value = weight;
    data = picture;
    public void insert(int v, Image newImage){
    if ( v< value){
    if (left ==null)
    left = new TreeNode(v,newImage);
    else
    left.insert(v,newImage);
    else if (v>value){
    if (right ==null)
    right = new TreeNode(v,newImage);
    else
    right.insert(v, newImage);
    public class Tree{
    private TreeNode root;
    public Tree() {
    root = null;
    public void insertImage(int value, Image newImage){
    if (root == null)
    root = new TreeNode(value,newImage);
    else
    root.insert(value,newImage);
    // in order search of tree.
    public Image inorderTraversal(int n)
    return(inorderHelper(root,n));
    private Image inorderHelper(TreeNode node, int n){
    Image temp = null;
    if (node == null)
    return null;
    if (node.value == n ){
    return(node.data);
    temp = inorderHelper(node.left,n);
    if (temp == null){
    temp = inorderHelper(node.right,n);
    return temp;
    }

    I can fix your problems
    1. You get an error here because you can only invoke the superclass's constructor in the subclass's constructor. It looks like that's what you're trying to do, but you're not doing it right. Constructors don't return any value (actually they do, but it's implied, so you don't need the void that you've got in your code)
    2. I'm not sure, but I think your call to show might be wrong. Move the setsize and setvisible calls to outside of the constructor

  • Why does this keep stopping the iCloud Mail

    Why do I keep getting this message?
    A script on this page may be busy, or it may have stopped responding.
    You can stop the script now, or you can continue to see if the script will complete.
    Script: https://www.icloud.com/applications/mail/1T.111546/en-us/javascript-packed.js:19 8

    Hey There Ingridkoala,
    Did you have an earlier version of GarageBand and are updating to version 10.0.3?  Or did you already have version 10.0.3 and received an invitation to download additional content?  If it is the latter, you should be able to cancel the download of additional content and finish your current project first.
    Expanding GarageBand for Mac (v10.0) content with an in-app purchase - Apple Support
    http://support.apple.com/en-is/HT202873
    If you need the update before you can proceed with your project, I have a few suggestions that may help get this content to download.
    Connect to the internet via a wired ethernet cable instead of Wi-Fi for a faster connection.
    Turn the computer's sleep setting to never so that the download is not interrupted.  
    Disable or turn of any antivirus software if you have it, as these may stop the progress of the download.
    About Energy Saver sleep and idle modes in Mac OS X - Apple Support
    http://support.apple.com/en-is/HT201714
    Have a good weekend!
    - Judy

  • Why does this happen?--"The following files were not imported because they could not be read." Lightroom will not import ANY files.

    Lightroom cannot read files, yet they can be imported by copying them.

    Jim is correct. This is very likely a permissions problem. If you have checked and are CERTAIN the permissions are correct you should, in this order:
    1.Repair Permissions
    2.Reset your preference file by holding down [Shift][Opt] and Launching Lightroom.

  • Mail - why does this thread crash when accessing a gmail imap account

    Thread 13 Crashed:
    0 libSystem.B.dylib 0x91ed8b9e __kill + 10
    1 libSystem.B.dylib 0x91f4fec2 raise + 26
    2 libSystem.B.dylib 0x91f5f47f abort + 73
    3 com.apple.MessageFramework 0x0047552e sqlite3_traceCallback + 0
    4 com.apple.MessageFramework 0x00368e6d +[Library insertOrUpdateMessages:withMailbox:fetchBodies:isInitialImport:oldMessagesByNew Message:remoteIDs:newDocumentIDs:setFlags:clearFlags:messageFlagsForMessages:cop yFiles:progressDelegate:updateRowIDs:] + 2332
    5 com.apple.MessageFramework 0x00368548 +[Library addMessages:withMailbox:fetchBodies:isInitialImport:oldMessagesByNewMessage:rem oteIDs:setFlags:clearFlags:messageFlagsForMessages:copyFiles:] + 146
    6 com.apple.MessageFramework 0x003684ae +[Library addMessages:withMailbox:fetchBodies:isInitialImport:oldMessagesByNewMessage:] + 127
    7 com.apple.MessageFramework 0x00368428 +[Library addMessages:withMailbox:fetchBodies:oldMessagesByNewMessage:] + 75
    8 com.apple.MessageFramework 0x00367e27 -[LibraryThread _runThread] + 1412
    9 com.apple.CoreFoundation 0x94f5da7d _invoking__ + 29
    10 com.apple.CoreFoundation 0x94f5d468 -[NSInvocation invoke] + 136
    11 com.apple.MessageFramework 0x003d74c8 -[MonitoredInvocation invoke] + 409
    12 com.apple.MessageFramework 0x003d838a +[WorkerThread _execute:] + 144
    13 com.apple.Foundation 0x949a8bad -[NSThread main] + 45
    14 com.apple.Foundation 0x949a8754 _NSThread__main_ + 308
    15 libSystem.B.dylib 0x91e9b6f5 pthreadstart + 321
    16 libSystem.B.dylib 0x91e9b5b2 thread_start + 34

    No idea.  Are you using any mail plugins of any sort?  MailTags or Letter Opener or Attachment Tamer anything else?

  • Sometimes a pin wheel pops up on screen (mac book pro) and I can't do anything. Why does this happen?

    Sometimes a pin wheel pops up on screen and it freezes. Why does this happen?

    "the spinning wait cursor is displayed automatically by the window server when an application cannot handle all of the events it receives. If an application does not respond for about 2 to 4 seconds, the spinning wait cursor appears."
    Read more here: http://www.macworld.com/article/151583/2010/05/spinningbeachballofdeath.html

Maybe you are looking for