Win a copy of Spring Boot in Practice this week in the Spring forum!

alexander Petrovich

Greenhorn
+ Follow
since Jul 31, 2000
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 alexander Petrovich

I found good place on the net, where you find real Java examples grouped by Java APIs.
Just choose Java technology, package and class and you get all examples for that class. I use it often, when I am programming, when I need working example .
here is http://javafaq.nu/java-example.html

Before I found a lot of sites with source code from different Java projects. Java classes there often very complicated and those highligted examples are really useless,
but here all examples are short and really illustrate a matter what I am looking for.
--
alex
16 years ago
I would like to add smth. more to the last message.
"Heavyweight" means that component is not written in pure java and uses native to current OS code. Swing generally consist of "lightweight" components, written in Java only.
But still extends AWT adn container classes, for example JFrame has a native code. and Applet class also..
It is not good practice to mix different components in one application. For example labels can be sometime visible on many tabs instead of one and so on...
alex from javafaq.nu
daily tips and advices
21 years ago
please have a look at the message Sept 13, here in the same thread:
"Books Names Required!!" http://www.javaranch.com/ubb/Forum2/HTML/000296.html
alex
21 years ago
or if you know the name of file do it directly:!!!
setIconImage(Toolkit.getDefaultToolkit().getImage("image.gif"));
alex from http://javafaq.nu
21 years ago

Originally posted by alexander Petrovich:
also many free on-line books at http://javafaq.nu/java/index.shtml
and two of them directly on the site
alex


now really four free books: I added "Swing" ~800 pages and
"Introduction to Programming Using Java". The book and example code are downloadable.
alex
21 years ago
Hi!
I hope it isn't spam, just answer to question.
The huge (~800 pages) "Swing" book of Matthew Robinson and Pavel Vorbiev is
online now on my site and u can also download it to read at home. All examples to this book also included.

alex from http://javafaq.nu/java
Java daily tips, free code, books, links
21 years ago

In API for java.lang.Class is written:
"There is no public constructor for the class Class. Class objects are constructed automatically by the Java Virtual Machine as classes are loaded and by calls to the defineClass method in the class loader.
The following example uses a Class object to print the Class name of an object:

void printClassName(Object obj) {
System.out.println("The class of " + obj +
" is " + obj.getClass().getName());
}
"
that is a reason why you have this error(no constructor) Try another way..
alex from http://javafaq.nu
21 years ago
I have just three links for searching of job on my site but one of them helped to my friend and he is working together with me at Ericsson... IP network programming. He found it over Bakos. They helped him to correct and improve his resume (he is Russian and doesn't write in English perfectly...) for free!
it is here: http://javafaq.nu/java/job-for-java-programmers/index.shtml
alex

------------------
21 years ago
also many free on-line books at http://javafaq.nu/java/index.shtml
and two of them directly on the site
alex
21 years ago
and also don't forget about firewalls!
With sockets it is very difficult to create apllication which will easy work in any network. You need to ask administrator to open some ports to make a connection. But with HTTP it is no problem on most intranets!
alex from http://javafaq.nu/java
Hi!
I described some mechanism for checking of network connection and keeping it alive in reply to Rick in thread "Thread on Socket?" It doesn't cause performance bottleneck and network flood... Absolutelly!
And did you try to socket.setSoTimeout(0). "0" for unlimited connection?
alex from JavaFaq http://www.erudite-center.com/java
Hi Rick!
I was working with this problem more than one year. At my job we were migrating some GSM staff to TCP/IP network. And finally we concluded that the bestest way to monitor the connection is to send "heartbeats" each other. Heartbeat is just 2 bytes message: 1st byte is header ("I am heartbeat") and second any value you agreed in you connection protocol.
Server sends to client, client sends to server. Lets say once per 2-5 minutes.
You should have timeout timer. If heartbeat doesn't in 5 minutes you are writting it and after n times of absence of heartbeats you closes connection (the threshold for quantity of missing heartbeats (3-10)).
This was the bestest way to be sure that servers are working and connection still alive. Because we met situation when server hanging in some state and keeps connection open but doesn't work and client thinks it is Ok. But is not.
Here the values for heartbeat (every 2-5 minutes) and threshhold for missing hearbeats 3-10 are taken from real life.
I hope I described this clear and it will help you (ask if ...)
alex from JavaFaq http://www.erudite-center.com/java