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

Blogs by topic J2SE and user cayhorstmann

• 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

A few months ago, I had one of those unpleasant format conversion jobs. I had about 1,000 multiple choice questions in RTF format and needed to import them into Moodle. RTF is, as file formats go, somewhere between the good and the evil. It looks like one should be able to write a parser for it, but that seems like a dreary task. The miracle of open source came through for me, though, in the...
on May 16, 2010
Today, a tantalizing announcement by Mark Reinhold about closures in Java 7 has made its way through the twittersphere. On the same day, Neal Gafter updated his closure proposal (known as the BGGA proposal, named after the initials of Bracha, Gafter, Gosling, and von der Ahé, and not at all related to the B. G. G. A. organization). Presumably the timing is not a coincidence. The proposal...
on Nov 18, 2009
When you need to produce lots of fairly straightforward graphs, Java2D is your friend. In this blog, I show you how you can render simple images as crisp-looking PDF or EPS files, provided you can draw them on a Graphics2D object. Recently, I had to draw a bunch of simple images, such as this one or this PDF Of course, you can do these drawings in Illustrator or Inkscape. But if you are a coder...
on Oct 8, 2009
On May 23, I gave a presentation at Sun about computer science students, and how a company can engage with them (audio | slides). Here are some of the questions that I was asked, and the answers that I gave (or wish I had given), and a question that I wish I had been asked. What can we do to get more students to use OpenSolaris? (Asked by two people in marketing who were eager to give me...
on Jun 7, 2008
Day 4 of Java One is over. Even without huge announcements or great surprises, it was a great conference. Here are my impressions from the cool stuff keynote and my takeaway what it all means. The Cool Stuff Keynote My mind wanders during most keynotes, but I always enjoy James Gosling's cool stuff keynote on the last day of Java One. No marketing, just one amazing Java-powered piece of hardware...
on May 9, 2008
My day 3 at Java One ranged from the Nimbus UI and the future of JSF to interesting discussions about closures and Scala. Details below. Nimbus The presentation on the Nimbus look and feel was packed. Nimbus is a pretty L&F, and it will be the standard for Java FX. Everything is vector-drawn, so it will scale nicely to high-resolution displays. (Check out this nifty sampler.) I would like to...
on May 8, 2008
Last year, Java One Day 0 was Netbeans Day, in a cozy hotel. This year, the Java One week started much more grandly, with Community One, at the Moscone Center. There were tracks for a number of open source communities, including NetBeans, GlassFish, MySQL, OpenSolaris. Frankly, I preferred the cozy hotel, but I can see that it is savvy marketing by Sun to have a large-scale free community event...
on May 5, 2008
I ran across this tech tip on using wildcards in Java generics. Pretty basic stuff, I thought. But I was amazed by the comments: Great post!! never knew about wildcards I cant believe this. I cannot think how a wild card in generics fits into the java OOP theme. Upto now the rules were always simple and straight forward. In this case list object should have accepted all objects of...
on May 4, 2008
There has been much discussion on whether Java programmers are becoming dinosaurs, on an evolutionary dead end and overtaken by more nimble mammals. Bruce Tate has long abandoned Java for greener (or redder) pastures. Bruce Eckel has embraced Flex , Bill Venners favors Scala. Python is making inroads in college curricula. What is a Java programmer to do? In this blog, I argue that we need to...
on Jan 8, 2008
I got an OLPC for the holiday season. No, it wasn't for the Horstmann twins—after all, it is one laptop per child, so the child must be myself. I got it through the “give one, get one program”. For $400, I got mine and a much more deserving kid somewhere out there got one as well. (Hurry if you want to get yours—the program ends today.) Twelve years ago, in Chapter 1 of...
on Dec 31, 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
Mapping Design Intent to Code Chapter 3 in Fowler's UML Distilled discusses class diagrams. His first design concept: properties. Fowler describes the role of properties in OO design and how they are mapped to language features in Java and C#. In Java, a public read-write property can be mapped to a getter and setter pair. The design concept /** the name of this widget */...
on Jan 18, 2007
The Rules of the Game This is just a Gedankenexperiment. I am not seriously proposing anything for Java SE7. A property is an abstract thing that has a get and set operation. A "native property" is a "property done right" with new syntax. A "JavaBeans property" is what it always was. I don't want to get into any syntax wars. I use an uppercase Pi (Π) to denote a...
on Jan 10, 2007
I had blogged on property boilerplate and the work of my graduate student Alexandre Alves in the summer, but I didn't get much reaction then. But recently, there has been a flurry of blogs on native property syntax. Let's try this again. Why Native Properties? Many programmers are sick and tired of boring, repetitive boilerplate code for JavaBeans properties. Here is a...
on Jan 7, 2007
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
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
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