java swing component cannot be resolved

前端 未结 9 2017
灰色年华
灰色年华 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:06

    Updating the execution environment under system library to JavaSE-1.7 or JavaSE-1.8 in eclipse should solve the problem. To update the step below can be followed:

    > Right-click on the project
    > Select properties
    > Java build path
    > Library > Add Library > Add JRE SYSTEM Library
    > Execution Environment
    > Select JavaSE-1.7 or JavaSE-1.8
    > Finish
    

提交回复
热议问题