15,902,938 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by AllainLG (Top 7 by date)
AllainLG
11-Nov-12 6:26am
View
If the file contains "extends":
<pre lang="java">error: cannot find symbol
public class RefactorMuveletek extends MasikOsztaly{</pre>
If the input's class is connected to another class:
<pre lang="java">
Exception in thread "main" java.lang.ClassNotFoundException: csomag.eolvasottOsztalyNev
errorCode:1
Exception while removing reference: java.lang.InterruptedException
java.lang.InterruptedException
</pre>
AllainLG
7-Nov-12 12:30pm
View
I see, thank you.
Does someone have a code for this?
AllainLG
7-Nov-12 12:29pm
View
What about javax.tools.JavaCompiler? Is it useful to me?
AllainLG
6-Nov-12 18:05pm
View
My program would work like this: the user chooses a file (text or java) and I'd like to get how many loops it have, and list them on my jList.
I want to change for example a for loop to a while, so it will work the same way.
Of course evereything in java language.
AllainLG
6-Nov-12 15:40pm
View
You are right, but the names are not in english, it would be difficult to understand.
I thing only these codes matters:
public class MyProgram {
public static void fileReading() {
lista = new ArrayList < String > ();
try {
inp = new LineNumberReader(new BufferedReader(new InputStreamReader(new FileInputStream(inFileNev), "ISO8859-1")));
String sor;
while ((sor = inp.readLine()) != null) {
lista.add(sor);
lista.add(System.getProperty("line.separator"));
}
inp.close();
} catch...
public static void beolv_osztaly_metodusok() {
try {
Class c= Class.forName("ClassName");
Method[] metodusok = c.getDeclaredMethods();
......
The rest is irrelevant, since the problem is this: I can't get the input file's class, without this I can't get the methods from it.
It works if the ClassName is my program's name.
AllainLG
6-Nov-12 9:32am
View
Thank you, but if I copy these methods to my main class, then only change the "new MyTest().doit();" to "new MyProgram().doit();"
it will list only the methods I copied, and none of my original class, it doesn't recognize any of them.
And still don't know how to get the input file's class name.
AllainLG
6-Nov-12 6:23am
View
So my program would work like this: it starts, the user chooses a file (txt or java), when this happens the program gets the file's text into an Arraylist, and list's the file's methods and fields on a JList and displays them.
But the inputfile.getClass() won't work, since it's not an object, and I don't know how to get the input file's class, if I don't know the class name before the program starts.
Thank you for helping me.
Show More