Vasco Carmona

Greenhorn
+ Follow
since Sep 02, 2009
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Vasco Carmona

Hello Ranchers,

I have a question about static methods in multithreading environment.

With the code below, I expected to lose the reference of "ints" with each thread initialization, since the method is static.

I thought all thread would end up with the "ints" reference of the last thread that would be initialized.



Can anyone explain why is this happening?

Thanks all in advance
10 years ago
What I need is an object that "is-a" JLabel with additional properties.
Since I can only extend from one class, I extend from JLabel and implement the mouse listeners to make my own mouse adapter.
13 years ago
Hello Henry,

thanks for the reply.

I'm building an application that adds labels with images and/or text to a panel at runtime, drags them to wherever we want and change some properties.

For now I just need to insert labels but I'm thinking ahead and trying to do a "universal" inserter for all JComponent subclasses, and all of them to be "dragable" and "changeable". For that I made an interface that as a method called getElement() that return a generic subclass of JComponent.
I could extend the mouse listeners on this interface but I don't want to be able to access directly the mouse listeners methods through objects that implements that interface.
Thus, I wanted to make an abstract class that could extends any subclass of JComponent and make some kind of MouseAdapter, and those that extended this abstract class would override the methods that were needed.

Since it's not possible, I'll make a class that extends JLabel, or any other subclass of JComponent, that implements all those interfaces.

thanks again for the reply.
13 years ago
Hello,

I tried to find this information but I didn't found it.

I would like to make an abstract class called ComponentMouseAdapter that extends any subclass of javax.swing.JComponent and implements all mouse listeners.

Is it possible to have generic inheritance?

I thought that the code would be something like this:


thanks in advance to all replies.
13 years ago
Hi,
I found the solution!!



on the method declaration.

the compiler error says that there are expected identifiers.

I've just started to study generics and I don't get the problem.
Hello,

I'm trying to code an interface with a method that returns a subtype of a JComponent. Depending which class I implement this interface, I want it to return a JPanel, a JLabel or any other subclass of JComponent.



I thought in generics to solve my problem and I try the code above, but it won't work. I would like to know why and a possible solution.

With my best regards

Vasco Carmona
Hi Galway,

The objectives on the exam are the same.

You can see them in this page:Java Standard Edition 5 and 6, Certified Associate Exam

I also have those books and I'm studying by them.

Good Luck!
13 years ago
Hi James, thanks for the reply!

I wanted to go for the SCJA initially but I was convinced to focus on the SCJP instead...


Which reasons made you give up the SCJA and just take the SJCP?
13 years ago
Hi,

I believe that this problem lies on variable scoping. In other words, the second method can't "see" playArray. Unfortunately I can't tell where exactly is the problem, because the sample from your code don't show it.

Try to find where playArray "vanishes", make it "visible"(change scope) and I believe that your problem is solved.

14 years ago
Thanks for the reply. About being confortable with Java, I already have 8 years of Java study. I've made dozens of projects with up to 20 or 30 classes, mainly has an evaluation component, others just for the fun of discovering how could it be done with Java. Every year I help the freshmen on their programming projects, not doing for them but explaining how should they do it and why. I have some teaching experience but I'm not being paid for doing it. ;) By the way I also have Certificate of Pedagogical Aptitude where I learned techniques on how learning could be facilitated.
Maybe I haven't explain myself in the best way (my written english it's a "little bit" rusty), but I intend to have ALL Java related certifications. Although your excelent observation about how could I address more properly the questions of my possible pupils, I just thought to begin at the beginning (what a news...) and climb may way up.
I will take your suggestions in consideration and thanks again for the reply.
14 years ago
Hi everyone,

I'm (finally) about to graduate in Electronics and Computer Engineering and since I started my major I've been in contact with Java. I use Java for anything and everything, from a simple iteration to a Ethernet communication with a microcontroller.
Apparently I'm not that bad because I've a teacher that, a few weeks ago, talked to me about the opportunity to become myself a teacher at my school. To me this opportunity it's the cherry on top of the cake.
So, to become a better teacher that some that I have, I decided to follow the Java certification path. I've already read the McKenzie's SCJA certification guide and I'm reading SCJA study guide from Robert Liguori. In parallel I'm reading HF Java and I've already bought all SCJP recommend books.
If I ever start teaching , I probably start in September and so my question is, until September which certification should I take, SCJA or SCJP?

Thanks in advance for reading my post and I hope to hear from you soon.

My best wishes, Vasco Carmona
14 years ago