|
|
Hi, I'm searching for an application (or plugin at Eclipse / Netbeans) where I can analyze the structure of a class. It is important that I can see the package dependencies. Plugins I tried just give me an overview 1:1 or 1:n beetween the classes, but no information about the package dependence at a class.
A sample:
Class A
{
JButton btn;
void test()
{
btn = new JButton(myicon, „hello world");
String text = btn.getText();
btn.setText();
ArrayList<String> obj = new ArrayList<String>();
obj.add(„first");
obj.add(text);
}
void myfunc()
{
System.out.println(„test");
}
}
What I need here:
All foreign classes, functions, or constants (means all that are not defined at A) which are used through class A, are shown in a list.
myfunc() is not necessaray to show because it is definied at A - but it is doesn't matter if it is shown - that's okay.
It is not necessary that this tool (or plugin) shows it over a GUI.
Class ; Function ;
javax.swing.JButton ; init<icon, string=""> // Constructor
javax.swing.JButton ; getText() ;
javax.swing.JButton ; setText(String) ;
java.util.ArrayList ; init<>
java.util.ArrayList ; add(Object) ;
System.out ; println(String);
NOTE: I need no reverse engineering of a JAR file - I like to analyze my own java source files.
Thank you in advance!
|
|
|
|
|
|
Hager.Harald wrote: NOTE: I need no reverse engineering of a JAR file - I like to analyze my own java source files.
That is conceptually impossible.
Things like IDEs use an incremental compiler to validate the edit window as you type, so to that it can resolve, if possible, dependencies. The process might not create the final binary but it does involve a substantial amount of the same processing to get to the point where it can resolve such things.
Keeping in mind of course that the incremental compiler must also have a context to resolve dependencies, so java API libraries and other libraries that might be used.
Also keep in mind your example is simplistic and more significant applications will often use dependencies that cannot be resolved until the application runs.
|
|
|
|
|
Thank you for your answer (especially for your description how it works). This will help me to find an appropiate tool for my aims.
2017-10-18 Update: JArchitect has complied what I needed (but it is commercial)
modified 18-Oct-17 5:53am.
|
|
|
|
|
import java.util.*;
class One
{
static String city;
public static void main(String args[])
{
city=args[0];
Two t= new Two();
}
}
class Two extends One
{
if(city=="Banglore")
Two()
{
System.out.println("Hello BANGLORE");
}
}
|
|
|
|
|
Good job the error is blindingly-obvious, since you didn't bother to tell us what error you're getting!
Member 13451299 wrote:
class Two extends One
{
if(city=="Banglore")
You can't put an if statement directly inside a class. It has to be in a method.
The Java™ Tutorials[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
import java.util.*;
class One
{
public static String city;
public static void main(String args[])
{
city=args[0];
Two t= new Two();
}
}
class Two extends One
{
public Two()
{
if(city=="Banglore")
System.out.println("Hello BANGLORE");
}
}
|
|
|
|
|
what is the advantage of declaring each variable in separate line?
Zaki
|
|
|
|
|
|
I have been coding java for a few months and have a good understanding of it. I just have a few questions on certain things I wanna do.
I need help understanding the A* algorithm and how to code it. I'm trying to code mobs with AI that follow the player around.
I need to know how to implement sounds via the source code.
If it is necessary to know this, know that I am using Eclipse to code and Processing for graphics and stuff like that.
Any help will be greatly appreciated!
|
|
|
|
|
You need to use Google to find information about different algorithms, as they are not specific to Java. And for specific Java questions Google should also lead you to the documentation pages, such as Trail: Sound (The Java™ Tutorials)[^].
|
|
|
|
|
Gametron13 wrote: I need help understanding the A* algorithm and how to code it
Following provides examples in google
A* algorithm java
Just as a suggestion if you have never programmed before then doing what you are doing is is going to be rather ambitious. So you should expect that it will be difficult. Focusing on one part and making it as simple as possible, with the goal of making it better in the future might be more rewarding especially if the goal it to learn how to program.
|
|
|
|
|
HashMap Internal working. and which scenario use in java tech.
|
|
|
|
|
Member 13437687 wrote: HashMap Internal working
Yes it is working.
Member 13437687 wrote: and which scenario use in java tech.
The one that requires a hash. Find the problem first then the solution. Not the other way around.
Or conversely google for when to use it.
|
|
|
|
|
|
For example:
Enter the user input : 25
The number 25 should be encircled by some shapes. This is what I am looking for. Thanks in Advance
|
|
|
|
|
1. Decide which shapes to use
2. Write some UI code to display the shapes
3. Decide how a 'number' gets mapped to a shape.
4. Write some UI code that accepts number
5. Build a app that encapsulates the above and hooks it together.
|
|
|
|
|
after logout in servlet how to prevent browser back button to stop loading previously visted page
|
|
|
|
|
Rather certain as asked you cannot.
However what can happen is that the server, not the browser, can refuse to serve up any data (whatever that might be) after logout occurs. Should however already be doing that. If it is not then that is a problem with the server not the browser code.
|
|
|
|
|
I have a wav file that is supposed to play a sound when my image is clicked. The image only plays the sound when clicked if the wav file is within its while loop. But if the wav is within the while loop, my class runs out of memory... Has anyone ever had this problem? I would include the snippet of it but it would be useless without the program as a whole (138 lines) which is against discussion rules. I am also a new programmer.
|
|
|
|
|
Quote: my class runs out of memory. That is the first issue you need to correct.
|
|
|
|
|
You have a reference to one or more data structures when you load and play the wave file. Those take memory, both for the structures and the content of the wave file.
Each time this happens in your while loop you create those.
They never go away.
So you run out of memory.
You need to modify your code so it loads the wav file once and only once.
|
|
|
|
|
Hello India 123
Demo India
|
|
|
|
|
So being nice I will presume that either this was just a test message or it was not understand how to ask a question.
If the first then probably should delete.
If the second then a question should asked with details about it.
|
|
|
|