What source did you attach? The javax.swing.JButton source is in the src.zip file that comes with the JDK. Eclipse should automatically pick up that zip file if you properly configured Eclipse to use a JDK (by default Eclipse uses a JRE). To configure a JDK, in Eclipse go to Window | Preferences | Java | Installed JREs, click the Add button and browse to the JDK home folder. Then make sure that the JDK is selected as the default installation.