Skip to main content
View by: Most Recent | Topic | Community | Webloggers   
Monthly Archives:    

Blogs by topic: J2SE

• Accessibility • Ajax • Blogging • Business • Community 
• Databases • Deployment • Distributed • Eclipse • Education 
• EJB • Extreme Programming • Games • GlassFish • Grid 
• GUI • IDE • Instant Messaging • J2EE • J2ME 
• J2SE • Jakarta • JavaFX • JavaOne • Jini 
• JSP • JSR • JXTA • LDAP • Linux 
• Mobility • NetBeans • Open Source • OpenSolaris • OSGi 
• P2P • Patterns • Performance • Porting • Programming 
• Research • RMI • RSS Feeds • Search • Security 
• Servlets • Struts • Swing • Testing • Tools 
• Virtual Machine • Web Applications • Web Design • Web Development Tools • Web Services and XML 


J2SE

I allways wandered why there's no generic api defined for trees under the umbrella of java.util.Collections api. And every time I needet to handle tree-structured data I ended up writing quite the same code with slight modifications once again. So I recently started to create an API that is both generic and powerfull enough to never again write a line of code just to handle objects that are...
on Oct 19, 2007
Lets talk about FeatureDescriptor, the superclass for all other descriptors. It enables to add extra metadata to describe the beans. The builder tool could use such metadata to provide enhanced functionality. You can use the getValue(String) method to retrieve metadata. For example: BeanInfo info = Introspector.getBeanInfo(JLabel.class);Object value = info.getBeanDescriptor().getValue("...
on Oct 4, 2007
Are you doing engineering using Java? Or even science? Than you sometimes might need to calculate how objects move under the impression of forces and torques. The following might be for you then... Maybe somebody of you, dear reader, has already tried out my flight simulator FlyingGuns which is part of the Distributed RealTime Simulation project on SourceForge....
on Sep 23, 2007
Say No To Powerpoint I loathe authoring with Powerpoint (or its OpenOffice equivalent). Putting together a presentation requires a horrid amount of mouse clicking and fussing with fonts and formatting. Instead, I use the amazing HTML Slidy. You write your slides in XHTML (I use XMLMind, but any web editor that produces XHTML will do.) Then you add links to the Slidy style sheet...
on Aug 18, 2007
In short, don't rely on the finalize() method as your only cleanup method, especially if it is deleting files. Instead make up a cleanup method (cleanup() works nicely) that lazy deletes things. Here is an example. public class Example {  boolean isCleanedUp = false;    public synchronized void cleanup() {    if (isCleanedUp) return;    // flag as...
on Jul 31, 2007
Open JFX updated OpenJFX, the open source version of Java FX, was just updated. It has lots of improvements and demos, but the biggest thing is the first compiler, which will compile Java FX Script directly into bytecode rather than interpreting it. This is huge, because it makes FX Script a first class Java language, as well as being several orders of magnitude faster than interpretation....
on Jul 20, 2007
This month's version of the Core Java Tech Tips describes Java SE 6 Cookie handling along with Drag and Drop tips for JTree components. These tips have been part of Sun's newsletter program for a long time. Now you have another option for their delivery, and this one might be the most convenient. The Core Java Tech Tips are now available via blog. You can use your browser or favorite blog...
on Jul 2, 2007
I love the enhanced for loop construct introduced in Java 1.5. It makes the code look clean, and saves us from dealing with iterators or array indices. But since it is essentially syntactic sugar, it does create iterators behind the scenes as necessary. This can result in insidious bugs since if the passed collection or the array is null, your for loop will throw a NullPointerException. Here is...
on May 24, 2007
Josh Bloch and Neal Gafter have been doing their wonderful Java Puzzlers shtick at JavaOne for the last 4 years. This year, Bill Pugh has stepped in for Neal to keep the puzzlers puzzling. The puzzles point out all sorts of interesting and exasperating gotchas in the Java language and libraries that linger for ages waiting to humble us all. This year's set of puzzles include a slew of problems...
on May 9, 2007
As noted by various people, including Malcolm Davis, there's a lot of Apple laptops in evidence at the show this year. In particular, a whole slew of them on-stage for the keynote sessions. But where's Apple? Really? For all of Apple's pledges that Java is a first class citizen, Java support on OS X has been tardy, at best. Each new, major release of Java takes many months (as in over a year)...
on May 9, 2007
Now that I have had some time to work with Java SE 6, I thought I would share a list what I think are the top features and biggest letdowns. Scripting I was sold into scripting the JVM since back in the day when the only scripting option was Jython and BeanShell. Personally I would have preferred if Groovy was the default scripting language that came with Java SE 6. The good thing is that there...
on Apr 29, 2007
The @ConstructorProperties annotation for constructors was introduced in JDK version 6. This annotation shows how the parameters of annotated constructor correspond to object's properties. The following code snippet shows the get methods of the x and y properties: public class Point {    private final int x;    private final int y;    <strong>@...
on Mar 20, 2007
I saw many times code written by geeks, comparing String to literals in this style public boolean compareUser(String name) { if("Ahmed Hashim".equals(name)) { //do staff here return true; } return false; } what is the difference between this and the normal code style? public boolean compareUser(String name) { if(name.equals("Ahmed Hashim")) { //do staff here return true; } return false; } You...
on Mar 10, 2007
For all of the (arguably justifiable) buzz AJAX is getting these days, it can still be a pretty painful technology to use for developing web applications. JavaScript, the programming language used to build AJAX applications, is interpreted and only minimally object-oriented. HTML, the UI framework behind AJAX, remains, at its core, a page layout language, not a GUI toolkit. AJAX is certainly a...
on Mar 6, 2007
Many folks are aware that Java SE 6 comes with the new SystemTray and TrayIcon classes that allows an icon to be added to the system tray - or status area or whatever it is called on your platform. One very cool feature that most articles/pieces don't mention is it is possible to display a message similar to the "Low battery" warning produced by laptops or the "Updates are ready to be...
on Feb 15, 2007
Now that the pandora box is open is open, it is my turn to suggest a (possible worthless, I know) change to the Java language: the semifinal modifier! I had this idea on my way home last week, after teaching the final keyword for my current Globalcode class. The idea was basically this: final is a well designed modifier, as it has a similar meaning on the many places it can be used (variable,...
on Feb 13, 2007
This is an exercise that I did more or less an year ago to learn how to use annotations. The idea is to use the then new Java 5.0 language features to create finite state machines with no separate configuration files. By this time, probably there are already a million implementation around, but the excercise did help me quite a bit to understand how annotations can be used. Hope you like it! This...
on Feb 2, 2007
In another Ask the Experts session sponsored by java.sun.com, three key members of the Java SE Platform deployment team at Sun will answer questions online about Java plug-in technology between February 12-16. Interested? Mark your calendar.
on Feb 2, 2007
Hello everybody, recently I was sent a few interesting questions by my friend Angel Evrov, but being busy enough I had no time to look at them. Anyway, I finally found a few spare hours, and the problems turned out to be very interesting, so here they come. Question I: Consider the following Java class: public class MagicOutput {    public static void main(final String argv[]) {...
on Feb 1, 2007
When I got myself a java.net blog I thought I'd have used it to talk about the java technologies I use everyday. Whether it is Spring, XStream or less popular open-sources, the idea was to divulge what I was learning to the benefit of the java community and my own. Today instead I feel like writing about javaspaces but, not to discuss about some good practice I learnt, but to ask everybody who...
on Jan 28, 2007