Help, please, understanding error messages (copied)
I've posted this originally on the Leopard Forum, but I'm thinking someone here with an intimate knowledge of OSX code might be able to help.
http://discussions.apple.com/thread.jspa?threadID=2283095&tstart=0
I realize this is about third party software, but I've googled around and the following errors, which are being repeatedly logged when using Canon Camera softrware, seem to be generated for a number of other basic OSX applications, so maybe someone might have an idea what, in general, would cause them and what they might mean. I haven't been able to find anything very specific for Canon.
I've called Canon Tech up to second level and they have no idea what these mean or why they are being generated. I've already tried trashing several of the user .plists. Since the program apparently runs OK, it would seem they might just be some harmless bug in the Canon code when running with OSX and can be ignored, but would like to know from someone if that sounds right. NS means name server? I'm getting tons of these. Thanks.
Dec 30 09:10:19 Macintosh-3 MCU[125]: * -[NSConditionLock unlockWithCondition:]: lock (<NSConditionLock: 0x19ac70> '(null)') unlocked when not locked
Dec 30 09:10:19 Macintosh-3 MCU[125]: * Break on _NSLockError() to debug.
MCU is the Canon Application.
WZZZ wrote:
Since the program apparently runs OK, it would seem they might just be some harmless bug in the Canon code when running with OSX and can be ignored, but would like to know from someone if that sounds right. NS means name server?
You are correct, more or less. NS actually stands for "NextStep", the original name for Cocoa.
These errors are just bugs in Canon's code. There is nothing you can do to fix them.
Similar Messages
-
I bought a downloadable version yesterday of both Photoshop Elements 13 & Premiere Elements 13 & both seemed to install ok today. However, when I launch Premiere Elements, I get the following error message.= "There is no disk in the drive. Please insert a disk into drive\Device\Harddisk1\DR1" Obviously don't have a disk to insert as downloadable version, can anybody help please?. Thanks
Mudanzas
Please delete or disable the OldFilm.AEX file.
That is the Adobe solution for the issue in Premiere Elements 13.
In Windows 7, 8, or 8.1 64 bit, the path to the file is
Local Disk C
Program Files
Adobe
Adobe Premiere Elements 13
Plug-ins
Common
NewBlue
and in the NewBlue Folder is the OldFilm.AEX file that you delete or disable by renaming it from OldFilm.AEX to OldFIlm.AEXOLD.
Please let us know if that works for you.
Thank you.
ATR -
ABAP OO Error - Need help to understand error message
When I try to create the following code, I get the error 'Statement is not accessible' on the create object command. I tried this on a 6.2 and 6.4 system and I got the same error. Any hints as to what I am doing wrong. Thanks! Bill
INCLUDE Soapincl.
DATA: osoap TYPE REF TO CSoapDocument.
CREATE OBJECT osoap.
CALL METHOD osoap->set_tag_name_format
EXPORTING format = CSoapConstants=>ic_tagfmt_default.Hi bill,
1.
report abc.
INCLUDE Soapincl.
DATA: osoap TYPE REF TO CSoapDocument.
<b>START-OF-SELECTION. <----
IMPORTANT.</b>
CREATE OBJECT osoap.
CALL METHOD osoap->set_tag_name_format
EXPORTING format = CSoapConstants=>ic_tagfmt_default.
2. Give any event name.
eg. INITIALIZATION ETC.
regards,
amit m. -
Help with the error message that ADE is not allowed to copy a book onto my Nook. I have tried authorizing and unauthorizing many times--at wits end with this issue.
I too am having the same problem. I have a new hard drive that was imaged from the old one and I'm trying to side load a book to my Nook Simple Touch.. I first installed ADE 4 then borrowed and downloaded a book from Overdrive. I tried a few times to delete and reauthorize both the computer and the Nook and each time I get an authorization error when I try to side load the book. I then found on the Nook forum that the Simple Touch and ADE 4 don't get along. So I uninstalled ADE 4 and installed ADE 3.
I then followed this recommended procedure found on the forum: I deleted the Digital Editions folder from my Nook, launched ADE 3 and authorized the computer, then connected the Nook. For a few seconds, hovering the mouse over the setting icon for the Nook displayed everything on the context menu grayed out. But then it showed the context menu and I was able to display the Nook's authorization, which was the same as the computer's. Still get the same error side loading the book. Deleting and reauthorizing doesn't help. And the Digital Editions folder is still missing from the Nook. -
I try to sync my nano and get: the ipod cant be synced because there is not enough free space to hold all of the items in the items library (need 100MB) - I have a new computer?? can you help me understand this message: what to do?
Hello pryan1012,
What this message means is that you have more music in your itunes library than there is free space in your ipod.
I had this same issue at one time. This is what helped me put my music on the ipod. I used manually manage.
Learn how to sync muisc here.
Hope this helps.
~Julian -
I cannot sync my iTunes library to my iphone5 can you help I get error message a connection could not be established to the iPhone
Yes it is.
Initially I got an error message saying can't connect because of Date & Time settings.
Went in and re-verified that those were correct.
Tried to update downloads and then got a new error message: "Can't connect to iTunes Store".
I live in the US and that's where I created my iTunes a/d and Apple ID.
I am currently in India --- can that coause confusion re date & time? -
Understanding error messages from console...help please
Hi,
I am getting there...almost...my classes compiled...so far so good...
However, when I hit the "Submit" button (class Booking) the program seems to get stuck on something ...and I don't how to understand the error message:
Here is the error message, underneath are the two classes involved (code):
D:\JBuilder8\jdk1.4\bin\appletviewer.exe Booking.html
java.lang.NumberFormatException: null
at java.lang.Integer.parseInt(Integer.java:394)
at java.lang.Integer.parseInt(Integer.java:476)
at Order.getPeople(Order.java:57)
at ConfirmationPopup.<init>(ConfirmationPopup.java:72)
at DetailsPopup.actionPerformed(DetailsPopup.java:152)
at java.awt.Button.processActionEvent(Button.java:381)
at java.awt.Button.processEvent(Button.java:350)
at java.awt.Component.dispatchEventImpl(Component.java:3598)
at java.awt.Component.dispatchEvent(Component.java:3439)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:450)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:197)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:144)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:136)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:99)
import java.awt.*;
import java.awt.event.*;
import java.util.StringTokenizer;
public class DetailsPopup extends Frame implements ActionListener,ItemListener
TextField SName;
TextField FName;
TextField Email;
TextField CCard;
Choice ChoiceExpMonth;
Choice ChoiceExpYear;
Color LightBlue = new Color(180,180,255);
String a6;
String a7;
String a8;
String a4 = "1";
String a5 = "2003";
public DetailsPopup(String f,String co,String pr,String pe)
super(f);
a6 = co;
a7 = pr;
a8 = pe;
Button b3 = new Button ("Submit");
b3.addActionListener(this);
Panel panel = new Panel();
panel.setBackground(Color.yellow);
panel.add(b3);
add("South", panel);
Panel fieldPanel = new Panel();
fieldPanel.setBackground(LightBlue);
fieldPanel.setLayout(new GridLayout(0,1));
panel = new Panel();
panel.add(new Label("Surname"));
SName = new TextField(15);
panel.add(SName);
fieldPanel.add(panel);
panel = new Panel();
panel.add( new Label("First Name"));
FName = new TextField(15);
panel.add(FName);
fieldPanel.add(panel);
panel = new Panel();
panel.add( new Label("E-mail"));
Email = new TextField(15);
panel.add(Email);
fieldPanel.add(panel);
panel = new Panel();
panel.add( new Label("Credit/Debit Card"));
CCard = new TextField(16);
panel.add(CCard);
fieldPanel.add(panel);
panel = new Panel();
panel.add( new Label("Expiry Date"));
panel.add( new Label("Month"));
ChoiceExpMonth = new Choice();
ChoiceExpMonth.addItemListener(this);
panel.add(ChoiceExpMonth);
fieldPanel.add(panel);
int i = 1;
while (i < 13)
ChoiceExpMonth.addItem(new Integer(i).toString());
i++;
panel = new Panel();
panel.add(new Label("Year"));
ChoiceExpYear = new Choice();
ChoiceExpYear.addItemListener(this);
panel.add(ChoiceExpYear);
fieldPanel.add(panel);
int j = 2003;
while (j < 2008)
ChoiceExpYear.addItem(new Integer(j).toString());
j++;
add(fieldPanel, "Center");
setSize(400, 300);
setLocation(320,240);
setVisible(true);
//addWindowListener(new WindowAdapter() {
//public void windowClosing(WindowEvent e) {
//System.exit(0);
public void itemStateChanged(ItemEvent e) //read choice from ChoiceExpMonth and/or ChoiceExpYear DropDowns
if (e.getSource().equals (ChoiceExpMonth))
a4 = (String) e.getItem(); // When ChoiceExpMonth is modified
if (e.getSource().equals (ChoiceExpYear))
a5 = (String) e.getItem(); // When ChoiceExpYear is modified
public void actionPerformed( ActionEvent e)
String Name = "";
String First = "";
String Card = "";
String Mail = "";
String TestEmail = Email.getText();
StringTokenizer st = new StringTokenizer(TestEmail,"@");
if (SName.getText().length() == 0)
Name = "bad";
if (FName.getText().length() == 0)
First = "bad";
if (CCard.getText().length() != 16)
Card = "bad";
if(TestEmail.indexOf("@") == -1)
System.out.println("TestEmail has no '@' symbol");
if (st.countTokens() != 2)
Mail = "bad";
if (Name.equals("bad") || First.equals("bad") || Card.equals("bad") || Mail.equals("bad"))
Dialog Err = new Erratum (new Frame (),Name,First,Card,Mail);
else
dispose();
String a0 = SName.getText();
String a1 = FName.getText();
String a2 = Email.getText();
String a3 = CCard.getText();
ConfirmationPopup Conf = new ConfirmationPopup(new Frame(),a0,a1,a2,a3,a4,a5,a6,a7,a8);
//System.out.println("Name = " + Name + "\n" +
//"First = " + First + "\n" +
//"Card = " + Card + "\n" +
//"Mail = " + Mail);
//public static void main(String[] args) {
//new DetailsPopup("Chaos!");
class ConfirmationPopup
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
import java.awt.Dialog.*;
class ConfirmationPopup extends Dialog implements ActionListener
Dialog Confirmation;
Color LightBlue = new Color(180,180,255);
ConfirmationPopup(Frame f,String a0,String a1,String a2,String a3,String a4,String a5,String a6,String a7,String a8)
super(f);
String SName = a0;
String FName = a1;
String Email = a2;
String CCard = a3;
String ExpMonth = a4;
String ExpYear = a5;
String Course = a6;
String Price = a7;
String People = a8;
String[] c = {SName,FName,Email,CCard,ExpMonth,ExpYear,Course,Price,People};
Order order1 = new Order(c);
Button b6 = new Button ("OK"); //OK
b6.addActionListener(this);
Panel panel = new Panel();
panel.setBackground(LightBlue);
panel.add(b6);
add("South", panel);
Panel Datapanel = new Panel();
Datapanel.setBackground(LightBlue);
Datapanel.setLayout(new GridLayout(0,1));
panel = new Panel();
panel.add( new Label("Surname:"));
panel.add( new Label(order1.getSName()));
Datapanel.add(panel);
panel = new Panel();
panel.add( new Label("First Name:"));
panel.add( new Label(order1.getFName()));
Datapanel.add(panel);
panel = new Panel();
panel.add( new Label("E-mail:"));
panel.add( new Label(order1.getEmail()));
Datapanel.add(panel);
panel = new Panel();
panel.add( new Label("Credit/Debit Card:"));
panel.add( new Label(order1.getCCard()));
Datapanel.add(panel);
panel = new Panel();
panel.add( new Label("Expiry Date:"));
panel.add( new Label(order1.getExpMonth() +"/" +order1.getExpYear()));
Datapanel.add(panel);
panel = new Panel();
panel.add( new Label("Course booked:"));
panel.add( new Label(order1.getCourse()));
Datapanel.add(panel);
panel = new Panel();
panel.add( new Label("Number of persons:"));
panel.add( new Label(new Integer(order1.getPeople()).toString()));
Datapanel.add(panel);
panel = new Panel();
panel.add( new Label("Total Cost of your order"));
panel.add( new Label(new Integer(order1.getTotal()).toString()));
Datapanel.add(panel);
add(Datapanel, "Center");
setSize(400,300);
setLocation(320,240);
setTitle("Order Confirmation");
pack();
public void actionPerformed( ActionEvent e)
dispose();here is also the class Order
import java.util.*;
public class Order
private String[] OrderDetails = new String[9]; //create array 9 elements
Order(String[] c)
this.OrderDetails = c;
String getSName() //return Surname
String s = OrderDetails[0];
return s;
String getFName() //return First Name
String f = OrderDetails[1];
return f;
String getEmail() //return E-mail
String email = OrderDetails[2];
return email;
String getCCard() //return CCard number
String cc = OrderDetails[3];
return cc;
String getExpMonth() //return CCard Expiry Month
String expm = OrderDetails[4];
return expm;
String getExpYear() //return CCard Expiry Year
String expy = OrderDetails[5];
return expy;
String getCourse() //return Course's name
String course = OrderDetails[6];
return course;
int getPrice() //return Price (Full-Time, Part-Time, Concessions)
String price1 = OrderDetails[7];
int price = Integer.parseInt(price1);
return price;
int getPeople() //return number of participants
String people1 = OrderDetails[8];
int people = Integer.parseInt(people1);
return people;
int getTotal() //return total cost of booking
int Total = getPrice()*getPeople();
return Total;
} -
I have this error message:
System extension cannot be used
The system extension “/System/Library/Extensions/AppleACPIPlatform.kext” was installed improperly and cannot be used. Please try reinstalling it, or contact the product’s vendor for an update.
Please help. Is there a update or how do I reinstall?
Thanks,
JohnI submitted the above question, later finding that it has been answered by Buller already. No one need reply as Buller's answer seems to solve the problem for others, and I'll try that.
Jim -
Can anyone help with iTunes error message (0x80092013) please?
I just updated iTunes and now I get error message (0x80092013), does anyone know how to fix it please? I am using Windows, not Mac.
I am having the exact same problem! and now i can't access my pending downloads!! if anybody has any answers, i am begging you, please help me. if i can't fix this then i have wasted $40., so please, help me!
-
Safari is giving me a plugin error message (Copy of text included) HELP!!
I recently downloaded the OS X 10.4.7. Now, Safari won't play video content from webpages. Usually there's a window and you click "PLAY" and the video starts playing within that window, but now I'm getting this error message. "Some content on this page requires an Internet plug-in that Safari doesn’t support. The application “Windows Media Player” may be able to display this content. Would you like to try?" ANY IDEAS. PLEASE HELP!
I recently downloaded the OS X 10.4.7. Now, Safari won't play video content from webpages. Usually there's a window and you click "PLAY" and the video starts playing within that window, but now I'm getting this error message. "Some content on this page requires an Internet plug-in that Safari doesn’t support. The application “Windows Media Player” may be able to display this content. Would you like to try?" ANY IDEAS. PLEASE HELP!
-
Help with an error message please!
Can someone help? I keep getting the following error message from a site I browse regularly, Barnes and Noble: The requested URL was rejected. Please consult with your administrator. Your support ID is: 8376054068487236668 I have an IMAC desktop, have tried different browsers, emptying cache, restarting, and going through other links to get there. Nothing has worked thus far.
Could be an issue with the website...has this issue persisted for a few days?
~Lyssa -
Please, I need help installing Ps2: error message: 106
On a friend's PC, during installation of Elements 2, the installation program aborts at about 39% complete with the following error message:
Component MoverData had the following error:
Media Name: Data
Component: TypeSpt\Fonts
File Group: Required Fonts
File: HYSMyeongJoStd-Medium-Acro.otf
Error No: 106 Refer to on-line Help
I am not sure what exactly on-line help is, but the code does not show up by searching the Help file on my system.
Does anyone know what error 106 is and how I can get past that point? Ih tried it several times with the stopping point always the same.
Thanks,
Jonatas Batista
My Email is: [email protected]Adobe has this for the error:
http://kb2.adobe.com/cps/171/tn_17120.html
If you google the 106 error, you also come up with results that indicate a dirty or damaged disc.
You might be able to install it by copying the contents of the disc into a folder on your desktop. Install from this desktop folder. This works with the insert disc 1 error. I'm not sure if it will work for the 106 error but it would be worth a try. -
Please help with custom error messages
Hello,
I am trying to display my own error messages for the <f:validate_required /> validation.
Here is what I tried:
-in my faces config xml file, I have:
<message-resources>
<message-resources-id>myResourceID</message-resources-id>
<message>
<message-id>javax.faces.validator.RequiredValidator.FAILED_MESSSAGE_ID</message-id>
<summary xml:lang="en">No name was entered</summary>
</message>
</message-resources>
-in the jsp page, I have:
<h:input_text id="name" valueRef="person.name" >
<f:validate_required />
</h:input_text>
(below:)
<h:output_errors id="myResourceID" for="name"/>
It is not displaying my custom error message ("no name was entered") but the default error messages.
Please help!!
JujuUnfortunately, the current version of the reference implementation does not pick up replacement messages from <message-resources> elements yet. This will be corrected prior to the next release.
Once that is done, the original proposal will work if one change is made -- all of the standard validators pick up their messages from a standard message resources identifier, so you will need to change to:
<message-resources-id>
javax.faces.context.FACES_API_MESSAGES
</message-resources-id>
instead of your own message resources identifier.
Craig -
Error Message:
"Your photo library is either in use by another application or has become unreadable.
Shut down and restart your computer, and then open iPhoto again. If the problem persists, try rebuilding your photo library. To do this, quit iPhoto, and then reopen it while keeping the Option and Command keys pressed. You can also try restoring your photo library from a backup."
I have performed the instructions above with the exception of the restoration from a backup.(Option/Command no longer yields a menu. Just the error message again). Really hoping there is a fix outside of the restoration since I have neglected to back up for some time.
P.S. I see that this is happening to others....I have another Mac to update to Yosemite and fear the same results.Every time there is an update to anything someone somewhere has an issue. That's why backing up prior to updating is so important.
Download iPhoto Library Manager and use its rebuild function. (In early versions of Library Manager it's the File -> Rebuild command. In later versions it's under the Library menu.)
This will create an entirely new library. It will then copy (or try to) your photos and all the associated metadata and versions to this new Library, and arrange it as close as it can to what you had in the damaged Library. It does this based on information it finds in the iPhoto sharing mechanism - but that means that things not shared won't be there, so no slideshows, books or calendars, for instance - but it should get all your events, albums and keywords, faces and places back.
Because this process creates an entirely new library and leaves your old one untouched, it is non-destructive, and if you're not happy with the results you can simply return to your old one. -
Help on 2 error messages / code request please
Why am I getting this error message about an abstract when I'm not declearing one.
error messages I'm getting below -----------
.\LkList.java:26: Method LinkedList getList() requires a method body. Otherwise declare it as abstract.
public LinkedList getList();
DCalc.java:10: class LkList is an abstract class. It can't be instantiated.
LkList Expression =new LkList(exp);
code below ------------------------------
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.event.*;
import java.util.*;
class JCal extends JFrame implements KeyListener
JLabel answer, expression;
JButton b1, b2, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, b14, b15, b16, b17, b18, b19,
b20, b21, b22, b23, b24, b25, b26, b27;
JMenuBar menuBar;
JMenu menu;
JMenuItem menuItem, menuItem1;
LkList equation;
String exp="";
String ans="";
double memory=0;
public JCal()
{ super("Nicks Swing Calculator");
//------------------------- labels ---------------------------------------------
answer = new JLabel(" 0 "); //Answer Lable
answer.setBounds (20, 20, 220, 30);
answer.setBorder (BorderFactory.createLoweredBevelBorder());
answer.setBackground (Color.pink);
answer.setHorizontalAlignment (SwingConstants.RIGHT);
expression = new JLabel(" 0 "); // Expression Lable
expression.setBounds (20, 55, 220, 30);
expression.setBorder (BorderFactory.createLoweredBevelBorder());
expression.setBackground (Color.white);
//------------------------- menu -------------------------------------------------
menuBar = new JMenuBar();
setJMenuBar (menuBar);
menu = new JMenu ("File");
menuItem = new JMenuItem (" Help", new ImageIcon("help.gif"));
menuItem1 = new JMenuItem (" Splash Page");
menuItem.addActionListener(new ActionListener() // Help menu
{ public void actionPerformed(ActionEvent e)
{ new JHelp();
menuItem1.addActionListener(new ActionListener() // Splash Page
{ public void actionPerformed(ActionEvent e)
{ new JSplash();
//------------------------ buttons ------------------------------------------------
JButton b1 = new JButton (new ImageIcon ("mc.gif")); // MR button
b1.setBounds(20, 100, 55, 50);
JButton b2 = new JButton (new ImageIcon ("mr.gif")); // MC button
b2.setBounds(75, 100, 55, 50);
JButton b3 = new JButton (new ImageIcon ("ms.gif")); // MS button
b3.setBounds(130, 100, 55, 50);
JButton b4 = new JButton (new ImageIcon ("mplus.gif")); // M+ button
b4.setBounds(185, 100, 55, 50);
JButton b5 = new JButton (new ImageIcon ("seven.gif")); // 7 button
b5.setBounds(20, 170, 55, 50);
JButton b6 = new JButton (new ImageIcon ("eight.gif")); // 8 button
b6.setBounds(75, 170, 55, 50);
JButton b7 = new JButton (new ImageIcon ("nine.gif")); // 9 button
b7.setBounds(130, 170, 55, 50);
JButton b8 = new JButton (new ImageIcon ("div.gif")); // divide button
b8.setBounds(185, 170, 55, 50);
JButton b9 = new JButton (new ImageIcon ("four.gif")); // 4 button
b9.setBounds(20, 220, 55, 50);
JButton b10 = new JButton (new ImageIcon ("five.gif")); // 5 button
b10.setBounds(75, 220, 55, 50);
JButton b11 = new JButton (new ImageIcon ("six.gif")); // 6 button
b11.setBounds(130, 220, 55, 50);
JButton b12 = new JButton (new ImageIcon ("times.gif")); // times button
b12.setBounds(185, 220, 55, 50);
JButton b13 = new JButton (new ImageIcon ("one.gif")); // 1 button
b13.setBounds(20, 270, 55, 50);
JButton b14 = new JButton (new ImageIcon ("two.gif")); // 2 button
b14.setBounds(75, 270, 55, 50);
JButton b15 = new JButton (new ImageIcon ("three.gif")); // 3 button
b15.setBounds(130, 270, 55, 50);
JButton b16 = new JButton (new ImageIcon ("minus.gif")); // minus button
b16.setBounds(185, 270, 55, 50);
JButton b17 = new JButton (new ImageIcon ("zero.gif")); // 0 button
b17.setBounds(20, 320, 55, 50);
JButton b18 = new JButton (new ImageIcon ("neg.gif")); // negitive button
b18.setBounds(75, 320, 55, 50);
JButton b19 = new JButton (new ImageIcon ("dot.gif")); // decimal button
b19.setBounds(130, 320, 55, 50);
JButton b20 = new JButton (new ImageIcon ("add.gif")); // addition button
b20.setBounds(185, 320, 55, 50);
JButton b21 = new JButton (new ImageIcon ("left.gif")); // left bracket button
b21.setBounds(20, 375, 110, 35);
JButton b22 = new JButton (new ImageIcon ("right.gif")); // right bracket button
b22.setBounds(130, 375, 110, 35);
JButton b23 = new JButton (new ImageIcon ("equals.gif")); // equals button
b23.setBounds(20, 415, 220, 35);
JButton b24 = new JButton (new ImageIcon ("clear.gif")); // clear button
b24.setBounds(20, 460, 55, 50);
JButton b25 = new JButton (new ImageIcon ("ce.gif")); // ce button
b25.setBounds(75, 460, 55, 50);
JButton b26 = new JButton (new ImageIcon ("sqrt.gif")); // sqrt button
b26.setBounds(130, 460, 55, 50);
JButton b27 = new JButton (new ImageIcon ("percent.gif")); // % button
b27.setBounds(185, 460, 55, 50);
//------------------- adding everything on the pane -------------------
Container contentPane = getContentPane();
contentPane.setLayout(null);
// the default layout is BorderLayout
contentPane.add(b1); // adds buttons
contentPane.add(b2);
contentPane.add(b3);
contentPane.add(b4);
contentPane.add(b5);
contentPane.add(b6);
contentPane.add(b7);
contentPane.add(b8);
contentPane.add(b9);
contentPane.add(b10);
contentPane.add(b11);
contentPane.add(b12);
contentPane.add(b13);
contentPane.add(b14);
contentPane.add(b15);
contentPane.add(b16);
contentPane.add(b17);
contentPane.add(b18);
contentPane.add(b19);
contentPane.add(b20);
contentPane.add(b21);
contentPane.add(b22);
contentPane.add(b23);
contentPane.add(b24);
contentPane.add(b25);
contentPane.add(b26);
contentPane.add(b27);
contentPane.add(answer); // adds answer label
contentPane.add(expression); // adds expression lable
menuBar.add(menu); // adds menu
menu.add(menuItem); // adds menu item "Help"
menu.add(menuItem1); // adds menu item "Splash Page"
//------------ button functions ---------------------------------------
b1.addActionListener(new ActionListener() // MR
{ public void actionPerformed(ActionEvent e)
{ String TempMemory="";
answer.setText(TempMemory.valueOf(memory)); }});
b2.addActionListener(new ActionListener() //Mc
{ public void actionPerformed(ActionEvent e)
{ memory=0; }});
b3.addActionListener(new ActionListener() //M-
{ public void actionPerformed(ActionEvent e)
{ Double DblTemp=new Double(answer.getText());
double dblTemp=DblTemp.doubleValue();
memory=memory-dblTemp; }});
b4.addActionListener(new ActionListener() //M+
{ public void actionPerformed(ActionEvent e)
{ Double DblTemp=new Double(answer.getText());
double dblTemp=DblTemp.doubleValue();
memory=memory+dblTemp; }});
b5.addActionListener(new ActionListener() // Seven
{ public void actionPerformed(ActionEvent e)
{ exp=exp+"7";
expression.setText(exp); }});
b5.addKeyListener(this);
b6.addActionListener(new ActionListener() // Eight
{ public void actionPerformed(ActionEvent e)
{ exp=exp+"8";
expression.setText(exp); }});
b6.addKeyListener(this);
b7.addActionListener(new ActionListener() // Nine
{ public void actionPerformed(ActionEvent e)
{ exp=exp+"9";
expression.setText(exp); }});
b7.addKeyListener(this);
b8.addActionListener(new ActionListener() // Divide
{ public void actionPerformed(ActionEvent e)
{ exp=exp+"/";
expression.setText(exp); }});
b8.addKeyListener(this);
b9.addActionListener(new ActionListener() // Four
{ public void actionPerformed(ActionEvent e)
{ exp=exp+"4";
expression.setText(exp); }});
b9.addKeyListener(this);
b10.addActionListener(new ActionListener() // Five
{ public void actionPerformed(ActionEvent e)
{ exp=exp+"5";
expression.setText(exp); }});
b10.addKeyListener(this);
b11.addActionListener(new ActionListener() // Six
{ public void actionPerformed(ActionEvent e)
{ exp=exp+"6";
expression.setText(exp); }});
b11.addKeyListener(this);
b12.addActionListener(new ActionListener() // Times
{ public void actionPerformed(ActionEvent e)
{ exp=exp+"*";
expression.setText(exp); }});
b12.addKeyListener(this);
b13.addActionListener(new ActionListener() // One
{ public void actionPerformed(ActionEvent e)
{ exp=exp+"1";
expression.setText(exp); }});
b13.addKeyListener(this);
b14.addActionListener(new ActionListener() // Two
{ public void actionPerformed(ActionEvent e)
{ exp=exp+"2";
expression.setText(exp); }});
b14.addKeyListener(this);
b15.addActionListener(new ActionListener() // Three
{ public void actionPerformed(ActionEvent e)
{ exp=exp+"3";
expression.setText(exp); }});
b15.addKeyListener(this);
b16.addActionListener(new ActionListener() // Minus
{ public void actionPerformed(ActionEvent e)
{ exp=exp+"-";
expression.setText(exp); }});
b16.addKeyListener(this);
b17.addActionListener(new ActionListener() // Zero
{ public void actionPerformed(ActionEvent e)
{ exp=exp+"0";
expression.setText(exp); }});
b17.addKeyListener(this);
b18.addActionListener(new ActionListener() // negative
{ public void actionPerformed(ActionEvent e)
{ exp=exp+"-";
expression.setText(exp); }});
b18.addKeyListener(this);
b19.addActionListener(new ActionListener() // Decimal
{ public void actionPerformed(ActionEvent e)
{ exp=exp+".";
expression.setText(exp); }});
b19.addKeyListener(this);
b20.addActionListener(new ActionListener() // Addition
{ public void actionPerformed(ActionEvent e)
{ exp=exp+"+";
expression.setText(exp); }});
b20.addKeyListener(this);
b21.addActionListener(new ActionListener() // Left Bracket
{ public void actionPerformed(ActionEvent e)
{ exp=exp+"(";
expression.setText(exp); }});
b21.addKeyListener(this);
b22.addActionListener(new ActionListener() // Right Bracket
{ public void actionPerformed(ActionEvent e)
{ exp=exp+")";
expression.setText(exp); }});
b22.addKeyListener(this);
b23.addActionListener(new ActionListener() // Equals
{ public void actionPerformed(ActionEvent e)
{ LkList equation = new LkList();
equation.ProcessExpress();
ans=equation.getAns();
answer.setText(ans);
exp="";
ans=""; }});
b23.addKeyListener(this);
b24.addActionListener(new ActionListener() // Clear
{ public void actionPerformed(ActionEvent e)
{ exp="";
ans="";
expression.setText(exp);
answer.setText(ans); }});
b25.addActionListener(new ActionListener() // Clear Entry
{ public void actionPerformed(ActionEvent e)
{ exp="";
ans="";
expression.setText(exp);
answer.setText(ans); }});
addWindowListener( new WindowAdapter()
{ public void windowClosing(WindowEvent e)
{ System.exit(0);
this.setBounds(10, 10, 270, 600);
this.show();
public static void main(String[] args)
{ new JCal();
public void keyReleased(KeyEvent evt){}
public void keyTyped(KeyEvent evt) {}
public void keyPressed(KeyEvent evt)
{ char x=evt.getKeyChar();
switch(x)
{ case '0': exp=exp+"0";
expression.setText(exp);
break;
case '1': exp=exp+"1";
expression.setText(exp);
break;
case '2': exp=exp+"2";
expression.setText(exp);
break;
case '3': exp=exp+"3";
expression.setText(exp);
break;
case '4': exp=exp+"4";
expression.setText(exp);
break;
case '5': exp=exp+"5";
expression.setText(exp);
break;
case '6': exp=exp+"6";
expression.setText(exp);
break;
case '7': exp=exp+"7";
expression.setText(exp);
break;
case '8': exp=exp+"8";
expression.setText(exp);
break;
case '9': exp=exp+"9";
expression.setText(exp);
break;
case '+': exp=exp+"+";
expression.setText(exp);
break;
case '-': exp=exp+"-";
expression.setText(exp);
break;
case '*': exp=exp+"*";
expression.setText(exp);
break;
case '/': exp=exp+"/";
expression.setText(exp);
break;
case '.': exp=exp+".";
expression.setText(exp);
break;
case '(': exp=exp+"(";
expression.setText(exp);
break;
case ')': exp=exp+")";
expression.setText(exp);
break;
default: break;
// ================================= equation =============================
class Equation
{ private double nbr1;
private double nbr2;
private char op;
private double answer;
private String StrNum1="";
private String StrNum2="";
private String StrOper="";
private String StrAns="";
//Constructor
Equation(String number1, String number2, String operator)
{ StrNum1 = number1;
StrNum2 = number2;
StrOper = operator;
convert();
public double getNum1() {return nbr1;}
public double getNum2() {return nbr2;}
public char getOp() {return op;}
private void convert()
{ Double temp=new Double(StrNum1);
nbr1=temp.doubleValue();
temp=new Double(StrNum2);
nbr2=temp.doubleValue();
op=StrOper.charAt(0);
private void convertAnswer()
{ StrAns=StrAns.valueOf(answer);
public String toString()
{ return StrAns;
public void calculate()
{ switch (op)
{ case '+': answer=nbr1+nbr2;
break;
case '-': answer=nbr1-nbr2;
break;
case '*': answer=nbr1*nbr2;
break;
case '/': answer=nbr1/nbr2;
break;
convertAnswer();
// =============================== linked list ================================
class LkList
{ char[] operator = {'+','-','*','/','(',')'}; // operators used
LinkedList Express = new LinkedList(); // Linked list of expression
String StrExp = null;
String oper = ""; // operator
String number1 = ""; // first number used in expression
String number2 = ""; // second number used in expression
String answer = ""; // answer of expression
Exp TempExp; // Temporary expression
String Temp;
// Constructor
LkList (String e)
{ StrExp = e;
formList (); // expression turn into liked list nodes
trimList (); // remove spaces from linked list expression
public String toString()
{ return Express.toString();
public LinkedList getList();
{ return Express;
public String getAns()
{ return Express.get(0).toString();
public void ProcessExpress() // removing brackets
{ removeBrack();
private void formList()
{ int j = 0;
boolean lastOper = true;
for (j = 0 ; j < Express.length(); j++ )
{ if (!(belongTo(operator, StrExp.charAt (j))))
{ Temp = Temp + StrExp.charAt (j);
lastOperator = false;
if (belongTo(operator, StrExp.charAt (j)))
{ if ((StrExp.charAt (j) =='-') && (lastOperator))
{ Temp = "-";
lastoperator = false;
else
{ Express.add (Temp);
Temp = "";
Temp = Temp + StrExp.charAt (j);
Express.add (Temp);
Temp = "";
if (StrExp.charAt (j) == ')')
{ lastOperator = false;
else
{ lastOperator = true;
Express.add (Temp);
Temp = "";
private void trimlist ()
{ int sp = 0;
while ((sp !=-1))
{ sp = Express.indexOf ("");
if (sp !=-1)
{ Express.remove (sp);
private static boolean belongTo (char[] ar, char c)
{ for (int k = 0; k < ar.length; k++)
{ if (c == ar[k]) return true;
return false;
private boolean findBrack ()
{ if (Express.contains (")"))
{ return true;
return false;
private void removePoints (int pt1, int pt2 )
{ int range = (pt2 - pt1);
for (int j = pt2; j >= pt1; j--)
{ Express.remove (j);
private void processOperator (String Oper)
{ int point =-1;
while (Express.contains (Oper))
{ point = Express.indexOf (Oper);
oper = Express.get(point).toString();
number1 = Express.get(point-1).toString();
number2 = Express.get(point+1).toString();
TempExp = new Exp (number1, number2, oper);
TempExp.calculate();
answer = Temp.toString();
Express.add(point-1, point+1);
removePoints (point-1, point+1);
point =-1;
private void removeBrack()
{ int opBrack = 0;
int clBrack = 1;
int j = 0;
String Temp = "";
while (findBrack())
{ clBrack = Express.indexOf (")");
j = clBrack;
do
{ Temp = Express.get(j).toString();
if (Temp.charAT(0) =='(')
{ opBrack = j;
j--;
while (opBrack < 0);
number1 = Express.get(opBrack +1).toString();
number2 = Express.get(clBrack -1).toString();
oper = Express.get(opBrack+2).toString();
TempExp = new Exp (number1, number2, oper)
TempExp.calculate();
answer = TempExp.toString();
Express.add(clBrack+1, answer);
removePoints(opBrack, clBrack);
opBrack=-1;
clBrack=0;
private void removeDivide()
{ processOperator("/");
remMult();
private void removeTimes()
{ processOperator("*");
remAdd();
private void removeAdd()
{ processOperator("+");
remSub();
private void removeSub()
{ processOperator("-");
// ================================= help menu ============================
class JHelp extends JFrame
{ JTextArea textarea;
public JHelp()
{ super ("Help");
Container contentPane = getContentPane();
/* JPanel textPan1 = new JPanel (new BorderLayout());
textarea = new JTextArea ("How to use Nicks Calculator");
textarea.setWrapStyleWord(false);
JScrollPane textAreaPane1 = new JScrollPane (textarea);
textPan1.add (textarea, BorderLayout.CENTER);
contentPane.add(textPan1);
textarea.setEnabled(false); */
JLabel lab=new JLabel(new ImageIcon("helpmenu.jpg"));
contentPane.add(lab, BorderLayout.CENTER);
setBounds(400,200,400,400);
this.show();
// ================================ Splash Page =============================
class JSplash extends JFrame
{ public JSplash()
{ super ("Splash Page");
Container contentPane=getContentPane();
JLabel lab=new JLabel(new ImageIcon("nick.jpg"));
contentPane.add(lab, BorderLayout.CENTER);
setBounds(400,200,250,320);
this.show();Spot the difference:
public LinkedList getList();
public LinkedList getList()
Notice the semi-colon. Thats the problem
Maybe you are looking for
-
Playlists no longer work with my Alpine CDA-9887 Car stereo
I updated to 2.2 and all of a sudden when i search for playlists on my stereo, the search button on the head unit doesn't do anything. It is not the head unit because i tried it with other other ipods just to make sure and it worked perfectly. I neve
-
Bluetooth adapter missing from Lenovo L440
Hi, My bluettoth adapter went missing one day suddely. I checked in network connection and device manager but its not showing up anywhere. Went to lenovo website and installed drivers but still nothing is happening
-
Implementation of OSS Note-304290
Hi, This is Kiran Kumar. We have an issue with the US tax classification. Issue is Tax classification is not passing to the subsequent documents like Invoice to Debit Memo Request /Credit Memo Request. Hence Tax values are becoming zero. ususally XR1
-
How many tables are in my database
I wanted to check how many tables I have so I ran the following query to list all of the tables in all of the tablespaces. select t.table_name, df_name from dba_tables t, v$tablespace df where t.tablespace_name = df.name; I got back 34377 tables or r
-
Third-party plug-in for camera support?
Hi. My Sony F707 is not on the list of digital cameras supported by OS X ... I'm on a brand-new MacBookPro, and I also have a PowerBook G4. The G4 used to work with the Sony, but I upgraded to Tiger a few months ago, and I guess I hadn't tried it sin