小编Joh*_*ohn的帖子

JMenuItem问题.我有五个.其中一个编译没有问题.其他人是相同的,但他们拒绝编译

出于某种原因,我无法在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)

java swing action menuitem

2
推荐指数
1
解决办法
133
查看次数

标签 统计

action ×1

java ×1

menuitem ×1

swing ×1