Skip to main content

Blog Archive for alexfromsun during November 2005

Every experienced Swing developer knows that Swing components must be accessed from Event Dispatch Thread (EDT) only. Working with JComponents from any other thread may lead to unpredictable result. Consider the following code: import javax.swing.*; import java.awt.*; public class BadCode { public static void main(String args[]) { createGui(); } private static void createGui...
It's been a lot of publications about adding "close" button to a tabbedPane, all solutions suggested are really inventive and not easy to find. But we are gonna talk about Mustang "tabComponents feature" because it is the most preferable and clear solution for JTabbedPane customizing. Since 1.6 three new methods added to JTabbedPane: we can put a component to a tab with help of public void...