Sunday, October 10, 2010

Listen when the text is changed on a JTextField (Java 6 Swing)

I wanted to listen and execute some actions every time the text was changed on a JTextField. I found a very useful post on this link.

http://www.velocityreviews.com/forums/t136479-jtextfield-cant-listen-when-the-text-is-changed.html

Here is the code I'm using, thanks a lot Mark McMillan.

You want to listen for changes on the Document that is associated
with the TextField. If you don't explicitly create a Document the
TextField does it for you. To setup a listener:

// Listen for changes in the text
myTextField.getDocument().addDocumentListener(new DocumentListener() {
public void changedUpdate(DocumentEvent e) {
// text was changed
}
public void removeUpdate(DocumentEvent e) {
// text was deleted
}
public void insertUpdate(DocumentEvent e) {
// text was inserted
}
});

Note this works no matter how the text gets changed; via a
clipboard cut/paste, progamatic "setText()" on the TextField,
or the user typing into the field on the UI.

Friday, May 01, 2009

Oracle compra Sun Microsystems, junto con Java y MySQL

Si hubiera sabiado que el sonido se iba a trasar tanto no lo hubiera grabado directamente en YouTube

Friday, October 10, 2008

John Gage - There's no such thing as corporate culture


John Gage
Chief Researcher and
Vice President of the Science Office
for Sun Microsystems

Thursday, October 04, 2007

Adobe Thermo


I really like this way to create RIA.

Saturday, November 18, 2006

James Gosling's Letter to the Java Community

Dear Java Community,

As you can see, we're making progress with our plans to open source Sun's implementations of the Java platform. I'm happy to see Java technology embarking on a new journey with this official open-source licensing announcement.

Java technology has been a cornerstone of software development for more than a decade now -- the community is ready for the next chapter, and the timing is right. As we stated at the JavaOne conference last May, the most crucial part of this decision was that we realized developers want to preserve compatibility, interoperability, and reliability. We intend to take steps to help make sure Java technology remains compatible, interoperable, and reliable. And we know the Java community feels the same way.

We will continue to do an immense amount of testing with the Java platform. Everything we do will get checked, rechecked, and we will debug rigorously. We expect that people who care about reliability and compatibility with the Java specification will continue to use and enhance Java technology.

One reason Java technology remains so popular is that it's remarkably successful at spanning a lot of different domains. You can write software for application servers, cell phones, scientific programming, desktop applications, games, embedded software -- the list is endless. We're intend to maintain the support of this broad span of domains.

Sun continues to embrace open source, and I invite you to join us. There are all kinds of contributions you can make. If there's a bug that you really care about, you can go work out a fix. (That's one area where developers have made tens of thousands of contributions over the years.) I also invite you to help us add new features. If there's new functionality that you really want in Java technology, the process is there to help you to add that to the platform as well.

Sincerely,

James Gosling

Saturday, October 14, 2006

Defining Blog

"There is no need to define 'blog.' I doubt there ever was such a call to define 'newspaper' or 'television' or 'radio' or 'book' -- or, for that matter, 'telephone' or 'instant messenger.' A blog is merely a tool that lets you do anything from change the world to share your shopping list. People will use it however they wish. And it is way too soon in the invention of uses for this tool to limit it with a set definition. That's why I resist even calling it a medium; it is a means of sharing information and also of interacting: It's more about conversation than content ... so far. I think it is equally tiresome and useless to argue about whether blogs are journalism, for journalism is not limited by the tool or medium or person used in the act. Blogs are whatever they want to be. Blogs are whatever we make them. Defining 'blog' is a fool's errand."

Jeff Jarvis, the veteran print journalist and prominent blogger behind BuzzMachine