Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Closed 8 years ago.
Improve this question
Can any one please tell me how to use logcat? for example I get the error:
Null point exception at activity thread Java.2121. what does 2121 here refer to? Is it some line of code? How do I access it?
It is not certain that the first line of the logcat itself shows the exact error. If you want to get the error from logcat in simplest way then try to find out your package name in that means for an example if your package name is com.test.firstapp then check for this in logcat...after that check for the statement it have then definitely you'll get the idea from that....Hope this'll help you :)
Do not rely on the first line of the exception. Sometimes it happens from the middle when it started calling it. Check the last call to your activity class. That is the root of your problem.
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
it's the error I'm not good at programming but I try to learn. I am learning how to use javaFx. In this case I want to implement 4 operations: add, subtract, multiply and divide. When I was using only one it worked for me I am new to the Starck overflow community. I always check when I have doubts. But I did not find a solution to my problem. It would be very helpful if you support me.
If you like me to share the folder. They explain to me how it would be very helpful.
Also my english's not good but i'm learning to
See this post on InvocationTargetException
See the Oracle Documentation on RuntimeException
See this post on javafx.fxml.LoadException
**As noted in the comments, the stack trace, in your case the red error text, tells you one of the problems: ** "Error resolving onAction = '$handleResta', either the event handler is not in the Namespace or there is an error in the script".
The comments are also asking for the file which contains the error, in order to help you more fully; We've identified that onAction = '#handleResta' is a problem problem, but we can't tell what about #handleResta is creating the error until you post this file:
/C:Users/Usuario/Downloads/Proy/build/classes/mvvm/FXMLVista.fxml:14
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 5 years ago.
Improve this question
Code fragment
I followed a video series of Derek Banas about java threads but applying the same code on my compiler it gave me an error. I dont know why.please help me out.
Another code fragment
note: I have already defined "getTheMail" with an integer.
This is not a threading issue. You should instantiate GetTheMail class without giving any constructor parameters since it is not expecting any.. like this : new GetTheMail(); I encourage you to read this article for further understanding : https://www.javaworld.com/article/2076204/core-java/understanding-constructors.html
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 5 years ago.
Improve this question
I'm writing a java program in Eclipse, and when I try to use recursion it gives this error:
Exception in thread "main" java.lang.StackOverflowError
I know that people have probably already asked this question, but every response I've found has been to remove recursion. For what I'm trying to do, recursion is a necessity. There's no other option. I know that the recursive limit can be modified in Enthought Canopy (for python) like this:
import sys
sys.setrecursionlimit(10000)
Is there a way to do this for java in Eclipse? Again, removing recursion is not an option.
UPDATE: I figured out the problem (which was an infinite loop), and the code works now.
Take a look at this: What is the maximum depth of the java call stack?
While it is not exactly a duplicate, it also answers your question by explaining how the limit can be changed.
Note that Eclipse itself has nothing to do with the limit, it is a Java restriction and can be increased by allocating more space to it.
As always with such questions one should note that your code is likely to be inefficient, wrong or maybe has a non-recursive alternative. However you said that you are not interested in such solutions, so I just leave it here as a side note.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 8 years ago.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Improve this question
I am trying to develop a small pizza ordering app. I have 3 classes so far and the purpose of them right now is to display 3 menus with the menu items accessible.
Previously I had only one class and that worked just fine however issues started occurring when I split the program to use several classes.
Main.java:
http://pastebin.com/bZJ7Pgdt
MakeFileMenu.java:
http://pastebin.com/wv2Smm6E
MakeFrame.java:
http://pastebin.com/J7DV294P
The errors I am getting are:
Exception in thread "main" java.lang.NullPointerException
at main.MakeFileMenu.MakeMenu(MakeFileMenu.java:24)
at main.Main.start(Main.java:26)
at main.Main.main(Main.java:16)
Furthermore in the Makeframe.java file lines 37, 42, 49 and 57 should be uncommented. I commented them out as they were giving me errors so I thought I will at least try to get the menus to appear.
Anything you guys see out of the ordinary? I double checked the code I can't seem to figure out what could be wrong with it.
Thanks for your help!
The problem is in line:
frame.frame.setJMenuBar(menuBar);
this is because variable frame in frame (frame.frame) is not initialized. You have to initialize it before using.
You either forgot to call makeFrame on frame in MakeFileMenu or you should rename makeFrame to MakeFrame to make it a constructor.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
Is it possible to importing a java source code into Jlst? Please tell me how, and ll appreciate an example if possible. Thanks
I'm not I understand what you're trying to do, but can't you load your source file into a collection line-by-line (using BufferedReader.readLine() around a FileReader), and then create the appropriate ListModel ?
I suspect a TextArea may be more appropriate for code, though.
I don't think you want to import it into JList. Text is better presented in JTextArea or JEditorPane. Here is where you can read more about it
http://java.sun.com/docs/books/tutorial/uiswing/components/textarea.html
http://java.sun.com/docs/books/tutorial/uiswing/components/editorpane.html