The purpose of these examples is to show users in the ##swing IRC channel how to use the Swing API to create applications. It is our intent to keep each example small (one file if possible) and try to demonstrate only one or two points with each example. This will make it easier for new users to find examples that they can use. It will also make it easier to understand the content.
Though there are hundreds of examples on the internet, many of them use bad coding practices or are not well documented. These examples can be difficult for new users to learn from, or may teach them bad coding practices. Our goal is to use examples that do provide good documenation and that use good coding practices.
Not all examples were written by ##swing IRC channel users. Some may be from other sites that we find to be good sources. If you do find an example hosted by papernapkin.org that has a bug, or you feel do not show good documentation and coding practices, please drop by the ##swing IRC channel and let us know. We'd be glad for your feedback.
| Example | Description |
|---|---|
| Threaded File Reader | An example application that will display the contents of a text file. The file is read in a thread separate from the event dispatch thread. This appliation is ment to be an example of how to use of threads to perform simple IO. |
| GB Constraints | A simple subclass of java.awt.GridBagConstraints which uses chaining and a few simple utility methods to make working with java.awt.GridBagLayout a little easier. Look in the class' main(String[] args) method to see an example of how to use this class. |
| Drag Demo | An example which displays an image in a panel smaller than the size of the iamge, and allows users to drag it around to view it. Double-clicking on a portion of the image will center that point in the view. |