Archive for the 'basic' Category



Ready made Simple Custom TextField components

Sunday 27 July 2008 @ 8:01 am

   Here’s 3 kinds of text fields that you may want to use in your java swing projects.

   Besides using this components in whatever way you like, looking at the code can give you an excellent insight on using InputVerifier and DocumentFilter if you have already not used them




Setting the Default Button in Swing

Thursday 3 July 2008 @ 7:13 pm

Consider you have a form with several text fields and some buttons. One of the buttons is usually the “default” button , which would get executed if the user pressed enter, while the focus is in any of the text fields in that form. You should have definitely seen this type of buttons. As an example in google.com, you can type you query in the textfield and press enter, which is same as clicking the “Google Search” button.
  While most people who implement this, add a keylistener to each textfield and execute the doClick() method in JButton when the Enter key is pressed, there is an easier way. Also by implementing this by setting up the listener, you will not be able to tell swing to let it do OS level special effects like the “pulsing” effect in a MAC or a border-effect on windows.
Continue Reading »
Setting the Default Button in Swing




Accelerator/Mnemonic Keys in Swing

Friday 16 May 2008 @ 2:34 pm

  Creating Accelerator (or Menmonic) Keys in Swing in easy, but a little tricky. This article explains how you would do that

What are accelerator Keys?
   Try pressing alt+d, in your browser now, it will take you to the link bar. This means that the link bar has an Accelerator Key of ‘d’. In your Swing application, you can have any Component have an Accelerator key. This article teaches you to create an application as below
Accelerator Keys in Swing




History Of Swing

Thursday 15 May 2008 @ 5:21 am

As you might know, Swing was not the first GUI framework created by SUN. The first one was called as the Abstract Window Toolkit(AWT, shortly). AWT worked very similar to how other GUI tools, like, for eg., Visual Basic worked. It worked by translating the components it provided into platform specific counter parts called as native-peers. Thus, AWT components are sometimes referred to as heavy weight components.
Continue Reading »
History Of Swing




A Simple Swing Program

Thursday 15 May 2008 @ 4:41 am

If you have never written a Swing Program before, here’s a simple Swing Program to get you started
This program will show a frame, with a big “Click me!” button on in it as below

Continue Reading »
A Simple Swing Program








Popular Articles

Blog Categories

Monthly Archives

Resources