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

This is a sequel of my first article about Enums encoding. As you may know, Type-Safe Enums were proposed by Joshua Bloch in Effective Java, but they are not supported by XMLEncoder. This article describes how to encode them into XML properly. Let's create a simple Type-Safe Enum with static method to test encoding into XML: import java.beans.XMLEncoder;import java.io.ByteArrayOutputStream;...
on Aug 9, 2006
As you may know, Enums were introduced in Tiger, but they are not supported by XMLEncoder. This article describes how to encode them into XML properly. Let's create a simple Enum with static method to test encoding into XML: import java.beans.XMLEncoder;import java.io.ByteArrayOutputStream;public enum TestEnum {    LEFT, RIGHT;    public static void main( String...
on Aug 7, 2006
*Introduction* When there were no other tasks I've gathered a requests statistics on the GridBagLayout class changes. I considered both defects and RFEs. By the way, we seem have to refuse that division and treat each defect now as RFE. I was surprised by the fact that there are only 14 CRs inquire one or another change in the GridBagLayout class behavior. Believe, we have more defects in...
on Jul 21, 2006
Browsing the code for BasicScrollBarUI (yes, i don't have a life), i was puzzled by the following lines:   (ltr ? decrButton : incrButton).setBounds(leftButtonX,      itemY, leftButtonW, itemH);  (ltr ? incrButton : decrButton).setBounds(rightButtonX,      itemY, rightButtonW, itemH); Say what? I had no idea that the ternary conditional operator...
on Jul 20, 2006
Several people responded to my original rant, and I'm glad to say just about everyone one of them had an interesting take on the whole Java DB issue. Romain Guy and Joshua Marinacci even went as far as to blog on the topic. Some of the comments appended to all three entries are exceptionally noteworthy too. Spinning of from TOR (the original rant) is John Reynolds and Evan Summers who threw up...
on Jul 19, 2006
Back in May I blogged about simplifying my generics code with dot accessors to the type parameters, to simplify code that currently looks like this: public class FloydWarshall<Node,                            Edge,      ...
on Jul 18, 2006
I am working on a Java client application to accompany a textbook. It allows students to check their programming assignments before they turn them in. After a few days of hacking, I was ready to show it to my editor. No big deal, I thought. I'll just zip it up and tell him to unzip and run it. Open a command shell and run java -classpath labrat.jar:$ANT_HOME/lib/ant.jar ...
on Jul 12, 2006
Recall the motto "when the only tool you have is a hammer, every problem looks like a nail". One wonders whether the reverse is true? If you spent all your time banging in nails, are you inclined to judge every tool by its suitability to act as a hammer? Reading through some of the recent comments on blogs and forums of late I've begun to wonder if there isn't a sizeable section of the Java...
on Jul 12, 2006
As any mad scientist would do, just to prove that it can be done, I decided to build Mustang on my shiny new Ubuntu 6.06 "Dapper Drake" system. The build instructions warn you not to try this at home. The official build environment is Redhat Enterprise Advanced Server 2.1 update 2, formerly known as Redhat Advanced Server 2.1 update 2. Ugh. I was not sure that this was going...
on Jun 13, 2006
This is reference page for the Java course I taught for PWC. We'll put links and notes here for things that we talk about in the course. You can also leave comments for anything that I miss. Links for the tools that we use. Java Development Kit (JDK) 5.0: This is the code that will compile and execute Java. Remeber to set your classpath to include the "/bin" directory and you may have to include...
on Jun 12, 2006
Here is a simple code example from the JBoss EJB3 tutorial. @Entitypublic class LineItem implements java.io.Serializable{   private int id;   private double subtotal;   private int quantity;   private String product;   private Order order;   @Id @GeneratedValue(strategy=GenerationType.AUTO)   public int getId() ...
on Jun 8, 2006
Preface Usually developer starts to work on some issues from understanding the problem. A description represents a problem in a general. Unfortunately the actual difficulties of any particular user are hidden behind the common phrases. A description is intended to be impersonal, which gives to a developer a chance to clearly understand the problem, evaluate it and find the most effective way...
on Jun 2, 2006
I gave a talk on the trouble I'm having using complex generics code at the java.net community pavilion at JavaOne. It was a great experience. About a dozen people dropped by to listen; most settled in for the whole twenty minutes. Chris Adamson and the java.net team put together a great facility, with couches, a video screen for slides and -- most important -- an amplification system. My voice...
on May 30, 2006
Here are the slides of the JConsole BOF that Leif Samuelsson and Jean-Francois and I gave at JavaOne on May 18th. Enjoy! Using JConsole to monitor and manage your application JConsole was shipped in Tiger JDK as a demo and experimental tool. In Mustang, JConsole becomes a supported tool like the other JDK tools such as java and javac. From the engineering team's perspective, we have been...
on May 22, 2006
I just arrived home after a both grueling and exciting week of JavaOne. I'm taking the next two weeks off, though I will be blogging a bit and answering the occasional emails. Don't be surprised if I'm a bit slow to respond though as I'll be in Oregon most of the time sipping coffee and enjoying the beautiful outdoors. Once things settle down I'll have a bunch more blogs with photos,...
on May 19, 2006
I'll be at JavaOne 2006 tomorrow through Friday! It's a great opportunity to meet you all. If you'd like to chat about JConsole, VM monitoring and management, or Java SE serviceability/troubleshooting, come by: o Java SE Performance & Diagnostic Booth on May 16 (Tue) at 10:30am-12:15pm o JDK Community (Peabody) Booth #723 "Ask the Expert" area on May 18 (Thur) at 11:00am-12:00pm I'll be at...
on May 15, 2006
JavaOne 2006 Conference is coming up soon! Our BOF "Using JConsole to Monitor and Manage Your Application" is on May 18, 2006 at 10:30pm. The 9:30pm BOF (same room) is the JDK Tools BOF. The Java SE serviceability team will be there. It's late at night but hope to see you there. We're going to do a live demo of the Mustang JConsole at the JConsole BOF. Below gives you a summary of the...
on May 4, 2006
I've got a quixotic streak that needs exercise every so often. It's time. I'm doing a talk on usability problems in generics that I think can be fixed at 2:30 pm on Thursday in the Java Community pavilion at JavaOne. That windmill aught to break a lance. Just before JavaOne 2005 there was a huge dust-up over generics as people started using them, and trying to teach how they work. Ken Arnold...
on May 1, 2006
I read another blog entry complaining about the Java naming scheme. If that is the biggest issue with Java 5 today then I'm very happy. The complaint is that there are 3 names, Java 5, Java 1.5 and Tiger. Well first let me tackle the Tiger bit. The Java codenames are all listed here. Tiger or 'Project Tiger' was the name used on a day to day basis, its a convenience instead of saying one point...
on Apr 28, 2006
Some of the best Java programmers I know have an artistic side. When I first started working at Sun Microsystems many years ago, I was amazed that so many people play musical instruments, write short stories and fiction, perform in plays, and even dabble in poetry. Many of you closet poets may be interested to know that April is National Poetry Month. If you enjoy poetry and a little geekiness...
on Apr 21, 2006