Solved

Reading .class files, dynamically

Posted on 2006-11-12
3
167 Views
Last Modified: 2010-03-31
I'm trying to write a program that could read plugins, basically the program itself is just a GUI and all the work is done by other class files, the thing is I want the program to read every .class in a folder(or the same folder as the root, doesn't matter) dynamically, like for example I write a new class file, all I have to put it in there and the program will recognize it and use its methods.(to make things easier, all the method names are similar in every class file)

To make it more clear, I'll give you an overview of the program I'm writing, it basically has a combobox that has a list of all the class files in the folder, when I pick one of them it should use a method inside that certain class file that returns a panel which has some sort of an interface where I could do some operations, I'm going to keep adding new kinds of operations with time(which have different input, therefore different interface), but I don't want to edit the main file everytime I do so.

Thanks for your help in advance
0
Comment
Question by:za3moot
  • 2
3 Comments
 
LVL 86

Accepted Solution

by:
CEHJ earned 125 total points
ID: 17925069
0
 

Author Comment

by:za3moot
ID: 17925451
Thanks a lot mate, I just deleted the huge code I wrote earlier today and replaced it with 10 lines of code :)
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 17926543
:-)
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
servlet example issue 6 39
servlet example 17 32
jsp login check 12 32
ejb on wildfly 5 20
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question