java swing component cannot be resolved

前端 未结 9 2015
灰色年华
灰色年华 2020-12-11 16:43

I took the following code from a tutorial:

import javax.swing.*;
import java.util.Date;

public class SwingGUI {

    public static void main( String[] args          


        
9条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-11 17:13

    am new here. I had this problem and it took me 2 days of research. I solved it by adding an external JAR file that contains all the required components to my Eclipse. Right-click project>>Buildpath>>Configure build path>> Add external JARS and browse for the JAR file on your computer. The JAR file can be downloaded here http://www.java2s.com/Code/Jar/j/Downloadjsdgstubsjre15jar.htm Hope this helps someone out there.

提交回复
热议问题