Detect if current piece of code is called by own classes: [code lang=”java”] /** * @return True if current execution points originates from own classes */ public static boolean isOwn() { StackTraceElement[] stack = Thread.currentThread().getStackTrace(); int len = stack.length; for (int i = 2; i < len; i++) { if (stack[i].getClassName().startsWith("org.kari.")) { return true; }...
Read morePDF rendering in java
Rather interesting news. If java gets built-in PDF rendering support, it opens gateway for various new tricks. Java PDF Renderer
Read moreCalculating JTextComponent -height
Problem: Let’s assume that we know the available width and we should determine what is the required height for JTextComponent within that limitation. This problem arises immediately, at least in three cases in java: Variable row height table cells Tooltip size Message dialog size In all of these cases, it is necessary sometimes to know…
Read moreEclipse 3.3 is crappy slow
After all it turns out that crap factor has overcome over the usability factor. Basically Eclipse 3.3 contains some improvements to speed things up. However, in reality it’s just slower then 3.2.x. Reason for this strangeness is the fact that Eclipse 3.2, made big speed improvement by starting to use jar packaged plugins. This reduced…
Read moreThreading in Java
Quite good and usefull information Java Specialist – The Secrets of Concurrency
Read moreRMI over zipped stream
If large amounts of compressable data is transferred over RMI, then valid question to ask is if compression would make any benefit there. However, before going into compression of the outputstream, first thing is to do algorithmic changes to reduce traffic. I.e. no compresion can match algorithm which avoids reduntant traffic completely. Also compression adds…
Read moreEmbedding Swing components in a JEditorPane
This sounds rather interesting, I can see various interesting uses for this. Amy Fowler’s Blog: Embedding Swing components in a JEditorPane
Read moreNimbus L&F
This looks interesting. *FINALLY* upgrade for old’n’ugly Metal L&F. Announcing Nimbus
Read moreImproving code with Eclipse plugins
Some interesting utilities Automation for the people: Improving code with Eclipse plugins FindBugs – Find Bugs in Java Programs
Read morePimp the Performance
For Java … Java Tuning White Paper Java Performance Tuning Highlight for today: -XX:+UseBiasedLocking – An object is ”biased” toward the thread which first acquires its monitor via a monitorenter bytecode or synchronized method invocation; subsequent monitor-related operations performed by that thread are relatively much faster on multiprocessor machines. Some applications with significant amounts of…
Read more