出于某种原因,我无法在Eclipse中编译它."退出"menuItem工作,没有其他menuItem工作.这是为什么?
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class GUI{
private JFrame frame;
public GUI(){
makeFrame();
}
//This method makes the overall GUI and adds panels, labels,
//buttons, and everything else to the GUI.
public void makeFrame(){
frame = new JFrame("Tower Defense");
Container contentPane = frame.getContentPane();
makeMenus();
JButton shootButton = new JButton("Shoot");
contentPane.add(shootButton);
frame.pack();
frame.setVisible(true);
}
//This method makes the menu and all of the items contained
//in the menu which is then called by the makeFrame() method.
//I also …Run Code Online (Sandbox Code Playgroud)