April 2023

Using the New java.io.Console Class

The 1.6 release of the JDK included a new java.io.Console class, which adds some new features to enhance and simplify command-line applications. Notably, Console includes a method specifically for reading passwords that disables console echo and returns a char array; both important for security. Scenario: Getting Username and PasswordGetting a user’s username and password is probably one of the more common …

Using the New java.io.Console Class Read More »

JTree Drag and Drop Gotcha

Before adding Drag and Drop capabilities to my JTable, I read Java Tip 97 and Java Tip 114 from JavaWorld. They were fairly helpful, but I ended up doing things a little differently. In implementing my Drag and Drop JTree, however, I was plagued by a persistent exception: “InvalidDnDOperationException: Drag and drop in progress.” I debugged my code for hours …

JTree Drag and Drop Gotcha Read More »

Scroll to Top