Skip to main content
View by: Most Recent | Topic | Community | Webloggers   
Monthly Archives:    

Blogs by topic Swing and user alexfromsun

• Accessibility • Ajax • Blogging • Business • Community 
• Databases • Deployment • Distributed • Eclipse • Education 
• EJB • Extreme Programming • Games • GlassFish • Grid 
• GUI • IDE • Instant Messaging • J2EE • J2ME 
• J2SE • Jakarta • JavaFX • JavaOne • Jini 
• JSP • JSR • JXTA • LDAP • Linux 
• Mobility • NetBeans • Open Source • OpenSolaris • OSGi 
• P2P • Patterns • Performance • Porting • Programming 
• Research • RMI • RSS Feeds • Search • Security 
• Servlets • Struts • Swing • Testing • Tools 
• Virtual Machine • Web Applications • Web Design • Web Development Tools • Web Services and XML 


Swing

As everybody knows if you need to repaint a Swing component you should call Component.repaint() method, another well-known tip for the fast painting is: If only part of your component needs to be updated, make paint requests using a version of repaint that specifies the painting region. It is very simple piece of advice - not to paint more than you need, but sometimes this situation is not...
on Nov 6, 2007
In one of my previous blogs I answered to Kirill's comment that some of techniques he described in his Swing painting pipeline overview are "not good enough for me", here I want to explain my point by brifely commenting some of the techinques he covered. Implementing validation overlays First of all I want to mention my requirements to the validation overlays implementation: Solution shouldn't...
on Oct 9, 2007
One of the big part of my work is fixing bugs in Swing but not all of them are to be fixed, some of them are closed because they describe the situations when someone uses Swing in undocumented way or trying to make Swing do something which it doesn't support. My favourite example is so-called "Blocking GlassPane". If you file a bug with a description that you implemented a GlassPane to block...
on Sep 27, 2007
In one of my previous blog I presented a component which enables arrow keys to transfer focus and selection for Swing buttons. And it worked very well, but there were two things which worried me JXButtonGroupPanel offered a different way to bind buttons to a ButtonGroup since it created ButtonGroup and filled it up behind the scene It was just overcomplicated That why I mentioned Keep It Simple...
on Nov 1, 2006
Inspired by some latest blogs I decided to find the most hacky and crazy method to paint on a component I chose JButton as the most well-known component to play with The goal is to implement some custom painting to a button without subclassing it and with no custom UI delegate Custom component As you probably know all Swing components are Containers, that means that you can add any children...
on Oct 5, 2006
I have seen a lot of custom GlassPane tricks, which use GlassPane to "disable" the frame, to provide a visual effects during the lengthy tasks or to give more rich feedback during drag and drop etc... The distinctive feature of that tricks is that GlassPane is shown only temporarily,so when the lengthy tast or any other action is completed the custom GlassPane is made hidden and doesn't affect...
on Sep 20, 2006
I have fixed quite a lot of bugs and RFE's in Swing for Java 1.6 and don't really remember all of them, but I do remember one remarkable bug because it took me unusually long time to find a good solution and after I had fixed it I had to fix several regressions and finally I completely rolled the fix back Let me introduce you the bug number 4226243 (and 10 related bugs) So why fixing it was so...
on Aug 23, 2006
A long time ago I wanted to have a component which could paint rotated text for my application I definitely could create my own component, override paintComponent(), implement correct resizing etc... Yes, it was clear how to implement your own rotatable JLabel, but what if I want to have a rotatable JButton and I want to have it for each Look and Feels, how many classes I would have to sublclass...
on Jul 17, 2006
Hello everybody ! After spending a fantastic after JavaOne vacation, travalling Arizona and Florida I am happy to say hello to the comminity again. Thanks to everyone who visited JavaOne and especially who visited my BOF session about Swing testing and debugging. I'd like to underline that it were you guys who gave me much of the ideas to complete the presentation. Thank you once again and let me...
on Jun 28, 2006
Everybody knows that Swing and AWT behaviour can be changed with command line properties, for example you may set the desirable Look and Feel with help of the following command line property swing.defaultlaf see here for more info, e.g. the following command: java -Dswing.defaultlaf=com.sun.java.swing.plaf.windows.WindowsLookAndFeel <YourApp> allows you to have the Windows LaF to be set for...
on Apr 1, 2006
It's taken some time to study all possible ways of detecting Event Dispatch Thread rule violations, and now I feel I this topic is about to be closed. But let me tell from the beginning: ThreadCheckingRepaintManager I was really surprised when I got to know about the smart solution invented by Scott Delapwho created a RepaintManager which finds EDT mistakes, I started to play with it and noticed...
on Feb 16, 2006
Well, I've got more than 30 comments for the previous blog. It's high time to summarize them and make up a conclusion. There are two separate enhancements were suggested in comments: Make compiler move Swing methods to EDT automatically Invent something to make finding out-of-EDT methods invocations easier Making Swing methods threadsafe, simple case Really, if you call Swing method out from...
on Jan 12, 2006
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...
on Nov 23, 2005
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...
on Nov 9, 2005
Recently I came across one interesting bug 4413412 which seems to discover very odd Swing behaviors and really looks like a bug. The problem is that JLabel seems to be transparent for MouseEvents so its parent can catch mouseClick event if we click on this label. But after setting a tooltip this label stop passing MouseEvents trough and JFrame mouseListener doesn't get notified any more when...
on Oct 24, 2005