Win a copy of Classic Computer Science Problems in Swift this week in the iOS forum!

Dennis Korbar

Greenhorn
+ Follow
since Jan 14, 2009
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 Dennis Korbar

Thanks, I'll have a look at that!

I'm currently reading about the JDI API which might work for this too.
7 years ago
Hello,

I am currently planning to implement a framework or an application to monitor Swing applications.
What I want that application to do, is basically log display information (size, position, visibility etc) about all JComponent classes, like JPanel, JButton etc.
I need this information to provide area's of interest for eye tracker based evaluations.
It would be really nice to do this in a way so that I don't have to modify the applications which are to be evaluated.
So, is there some (easy) way to access this data on running Java applications?

Cheers
Dennis
7 years ago
Hm ok, so I should definetly avoid calling overrideable methods in the constructor? But wouldn't that apply for every other method too?

What if I have something like the following:

so if the subclass' author decides to override the second doSomething, I'll have a similar problem if someone calls the first doSomething.
So by design, the second doSomething actually needs to be final in order to avoid unpredictable behaviour? (Method overloading is probably a bad example for this, but the first that came to mind, it could be any other method call too.)

Don't get me wrong, I'm in no way trying to criticize or so, I'm merely trying to understand how to write cleaner and more sustainable code.

Cheers,
Dennis
9 years ago
Gosh, this has become quite a discussion.
Thanks for all the input, I really appreciate that.

I have to agree that performance shouldn't be much of a problem. However, as stated before, I wasn't at all aware of the problem with subclasses overriding my setters, so I have put a bit more thought into that, couldn't I do the following to prevent the problem? (Yes, this might be a bit overkill but it should take care of the overriding problem, right?)

And in answer to some of the comments, I'm totally aware that this doesn't make a lot of sense on a one line getter or setter, but the thing is that I don't know if it will still be a one line getter or setter in a year or in two years. And If I have used the getters and setters in the constructor, it'll be one line less to worry about when changing the setter or getter (or the variables restrictions).

Cheers,
Dennis
9 years ago

Jeanne Boyarsky wrote:

Rusty Shackleford wrote: Method calls are relatively expensive.


Dennis: I think this more of a design preference. The static analysis tool I use frowns on calling public non-final setters from a constructor. The reason being that a subclass could change the behavior on you. This i agree with.



Yeah, that's probably a good point
9 years ago
Hello,

I got a question about getters and setters, I'm wondering for some time now, about the best approach of setting/getting private or protected fields in the class' code to which those fields belong. (in the constructor for example)
I used to go about this by just using the fields directly like this:

But lately I've been using the getters and setters inside of the class' code like this:


In the given example this won't make any difference. But I thought it might be better to use the getters and setters in case that there'll be some restrictions in setters or some modifications done in getters, so these modifications or restrictions (or whatever will be going on in the setters and getters ;)) will be centralized.
I would like to hear the opinion of you guys about this, how do you set or get values of variables inside of the class that you are currently developing, does my second approach make any sense? Is it good or bad practice?

Thanks in advance for your input!
Dennis
9 years ago
Hehe, fitting title
Synth is working fine so far, I just don't want to go through all the trouble of declaring styles for each and every component while I just want to change some buttons
I'll have a look at overriding the painting methods, maybe it is less complicated than I think...

I'm also really missing a good reference on synth, I got to define styles for the JProgressBar for example, and I don't have any idea how to do that...

Thanks for the info!


Dennis
9 years ago
Hello,

is there any way to use synth just for certain components so that it doesn't blank out every component that isn't specified in the xml file?
And if there isn't, is there another way of creating JButtons that use images depending on their current state (pressed or released)?
Furthermore, are there any good synth articles / online resources? I read through the articles provided by SUN, but those only scratch the surface and I haven't been able to find any detailed tutorials or guides.

I'm not really sure if I'm approaching my problem the right way, I got a graphical Swing UI and a Design for it as an image, and I have to implement the design into the Swing gui. Is there something like a best practice way of doing something like this?

Any help appreciated!

Cheers
Dennis

Edit: I should probably add that I have to do this in Java 1.5!
9 years ago
I'll try, thanks for the tip.
9 years ago
Hey,

sorry for the late reply! Thanks for all the information, I'll have to read a bit into this, it seems that it is more complicated then I thought. ;-)

Greetings
Dennis
9 years ago
Hey,

I was wondering if there was a folder in Bea 9.2 equal to the ".wlnotdelete" in 8.1? So that I can change minor things directly in the jsp files to test stuff?

Greetings
Dennis
9 years ago
Hello,

I recently started to learn a bit about webservices (axis2), so far it has been working fine, for new projects that is...
I was wondering how I should implement a webservice in a large j2ee application that has already been running for quite some time.
What is a clean way to get access to the projects infrastructure (DAOs etc) from the webservice?

Dennis
9 years ago
Shadowed eh? There were quite a lot of translations for "verdeckt" on http://dict.leo.org but shadowed was not amongst them :-)
Thanks for the information!
9 years ago
The "this" reference is a reference to the current object, if you use the "this" reference inside of a method or a constructor it will point to the actual object that was used to invoke this method.



It can be used to access member fields in case they are hidden/concealed (not sure what the actual English term for it is...) by local fields.
You can also use it to pass a reference to the current object to a method.

You could also have a look at the following url: http://java.sun.com/docs/books/tutorial/java/javaOO/thiskey.html

9 years ago
eeek, it was the only quick way I could think up for doing what was requested... sorry about that, just wanted to help, didn't say that it was the appropriate way to do things...
9 years ago