I don't understand why my iBook does not start on my macbook?

Whenever I click on iBook or Preview or Dictionary on my macbook, the app won't start.

I Did what you said, but all these massages appeared simultaneously !
​7/9/14 11:43:07.672 PM MTLAgent[212]: Injecting MTL into com.apple.finder...
7/9/14 11:43:07.688 PM iBooks[704]: Unable to load nib file: MainMenu, exiting
7/9/14 11:43:07.692 PM com.apple.launchd.peruser.501[142]: (com.apple.iBooksX.34352[704]) Exited with code: 1
7/9/14 11:43:07.716 PM MTLAgent[212]: Injecting MTL into com.apple.loginwindow...
7/9/14 11:43:07.716 PM MTLAgent[212]: warning: failed to get scripting definition from /System/Library/CoreServices/loginwindow.app; it may not be scriptable.
7/9/14 11:43:07.717 PM MTLAgent[212]: Injecting MTL into com.apple.systemuiserver...
7/9/14 11:43:07.718 PM MTLAgent[212]: warning: failed to get scripting definition from /System/Library/CoreServices/SystemUIServer.app; it may not be scriptable.
7/9/14 11:43:07.719 PM MTLAgent[212]: MT is already loaded into com.apple.iBooksX
7/9/14 11:43:07.721 PM MTLAgent[212]: Injecting MTL into com.apple.finder...
7/9/14 11:43:07.756 PM MTLAgent[212]: Injecting MTL into com.apple.loginwindow...
7/9/14 11:43:07.757 PM MTLAgent[212]: warning: failed to get scripting definition from /System/Library/CoreServices/loginwindow.app; it maynot be scriptable.
7/9/14 11:43:07.757 PM MTLAgent[212]: Injecting MTL into com.apple.systemuiserver...
7/9/14 11:43:07.758 PM MTLAgent[212]: warning: failed to get scripting definition from /System/Library/CoreServices/SystemUIServer.app; it may not be scriptable.
7/9/14 11:43:07.760 PM MTLAgent[212]: Injecting MTL into com.apple.finder...
7/9/14 11:43:07.782 PM MTLAgent[212]: Injecting MTL into com.apple.loginwindow...
7/9/14 11:43:07.783 PM MTLAgent[212]: warning: failed to get scripting definition from /System/Library/CoreServices/loginwindow.app; it may not be scriptable.
7/9/14 11:43:07.783 PM MTLAgent[212]: Injecting MTL into com.apple.systemuiserver...
7/9/14 11:43:07.784 PM MTLAgent[212]: warning: failed to get scripting definition from /System/Library/CoreServices/SystemUIServer.app; it may not be scriptable.
7/9/14 11:43:07.784 PM MTLAgent[212]: Injecting MTL into com.apple.Console...
7/9/14 11:43:07.785 PM MTLAgent[212]: warning: failed to get scripting definition from /Applications/Utilities/Console.app; it may not be scriptable.
7/9/14 11:43:07.975 PM com.apple.launchd.peruser.501[142]: (com.apple.FolderActions.folders) Throttling respawn: Will start in 6 seconds

Similar Messages

  • HT204135 I update my Mac to version 10.9.2 and now my printer does not work anymore. I did all the software updates and I do not understand why my mac does not recognize the printer anymore?

    I update my Mac to version 10.9.2 and now my printer does not work anymore. I did all the software updates and I do not understand why my mac does not recognize the printer anymore?

    Go to the website of the manufacturer of your printer and check to see if they have released an updated driver for your particular model.

  • Why my ibook does not appear in iTunes sync?

    I have made a book in iBooks Author, exported it as an iBook, dropped it inside iTunes. It appears under books but when I connect my iPad the same book does not appear in the Books section of stuff to sync with the iPad. All other books, including PDFs appear and sync but not the book that I made. If I export the same book as a pdf, drop it inside iTunes - it does appear and syncs but not if it is in the native iBooks format. iTunes is 10.5.3, iPad 3G with iOS 4.3.5 and iBooks 2.

    use another USB port ?
    Connect iphone first and then restart your computer ? Does it detect ?

  • MY IBOOK DOES NOT START

    Last night my ibook crashed. i turn it off and on again, but now it does not seem to go past the 1st page, i.e. i do not even see the option to open any programme - any suggestions?

    Last night my ibook crashed. i turn it off and on again, but now it does not seem to go past the 1st page, i.e. i do not even see the option to open any programme - any suggestions?

  • I don't understand why my code is not working please help!

    import(flash.events.MouseEvent);{
    stop();
    button1.addEventListener(MouseEvent.CLICK,showpic1);
    button1.addEventListener(MouseEvent.CLICK,showpic2);
    button1.addEventListener(MouseEvent.CLICK,showpic3);
    button1.addEventListener(MouseEvent.CLICK,showpic4);
    function showpic1(Event:MouseEvent);{
              gotoAndstop("pic1");
    function showpic2(Event:MouseEvent);{
              gotoAndstop("pic2");
    function showpic3(Event:MouseEvent);{
              gotoAndstop("pic3");
    function showpic4(Event:MouseEvent);{
              gotoAndstop("pic4");

    And another thing. Event (with capital E) is a particular datatype in AS3. You should avoid using reserved words. The handlers should look like this:
    function showpic1(event:MouseEvent);
              gotoAndStop("pic1");

  • I don't know why my screensaver does not work...

    I Set up my screensaver through system preferences, but it doesn't go to screensaver mode on my laptop after the time it should begin..

    Reload web page(s) and bypass the cache to refresh possibly outdated or corrupted files.
    *Press and hold Shift and left-click the Reload button.
    *Press "Ctrl + F5" or press "Ctrl + Shift + R" (Windows,Linux)
    *Press "Command + Shift + R" (MAC)
    Clear the cache and the cookies from sites that cause problems.
    "Clear the Cache":
    *Tools > Options > Advanced > Network > Cached Web Content: "Clear Now"
    "Remove Cookies" from sites causing problems:
    *Tools > Options > Privacy > Cookies: "Show Cookies"
    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance).
    *Do not click the Reset button on the Safe mode start window or otherwise make changes.
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes
    You can check for problems caused by recent Flash updates and try these:
    *disable a possible RealPlayer Browser Record Plugin extension for Firefox and update the RealPlayer if installed
    *disable protected mode in Flash 11.3 and later
    *disable hardware acceleration in the Flash plugin
    *http://kb.mozillazine.org/Flash#Troubleshooting

  • Even after software restore, ibook does not start up - shows ?

    My ibook was having problems starting up, most times a "?" blinking while trying to start up. So I started up using the starup disc while holding down the "C" key. I reinstalled the system software choosing to erase the HD and start from scratch.
    When i go to start up the ibook with the freshly installed system, i am still getting the blinking "?". does this mean i have a hardware problem?

    See A flashing question mark appears when you start your Mac.

  • IBook does not start up - beeps and sleep light blinks fast

    Hi,
    My daughter's iBook G3 800 is presenting the above referenced problems. She says she left it on overnight, open, to charge her iPod and now it is not responsive. I've tried restarting, resetting, booting from her OSX disc, all with no avail. Any ideas? Should I take to the nearest Apple store, call Apple, or ??
    Thanks for your help!
    Caio

    According to this Apple Knowledge Base article:
    http://docs.info.apple.com/article.html?artnum=58442
    4 beeps = no good boot images in the boot ROM (and/or bad sys config block)
    Now, we may know what the beeps and flashes mean, but I'm not savvy enough to know what to do about it. Let me call in the cavalry, okay?

  • Why My Compter does not start?

    It switch es on web i presse thé button. Thé screen is grey. The black apple appears in thé middle of thé screen. The searching sign keeps turning.

    It would seem that elements of the startup are failing to be read. Try booting to your Recovery Partition or Restore disk (depending on your version of OS X), and running Disk Utility to repair permissions and verify disk, on your main startup drive. If Verify Disk shows errors, try to run Repair Disk to correct them. Failing all of these, your main drive could have hardware issues in need of hands-on service, by an authorized Service Provider.
    To boot to your Recovery Partion in Lion or Mountain Lion, hold down the OPTION key while booting, and then select the Recovery Partition from the group of drives that show up in Starup Manager.

  • JControl.exe does not start...Database Initialisation Problem...MS SQL

    Hi,
    I was wondering if anyone has any idea on why JCONTROL.exe does not start. I am currently installing NW04s EP7. The DB is on another host and te SCS and CI are on a different host. I am going throught the installation when I get the following error fro the Bootstrap file.
    I have already done the following steps:
    1. entered the SAP<SID>DB password
    2. SQL is started and running on the second host.
    3. The bootstrap.propeties files look the same as any other file EP system on our network
    [Mar 7, 2007 5:32:35 PM  ] [Bootstrap module]> Problem occurred while performing synchronization.
    [Mar 7, 2007 5:35:45 PM  ] -
    [Mar 7, 2007 5:35:45 PM  ] Bootstrap MODE:
    [Mar 7, 2007 5:35:45 PM  ] <INSTANCE GLOBALS>
    [Mar 7, 2007 5:35:45 PM  ]  determined by parameter [ID0117060].
    [Mar 7, 2007 5:35:45 PM  ] -
    [Mar 7, 2007 5:35:46 PM  ] Exception occurred:
    com.sap.engine.bootstrap.SynchronizationException: Database initialization failed! Check database properties!
         at com.sap.engine.bootstrap.Bootstrap.initDatabaseConnection(Bootstrap.java:422)
         at com.sap.engine.bootstrap.Bootstrap.<init>(Bootstrap.java:144)
         at com.sap.engine.bootstrap.Bootstrap.main(Bootstrap.java:814)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at com.sap.engine.offline.OfflineToolStart.main(OfflineToolStart.java:81)
    ==[ Caused by: ]==----
    com.sap.engine.frame.core.configuration.ConfigurationException: Error occurred: Secure Store lib Dir does not exist
    PC04315\sapmnt\ET1\SYS\global\security\lib\tools
         at com.sap.engine.core.configuration.bootstrap.ConfigurationManagerBootstrapImpl.init(ConfigurationManagerBootstrapImpl.java:212)
         at com.sap.engine.core.configuration.bootstrap.ConfigurationManagerBootstrapImpl.<init>(ConfigurationManagerBootstrapImpl.java:49)
         at com.sap.engine.bootstrap.Synchronizer.<init>(Synchronizer.java:60)
         at com.sap.engine.bootstrap.Bootstrap.initDatabaseConnection(Bootstrap.java:419)
         at com.sap.engine.bootstrap.Bootstrap.<init>(Bootstrap.java:144)
         at com.sap.engine.bootstrap.Bootstrap.main(Bootstrap.java:814)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at com.sap.engine.offline.OfflineToolStart.main(OfflineToolStart.java:81)
    [Mar 7, 2007 5:35:46 PM  ] [Bootstrap module]> Problem occurred while performing synchronization.
    Many thanks,
    Adil Zafar

    ==[ Caused by: ]==----
    com.sap.engine.frame.core.configuration.ConfigurationException: Error occurred: Secure Store lib Dir does not exist
    PC04315\sapmnt\ET1\SYS\global\security\lib\tools
    Do you have strong encryption on your current system?

  • Workflow 2013 does not start automatically but 2010 yes

    Hello everyone,
    I'm facing to a strange issue on my SharePoint 2013 server:
    A workflow creates an item in an other list.
    This list has two workflows created by Designer 2013, one 2010, the other in 2013. The two are configured with the "Start when item created".When the item is created, 2010 starts but not the 2013.
    I'm not using the system account and I have two workflows to understand why the 2013 is not started automatically.
    Regards,

    Here is something similar..
    http://stackoverflow.com/questions/17222287/sharepoint-2013-workflow-not-firing-when-document-checked-in-but-works-if-checke
    Bala

  • I don't understand why ePrint does not work on emailing photos - Discard - Looked like a spam/ virus

    I don't understand why ePrint does not work on emailing photos - Discard - Looked like a spam/ virus

    Thanks. The problem was solved when I inserted a word in the subject line. Previously I was keeping it blank.

  • Why is this an error???  I don't understand why it is... Help Please

    Hi,
    Ok, I'll preface this by saying there's a lotta code pasted in here but it really quite an easy question, I just need to post all the code so you understand where what came from.
    Now.............the question I'm trying to do is to create an applet that has 2 buttons -- each button when clicked opens an application (one is a simple calculator, the other a Mortgage calculation app). When you click one of the buttons (calc or mortgage), that app opens infront of the 2 button menu so its in "focus". The button on the 2 button menu then switches to a "hide app X" button (ie: "Mortgage", changes to "Hide Mortgage"). Thus if you click the hide button, the app that was opened is hidden, and then that "hide" button switches back to the original "app X" button. Pretty simple.
    Now, I have from my text book an example that does exactly this, with the simple calculator already in it, and with another app (a traffic light thing) where the Mortgage should be in my final product. I also already have the Mortgage applet I need to insert from another book example in place of that Traffic Light portion.
    Now, common sense would dictate that I should be able to just copy my code for the Mortgage applet into the example that has the 2 button menu structure, and overwrite the code I want to get rid of (the traffic light) with the mortgage code & rename the menu buttons. Right?? A simple switch of one thing for another... but therein lies my problem.
    I copied all the Mortgage code in correctly over the traffic lights, switched the button names, tried to compile it but I get one error....
    Exercise12_17.java:52: cannot resolve symbol
    symbol  : method pack ()
    location: class MortgageApplet
            mortgageAppletFrame.pack();I don't understand why..... mortgageAppletFrame.pack(); was a simple rewrite from lightsFrame.pack(); like every other line...... it should work. I've gone over it for 2 days......... Anyone know why it comes up as an error???
    Below, in order going down is (1)my code with the 1 error I can't solve, (2)the original menu example I tried to edit, and (3)the Mortgage app code...........
    Does anyone know what my error is?? Help or a hint would be greatly appreciated........ Thanks.
    My erroring app.......
    // Exercise12_17.java: Create multiple windows
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.border.TitledBorder;
    public class Exercise12_17 extends JFrame implements ActionListener {
      // Declare and create a frame: an instance of MenuDemo
      MenuDemo calcFrame = new MenuDemo();
      // Declare and create a frame: an instance of RadioButtonDemo
      MortgageApplet mortgageAppletFrame = new MortgageApplet();
      // Declare two buttons for displaying frames
      private JButton jbtCalc;
      private JButton jbtMortgage;
      public static void main(String[] args) {
        Exercise12_17 frame = new Exercise12_17();
        frame.setSize( 400, 70 );
        frame.setTitle("Exercise 11.8: Multiple Windows Demo");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setVisible(true);
      public Exercise12_17() {
        // Add buttons to the main frame
        getContentPane().setLayout(new FlowLayout());
        getContentPane().add(jbtCalc = new JButton("Simple Calculator"));
         getContentPane().add(jbtMortgage = new JButton("Mortgage"));
        // Register the main frame as listener for the buttons
        jbtCalc.addActionListener(this);
         jbtMortgage.addActionListener(this);
      public void actionPerformed(ActionEvent e) {
        String arg = e.getActionCommand();
        if (e.getSource() instanceof JButton)
          if ("Simple Calculator".equals(arg)) {
            //show the MenuDemo frame
            jbtCalc.setText("Hide Simple Calculator");
            calcFrame.pack();
            calcFrame.setVisible(true);
          else if ("Hide Simple Calculator".equals(arg)) {
            calcFrame.setVisible(false);
            jbtCalc.setText("Simple Calculator");
          else if ("Mortgage".equals(arg)) {
            //show the CheckboxGroup frame
            mortgageAppletFrame.pack();
            jbtMortgage.setText("Hide Mortgage");
            mortgageAppletFrame.setVisible(true);
          else if ("Hide Mortgage".equals(arg)) {
            mortgageAppletFrame.setVisible(false);
            jbtMortgage.setText("Mortgage");
      class MortgageApplet extends JApplet
      implements ActionListener {
      // Declare and create text fields for interest rate
      // year, loan amount, monthly payment, and total payment
      private JTextField jtfAnnualInterestRate = new JTextField();
      private JTextField jtfNumOfYears = new JTextField();
      private JTextField jtfLoanAmount = new JTextField();
      private JTextField jtfMonthlyPayment = new JTextField();
      private JTextField jtfTotalPayment = new JTextField();
      // Declare and create a Compute Mortgage button
      private JButton jbtComputeMortgage = new JButton("Compute Mortgage");
      /** Initialize user interface */
      public void init() {
        // Set properties on the text fields
        jtfMonthlyPayment.setEditable(false);
        jtfTotalPayment.setEditable(false);
        // Right align text fields
        jtfAnnualInterestRate.setHorizontalAlignment(JTextField.RIGHT);
        jtfNumOfYears.setHorizontalAlignment(JTextField.RIGHT);
        jtfLoanAmount.setHorizontalAlignment(JTextField.RIGHT);
        jtfMonthlyPayment.setHorizontalAlignment(JTextField.RIGHT);
        jtfTotalPayment.setHorizontalAlignment(JTextField.RIGHT);
        // Panel p1 to hold labels and text fields
        JPanel p1 = new JPanel();
        p1.setLayout(new GridLayout(5, 2));
        p1.add(new Label("Annual Interest Rate"));
        p1.add(jtfAnnualInterestRate);
        p1.add(new Label("Number of Years"));
        p1.add(jtfNumOfYears);
        p1.add(new Label("Loan Amount"));
        p1.add(jtfLoanAmount);
        p1.add(new Label("Monthly Payment"));
        p1.add(jtfMonthlyPayment);
        p1.add(new Label("Total Payment"));
        p1.add(jtfTotalPayment);
        p1.setBorder(new
          TitledBorder("Enter interest rate, year and loan amount"));
        // Panel p2 to hold the button
        JPanel p2 = new JPanel();
        p2.setLayout(new FlowLayout(FlowLayout.RIGHT));
        p2.add(jbtComputeMortgage);
        // Add the components to the applet
        getContentPane().add(p1, BorderLayout.CENTER);
        getContentPane().add(p2, BorderLayout.SOUTH);
        // Register listener
        jbtComputeMortgage.addActionListener(this);
      /** Handle the "Compute Mortgage" button */
      public void actionPerformed(ActionEvent e) {
        if (e.getSource() == jbtComputeMortgage) {
          // Get values from text fields
          double interest = (Double.valueOf(
            jtfAnnualInterestRate.getText())).doubleValue();
          int year =
            (Integer.valueOf(jtfNumOfYears.getText())).intValue();
          double loan =
            (Double.valueOf(jtfLoanAmount.getText())).doubleValue();
          // Create a mortgage object
          Mortgage m = new Mortgage(interest, year, loan);
          // Display monthly payment and total payment
          jtfMonthlyPayment.setText(String.valueOf(m.monthlyPayment()));
          jtfTotalPayment.setText(String.valueOf(m.totalPayment()));
    class MenuDemo extends JFrame implements ActionListener {
      // Text fields for Number 1, Number 2, and Result
      private JTextField jtfNum1, jtfNum2, jtfResult;
      // Buttons "Add", "Subtract", "Multiply" and "Divide"
      private JButton jbtAdd, jbtSub, jbtMul, jbtDiv;
      // Menu items "Add", "Subtract", "Multiply","Divide" and "Close"
      private JMenuItem jmiAdd, jmiSub, jmiMul, jmiDiv, jmiClose;
      /** Main method */
      public static void main(String[] args) {
        MenuDemo frame = new MenuDemo();
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.pack();
        frame.setVisible(true);
      /** Default constructor */
      public MenuDemo() {
        setTitle("Menu Demo");
        // Create menu bar
        JMenuBar jmb = new JMenuBar();
        // Set menu bar to the frame
        setJMenuBar(jmb);
        // Add menu "Operation" to menu bar
        JMenu operationMenu = new JMenu("Operation");
        operationMenu.setMnemonic('O');
        jmb.add(operationMenu);
        // Add menu "Exit" in menu bar
        JMenu exitMenu = new JMenu("Exit");
        exitMenu.setMnemonic('E');
        jmb.add(exitMenu);
        // Add menu items with mnemonics to menu "Operation"
        operationMenu.add(jmiAdd= new JMenuItem("Add", 'A'));
        operationMenu.add(jmiSub = new JMenuItem("Subtract", 'S'));
        operationMenu.add(jmiMul = new JMenuItem("Multiply", 'M'));
        operationMenu.add(jmiDiv = new JMenuItem("Divide", 'D'));
        exitMenu.add(jmiClose = new JMenuItem("Close", 'C'));
        // Set keyboard accelerators
        jmiAdd.setAccelerator(
          KeyStroke.getKeyStroke(KeyEvent.VK_A, ActionEvent.CTRL_MASK));
        jmiSub.setAccelerator(
          KeyStroke.getKeyStroke(KeyEvent.VK_S, ActionEvent.CTRL_MASK));
        jmiMul.setAccelerator(
          KeyStroke.getKeyStroke(KeyEvent.VK_M, ActionEvent.CTRL_MASK));
        jmiDiv.setAccelerator(
          KeyStroke.getKeyStroke(KeyEvent.VK_D, ActionEvent.CTRL_MASK));
        // Panel p1 to hold text fields and labels
        JPanel p1 = new JPanel();
        p1.setLayout(new FlowLayout());
        p1.add(new JLabel("Number 1"));
        p1.add(jtfNum1 = new JTextField(3));
        p1.add(new JLabel("Number 2"));
        p1.add(jtfNum2 = new JTextField(3));
        p1.add(new JLabel("Result"));
        p1.add(jtfResult = new JTextField(4));
        jtfResult.setEditable(false);
        // Panel p2 to hold buttons
        JPanel p2 = new JPanel();
        p2.setLayout(new FlowLayout());
        p2.add(jbtAdd = new JButton("Add"));
        p2.add(jbtSub = new JButton("Subtract"));
        p2.add(jbtMul = new JButton("Multiply"));
        p2.add(jbtDiv = new JButton("Divide"));
        // Add panels to the frame
        getContentPane().setLayout(new BorderLayout());
        getContentPane().add(p1, BorderLayout.CENTER);
        getContentPane().add(p2, BorderLayout.SOUTH);
        // Register listeners
        jbtAdd.addActionListener(this);
        jbtSub.addActionListener(this);
        jbtMul.addActionListener(this);
        jbtDiv.addActionListener(this);
        jmiAdd.addActionListener(this);
        jmiSub.addActionListener(this);
        jmiMul.addActionListener(this);
        jmiDiv.addActionListener(this);
        jmiClose.addActionListener(this);
      /** Handle ActionEvent from buttons and menu items */
      public void actionPerformed(ActionEvent e) {
        String actionCommand = e.getActionCommand();
        // Handle button events
        if (e.getSource() instanceof JButton) {
          if ("Add".equals(actionCommand))
            calculate('+');
          else if ("Subtract".equals(actionCommand))
            calculate('-');
          else if ("Multiply".equals(actionCommand))
            calculate('*');
          else if ("Divide".equals(actionCommand))
            calculate('/');
        else if (e.getSource() instanceof JMenuItem) {
          // Handle menu item events
          if ("Add".equals(actionCommand))
            calculate('+');
          else if ("Subtract".equals(actionCommand))
            calculate('-');
          else if ("Multiply".equals(actionCommand))
            calculate('*');
          else if ("Divide".equals(actionCommand))
            calculate('/');
          else if ("Close".equals(actionCommand))
            System.exit(0);
      /** Calculate and show the result in jtfResult */
      private void calculate(char operator) {
        // Obtain Number 1 and Number 2
        int num1 = (Integer.parseInt(jtfNum1.getText().trim()));
        int num2 = (Integer.parseInt(jtfNum2.getText().trim()));
        int result = 0;
        // Perform selected operation
        switch (operator) {
          case '+': result = num1 + num2;
                    break;
          case '-': result = num1 - num2;
                    break;
          case '*': result = num1 * num2;
                    break;
          case '/': result = num1 / num2;
        // Set result in jtfResult
        jtfResult.setText(String.valueOf(result));
    Original 2 button menu example....
    // Exercise11_8.java: Create multiple windows
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class Exercise11_8 extends JFrame implements ActionListener {
      // Declare and create a frame: an instance of MenuDemo
      MenuDemo calcFrame = new MenuDemo();
      // Declare and create a frame: an instance of RadioButtonDemo
      RadioButtonDemo lightsFrame = new RadioButtonDemo();
      // Declare two buttons for displaying frames
      private JButton jbtCalc;
      private JButton jbtLights;
      public static void main(String[] args) {
        Exercise11_8 frame = new Exercise11_8();
        frame.setSize( 400, 70 );
        frame.setTitle("Exercise 11.8: Multiple Windows Demo");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setVisible(true);
      public Exercise11_8() {
        // Add buttons to the main frame
        getContentPane().setLayout(new FlowLayout());
        getContentPane().add(jbtCalc = new JButton("Simple Calculator"));
        getContentPane().add(jbtLights = new JButton("Traffic Lights"));
        // Register the main frame as listener for the buttons
        jbtCalc.addActionListener(this);
        jbtLights.addActionListener(this);
      public void actionPerformed(ActionEvent e) {
        String arg = e.getActionCommand();
        if (e.getSource() instanceof JButton)
          if ("Simple Calculator".equals(arg)) {
            //show the MenuDemo frame
            jbtCalc.setText("Hide Simple Calculator");
            calcFrame.pack();
            calcFrame.setVisible(true);
          else if ("Hide Simple Calculator".equals(arg)) {
            calcFrame.setVisible(false);
            jbtCalc.setText("Simple Calculator");
          else if ("Traffic Lights".equals(arg)) {
            //show the CheckboxGroup frame
            lightsFrame.pack();
            jbtLights.setText("Hide Traffic Lights");
            lightsFrame.setVisible(true);
          else if ("Hide Traffic Lights".equals(arg)) {
            lightsFrame.setVisible(false);
            jbtLights.setText("Traffic Lights");
         class RadioButtonDemo extends JFrame
      implements ItemListener {
      // Declare radio buttons
      private JRadioButton jrbRed, jrbYellow, jrbGreen;
      // Declare a radio button group
      private ButtonGroup btg = new ButtonGroup();
      // Declare a traffic light display panel
      private Light light;
      /** Main method */
      public static void main(String[] args) {
        RadioButtonDemo frame = new RadioButtonDemo();
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setSize(250, 170);
        frame.setVisible(true);
      /** Default constructor */
      public RadioButtonDemo() {
        setTitle("RadioButton Demo");
        // Add traffic light panel to panel p1
        JPanel p1 = new JPanel();
        p1.setSize(200, 200);
        p1.setLayout(new FlowLayout(FlowLayout.CENTER));
        light = new Light();
        light.setSize(40, 90);
        p1.add(light);
        // Put the radio button in Panel p2
        JPanel p2 = new JPanel();
        p2.setLayout(new FlowLayout());
        p2.add(jrbRed = new JRadioButton("Red", true));
        p2.add(jrbYellow = new JRadioButton("Yellow", false));
        p2.add(jrbGreen = new JRadioButton("Green", false));
        // Set keyboard mnemonics
        jrbRed.setMnemonic('R');
        jrbYellow.setMnemonic('Y');
        jrbGreen.setMnemonic('G');
        // Group radio buttons
        btg.add(jrbRed);
        btg.add(jrbYellow);
        btg.add(jrbGreen);
        // Place p1 and p2 in the frame
        getContentPane().setLayout(new BorderLayout());
        getContentPane().add(p1, BorderLayout.CENTER);
        getContentPane().add(p2, BorderLayout.SOUTH);
        // Register listeners for check boxes
        jrbRed.addItemListener(this);
        jrbYellow.addItemListener(this);
        jrbGreen.addItemListener(this);
      /** Handle checkbox events */
      public void itemStateChanged(ItemEvent e) {
        if (jrbRed.isSelected())
          light.turnOnRed(); // Set red light
        if (jrbYellow.isSelected())
          light.turnOnYellow(); // Set yellow light
        if (jrbGreen.isSelected())
          light.turnOnGreen(); // Set green light
    // Three traffic lights shown in a panel
    class Light extends JPanel {
      private boolean red;
      private boolean yellow;
      private boolean green;
      /** Default constructor */
      public Light() {
        turnOnGreen();
      /** Set red light on */
      public void turnOnRed() {
        red = true;
        yellow = false;
        green = false;
        repaint();
      /** Set yellow light on */
      public void turnOnYellow() {
        red = false;
        yellow = true;
        green = false;
        repaint();
      /** Set green light on */
      public void turnOnGreen() {
        red = false;
        yellow = false;
        green = true;
        repaint();
      /** Display lights */
      public void paintComponent(Graphics g) {
        super.paintComponent(g);
        if (red) {
          g.setColor(Color.red);
          g.fillOval(10, 10, 20, 20);
          g.setColor(Color.black);
          g.drawOval(10, 35, 20, 20);
          g.drawOval(10, 60, 20, 20);
          g.drawRect(5, 5, 30, 80);
        else if (yellow) {
          g.setColor(Color.yellow);
          g.fillOval(10, 35, 20, 20);
          g.setColor(Color.black);
          g.drawRect(5, 5, 30, 80);
          g.drawOval(10, 10, 20, 20);
          g.drawOval(10, 60, 20, 20);
        else if (green) {
          g.setColor(Color.green);
          g.fillOval(10, 60, 20, 20);
          g.setColor(Color.black);
          g.drawRect(5, 5, 30, 80);
          g.drawOval(10, 10, 20, 20);
          g.drawOval(10, 35, 20, 20);
        else {
          g.setColor(Color.black);
          g.drawRect(5, 5, 30, 80);
          g.drawOval(10, 10, 20, 20);
          g.drawOval(10, 35, 20, 20);
          g.drawOval(10, 60, 20, 20);
      /** Set preferred size */
      public Dimension getPreferredSize() {
        return new Dimension(40, 90);
    class MenuDemo extends JFrame implements ActionListener {
      // Text fields for Number 1, Number 2, and Result
      private JTextField jtfNum1, jtfNum2, jtfResult;
      // Buttons "Add", "Subtract", "Multiply" and "Divide"
      private JButton jbtAdd, jbtSub, jbtMul, jbtDiv;
      // Menu items "Add", "Subtract", "Multiply","Divide" and "Close"
      private JMenuItem jmiAdd, jmiSub, jmiMul, jmiDiv, jmiClose;
      /** Main method */
      public static void main(String[] args) {
        MenuDemo frame = new MenuDemo();
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.pack();
        frame.setVisible(true);
      /** Default constructor */
      public MenuDemo() {
        setTitle("Menu Demo");
        // Create menu bar
        JMenuBar jmb = new JMenuBar();
        // Set menu bar to the frame
        setJMenuBar(jmb);
        // Add menu "Operation" to menu bar
        JMenu operationMenu = new JMenu("Operation");
        operationMenu.setMnemonic('O');
        jmb.add(operationMenu);
        // Add menu "Exit" in menu bar
        JMenu exitMenu = new JMenu("Exit");
        exitMenu.setMnemonic('E');
        jmb.add(exitMenu);
        // Add menu items with mnemonics to menu "Operation"
        operationMenu.add(jmiAdd= new JMenuItem("Add", 'A'));
        operationMenu.add(jmiSub = new JMenuItem("Subtract", 'S'));
        operationMenu.add(jmiMul = new JMenuItem("Multiply", 'M'));
        operationMenu.add(jmiDiv = new JMenuItem("Divide", 'D'));
        exitMenu.add(jmiClose = new JMenuItem("Close", 'C'));
        // Set keyboard accelerators
        jmiAdd.setAccelerator(
          KeyStroke.getKeyStroke(KeyEvent.VK_A, ActionEvent.CTRL_MASK));
        jmiSub.setAccelerator(
          KeyStroke.getKeyStroke(KeyEvent.VK_S, ActionEvent.CTRL_MASK));
        jmiMul.setAccelerator(
          KeyStroke.getKeyStroke(KeyEvent.VK_M, ActionEvent.CTRL_MASK));
        jmiDiv.setAccelerator(
          KeyStroke.getKeyStroke(KeyEvent.VK_D, ActionEvent.CTRL_MASK));
        // Panel p1 to hold text fields and labels
        JPanel p1 = new JPanel();
        p1.setLayout(new FlowLayout());
        p1.add(new JLabel("Number 1"));
        p1.add(jtfNum1 = new JTextField(3));
        p1.add(new JLabel("Number 2"));
        p1.add(jtfNum2 = new JTextField(3));
        p1.add(new JLabel("Result"));
        p1.add(jtfResult = new JTextField(4));
        jtfResult.setEditable(false);
        // Panel p2 to hold buttons
        JPanel p2 = new JPanel();
        p2.setLayout(new FlowLayout());
        p2.add(jbtAdd = new JButton("Add"));
        p2.add(jbtSub = new JButton("Subtract"));
        p2.add(jbtMul = new JButton("Multiply"));
        p2.add(jbtDiv = new JButton("Divide"));
        // Add panels to the frame
        getContentPane().setLayout(new BorderLayout());
        getContentPane().add(p1, BorderLayout.CENTER);
        getContentPane().add(p2, BorderLayout.SOUTH);
        // Register listeners
        jbtAdd.addActionListener(this);
        jbtSub.addActionListener(this);
        jbtMul.addActionListener(this);
        jbtDiv.addActionListener(this);
        jmiAdd.addActionListener(this);
        jmiSub.addActionListener(this);
        jmiMul.addActionListener(this);
        jmiDiv.addActionListener(this);
        jmiClose.addActionListener(this);
      /** Handle ActionEvent from buttons and menu items */
      public void actionPerformed(ActionEvent e) {
        String actionCommand = e.getActionCommand();
        // Handle button events
        if (e.getSource() instanceof JButton) {
          if ("Add".equals(actionCommand))
            calculate('+');
          else if ("Subtract".equals(actionCommand))
            calculate('-');
          else if ("Multiply".equals(actionCommand))
            calculate('*');
          else if ("Divide".equals(actionCommand))
            calculate('/');
        else if (e.getSource() instanceof JMenuItem) {
          // Handle menu item events
          if ("Add".equals(actionCommand))
            calculate('+');
          else if ("Subtract".equals(actionCommand))
            calculate('-');
          else if ("Multiply".equals(actionCommand))
            calculate('*');
          else if ("Divide".equals(actionCommand))
            calculate('/');
          else if ("Close".equals(actionCommand))
            System.exit(0);
      /** Calculate and show the result in jtfResult */
      private void calculate(char operator) {
        // Obtain Number 1 and Number 2
        int num1 = (Integer.parseInt(jtfNum1.getText().trim()));
        int num2 = (Integer.parseInt(jtfNum2.getText().trim()));
        int result = 0;
        // Perform selected operation
        switch (operator) {
          case '+': result = num1 + num2;
                    break;
          case '-': result = num1 - num2;
                    break;
          case '*': result = num1 * num2;
                    break;
          case '/': result = num1 / num2;
        // Set result in jtfResult
        jtfResult.setText(String.valueOf(result));
    Mortgage applet code....
    // MortgageApplet.java: Applet for computing mortgage payments
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.border.TitledBorder;
    public class MortgageApplet extends JApplet
      implements ActionListener {
      // Declare and create text fields for interest rate
      // year, loan amount, monthly payment, and total payment
      private JTextField jtfAnnualInterestRate = new JTextField();
      private JTextField jtfNumOfYears = new JTextField();
      private JTextField jtfLoanAmount = new JTextField();
      private JTextField jtfMonthlyPayment = new JTextField();
      private JTextField jtfTotalPayment = new JTextField();
      // Declare and create a Compute Mortgage button
      private JButton jbtComputeMortgage = new JButton("Compute Mortgage");
      /** Initialize user interface */
      public void init() {
        // Set properties on the text fields
        jtfMonthlyPayment.setEditable(false);
        jtfTotalPayment.setEditable(false);
        // Right align text fields
        jtfAnnualInterestRate.setHorizontalAlignment(JTextField.RIGHT);
        jtfNumOfYears.setHorizontalAlignment(JTextField.RIGHT);
        jtfLoanAmount.setHorizontalAlignment(JTextField.RIGHT);
        jtfMonthlyPayment.setHorizontalAlignment(JTextField.RIGHT);
        jtfTotalPayment.setHorizontalAlignment(JTextField.RIGHT);
        // Panel p1 to hold labels and text fields
        JPanel p1 = new JPanel();
        p1.setLayout(new GridLayout(5, 2));
        p1.add(new Label("Annual Interest Rate"));
        p1.add(jtfAnnualInterestRate);
        p1.add(new Label("Number of Years"));
        p1.add(jtfNumOfYears);
        p1.add(new Label("Loan Amount"));
        p1.add(jtfLoanAmount);
        p1.add(new Label("Monthly Payment"));
        p1.add(jtfMonthlyPayment);
        p1.add(new Label("Total Payment"));
        p1.add(jtfTotalPayment);
        p1.setBorder(new
          TitledBorder("Enter interest rate, year and loan amount"));
        // Panel p2 to hold the button
        JPanel p2 = new JPanel();
        p2.setLayout(new FlowLayout(FlowLayout.RIGHT));
        p2.add(jbtComputeMortgage);
        // Add the components to the applet
        getContentPane().add(p1, BorderLayout.CENTER);
        getContentPane().add(p2, BorderLayout.SOUTH);
        // Register listener
        jbtComputeMortgage.addActionListener(this);
      /** Handle the "Compute Mortgage" button */
      public void actionPerformed(ActionEvent e) {
        if (e.getSource() == jbtComputeMortgage) {
          // Get values from text fields
          double interest = (Double.valueOf(
            jtfAnnualInterestRate.getText())).doubleValue();
          int year =
            (Integer.valueOf(jtfNumOfYears.getText())).intValue();
          double loan =
            (Double.valueOf(jtfLoanAmount.getText())).doubleValue();
          // Create a mortgage object
          Mortgage m = new Mortgage(interest, year, loan);
          // Display monthly payment and total payment
          jtfMonthlyPayment.setText(String.valueOf(m.monthlyPayment()));
          jtfTotalPayment.setText(String.valueOf(m.totalPayment()));
    }

    Does it have to be an applet?
    If you want the same behaviour as in the code with traffic lights, change
    class MortgageApplet extends JApplet implements ActionListener {
    to
    class MortgageApplet extends JFrame implements ActionListener {
    and change
    public void init() {
    to
    public MortgageApplet() {                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • I have done the softer update and now this system request a connection with a meanie HD and I connector for iTunes I don't understand why ?

    I have done the softer update and now this system request a connection with a Mini  HDMI  connector for iTunes I don't understand why ?
    DO I HAVE TO HAVE THE MINI HDMI CONNECTOR TO COMPLETE THE SOFTER UPDATE PROCESS ?

    You might be seeing a Micro USB cable (Not HDMI) that is because your Apple Tv is in Recovery Mode due to some reason and it needs to be Restored by connecting it to iTunes on your Computer. So if you have a Micro USB cable ( which comes with Android Smart Phones ) then try to connect your Apple Tv to your computer using the same and with the help of iTunes Restore your Apple Tv to Factory Settings. Go through the below Apple Support kb which says " If your Apple TV still does not respond or if you were unable to follow the above steps "
    http://support.apple.com/kb/ht4367

  • HT1918 i don't understand why i cannot purchase anything using my Mastercard. Each time i enter the card expiry date, it will show an error.

    Last time i usually pay the purchasing item using my debit visa card.
    after that i no more use the debit visa card.
    i'm using mastercard.
    now each time i want to purchase anything, i cannot pay using the mastercard.
    when i insert all the details including the expiry date, apple will show an error. only the expiry date.
    i don't understand why.

    Does it have to be an applet?
    If you want the same behaviour as in the code with traffic lights, change
    class MortgageApplet extends JApplet implements ActionListener {
    to
    class MortgageApplet extends JFrame implements ActionListener {
    and change
    public void init() {
    to
    public MortgageApplet() {                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Maybe you are looking for

  • Advanced HTTP Receiver Configuration

    Hi Experts, In my Business Scenario I am using the HTTP Receiver Adapter with "Additional Query String Attributes" for adding up the "MessageID" in the HTTP Header(I am not sure whether it will be added there).. and the adapter sends the HTTP data to

  • ORA-12560: Protocol adapter error

    Hi All, I've installed Oracle Developer 10g and make the Net Configuration Assistant which is successful, but when I run the form it gives me this error: ORA-12560: Protocol adapter error I know this error and solved it before but I forgot how! So ho

  • Want to import/transfer ratings of songs, etc. Can't figure out how.

    I changed computers to use the new one as my primary source for iTunes use. Music and everything else imported / transferred, BUT the rating for each song, etc., DID NOT transfer. Is this possible or do I have to re-rate all songs??? How can I transf

  • Cant change domain name

    I cant seem to get rid of my old domain name in iweb every time i try to visit my new site it always takes me to my old domain and also at the bottom of the iweb page it still lists my old domain in parentheses. I have tried over and over to change d

  • Im connected to wifi but the internet wont work?

    im connected to wifi but the internet wont work how do i make it work