dani abdallah

Greenhorn
+ Follow
since Jul 12, 2010
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by dani abdallah

Martijn Verburg wrote:Hmm, not sure in that case, if you're installing the jar correctly into eclipse then you should be able to run client code against it.



Right, thanks anyway, you have been very helpful.

Regards,

Dani
10 years ago

Martijn Verburg wrote:I'm a bit confused , so you run the ANT script inside eclipse to create the JAR file which now works fine. But when you run the ANT command to execute the tests it fails?

If that's the case then that kind of makes sense if you only have your JAR on the CLASSPATH and don't have the testclasses referenced on the CLASSPATH



I don't run the ant script inside eclipse, I create it from the terminal which creates a jar file for me. However, when testing the jar(as my goal is to allow users to add it to their library) by creating a new project in eclipse and adding my created jar to its library. I'm getting an error and the message "configure build path".

The build is always succesful and creates the .jar file, but I am thinking that maybe the source has not been compiled properly, hence the errors with the .jar file?

I've ran ant in verbose mode and got the results I showed in my previous post, although the build is succesful.

Thanks
10 years ago

Martijn Verburg wrote:What is the full extrapolated path and does it match (with case sensitivity) the path you're expecting?



Thanks Martin, I have managed to solve the exclude problem now, it was something to do with the path.
However unfortunately I still have a problem, as my .jar file is giving strange errors when I created a new project in my IDE and ran some tests.
My suspicion is that there is a problem with the compilation, as when I run ant in verbose mode I get, for example:

[javac] .....java added as ....class doesn't exist.


[javac] .....java added as ....class doesn't exist.

[javac] .....java added as ....class doesn't exist.


Does this mean for sure that it is not compiling correctly, as later down the log I get:

[javac] Files to be compiled:
[javac] ..../.../../*.java
[javac] ..../.../../*.java
[javac] / ..../.../../*.java


This is particularly confusing as it's my first experience of using ANT

Thanks again,

Dani
10 years ago

Martijn Verburg wrote:you're almost there! Run ant with the debug flag and you should see it extrapolate your exclude path....




I have run ant with the debug flag, but still can't understand why, I am sure that the exclude path is the right path

Can you see anything I am missing ?

Dani
10 years ago

David Newton wrote:If you have different *packaging* requirements, that would be best handled during the packaging part of things.



Right, I see, so then I will have to use the exclude attribute while creating the jar file. Can you spot any obvious mistake with how I am using the exclude attribute in the code above?

regards,

Dani
10 years ago

Martijn Verburg wrote:Close! Take a look at the ANT documentation on how to perform exclude and include filesets



Thanks I have looked, and what I have come up with is this :

<target name="compile2">
<javac destdir="${root}/build" source="1.5" >
<src path="${src}"/>
<exclude name="${src}/Package/test.java"/>
<classpath refid="lib"/>
</javac>
</target>

but it is still not working (I gather from the fact that still the same number of files are being compiles)

To explain what I am trying to do, I want to create a jar file with only a subset of all the classes, not the whole source, I was thinking that I would compile just part of the source and then create the jar. In retrospect, I am thinking that another possibility would be to compile the source and then only include some of it in the jar.

What would your advice be? Also can you spot anything wrong with the code above?

Thanks a lot

Dani
10 years ago

David Newton wrote:(I assume you're asking a question about Ant, and not something else?)



Yes my question was about ant, thank you for the response. Do you mind giving me a quick example one how I would exclude the file test.java file for example?

Right now to compile the source I would do, for example:

<javac srcdir="${src}" destdir="${build}"/>


how would I use the excludes attribute, does this make sense:

<javac srcdir="${src}" destdir="${build}"
excludes=""${src}/test.java"/>

Regardsm

Dani
10 years ago
Hi guys,

The src attribute specifies where the source code is but i do not want to compile the whole source, just individual .java files. I can't find the attribute to do this, anyone knows?

regards,

Dani
10 years ago

Michael Dunn wrote:for an applet the icons need to be read via a URL

find some applet sample code that uses getCodeBase() to understand



Thanks, I see the problem, appreciate your assistance.

Regards,

Dani
10 years ago

Michael Dunn wrote:> ... Applet... the icons are not visible.

google

getCodeBase()



Thank you for your assistant. However I am still confused on how to use this. Are you assuming I need a reference to the icon so that I can use it directly in the applet?

If so, that is not the case(sorry i didn't explain everything so clearly at first) I am creating an instance of the JTreeComponent class that extends JPanel in MAIN class that also extends JPanel and that includes instances of all the other components I have created. This mainGUI is presented in an applet. When I run the JTreeComponent class separately I see the JTree with icons etc as i should, however when I run my applet (which creates a mainGUI instance) I cannot see the icon.

Apologies for the confusion, or maybe I am still missing something?

Regards,

Dani
10 years ago
Dear friends,

I have a created a JTree where every node has an icon. One class is that extends JPanel is being used for the tree, and everything works fine and the icons show correctly. However, when I create an instance of that class and add it to my Applet(which contains several other components), the icons are not visible.

Anyone has any idea why?

Any suggestions will be appreciated.

Regards,

Dani
10 years ago

Rob Prime wrote:Why can't you just add a String? What does a JLabel offer that a String doesn't?

Anyway, if you would have used our search with just keywords "jtable" and "jlabel" you would have found this thread which again leads to this thread.



I wanted to have a background image in each cell, which is what a label offers me that a cell doesn't. I can also customize the data I have in each cell in better ways with positioning etc.

Anyway, I have kind of found a solution now by rendering HTML inside each cell.

Regards,

Dani
10 years ago
Hi guys,

I am trying to enter a JLabel to each cell in a JTable. Right now when I enter a JLabel in 1 of the cells it returns a string


I have started my modifying my table model as follows:



I am aware I also need to write a cell renderer class for this by that no idea how to do this. I have read about cell renderers and managed to customize my cells but not sure what I should do to return a JLabel. Can anyone explain in detail as I have tried a lot without success.

Thank you for reading my post, and I appreciate your help.

Regards,

Dani

10 years ago