导入java.awt.*错误 [英] Import java.awt.* errors

查看:62
本文介绍了导入java.awt.*错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先,我真的很陌生.我有一个非常简单的脚本:

First of all I am realy new to java. I have a very simple piece of script:

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

public class JavaApplicationSchool extends JFrame {
    public static void main(String[] args) {
        JOptionPane.showMessageDialog(null, "Hello World");
        JOptionPane.showMessageDialog(null, "Goodbye");
        System.exit(0);
    }
}

当尝试使用netbeans 7.1运行此代码时.(已安装JDK),我的IDE在代码顶部的Import部分返回错误.

When trying to run this code with netbeans 7.1. (JDK installed), my IDE returns errors on the Import parts at the top of the code.

这些错误与查找awt软件包有关.有人可以告诉我这些包需要放在哪里以及在哪里可以找到它们吗?

These errors has to do with finding the awt packages. Can someone tell me where these packeges needs to be located and where I can find them?

通过此屏幕截图,您可以看到我的目录结构目前的样子

Via this screenshot you can see how my directory structure looks like at the moment

提前谢谢

推荐答案

package javaapplicationschool;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

public class JavaApplicationSchool extends JFrame {
public static void main(String[] args) {
    JOptionPane.showMessageDialog(null, "Hello World");
    JOptionPane.showMessageDialog(null, "Goodbye");
    System.exit(0);
}
}

详细了解软件包.

这篇关于导入java.awt.*错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆