无效的方法声明?要求退货类型?

时间:2018-06-03 09:31:13

标签: java button bluej

import java.util.*;
import java.awt.FlowLayout;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import javax.swing.JFrame;
import javax.swing.JButton;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JOptionPane;
//----------I could just do import java.awt.*; and import java.swing.*; but, when the program get larger, this could cause glitches, so it's better not to----------
public class Gui extends JFrame{

public class QA //THIS IS WHERE I'M GETTING THE ERROR MESSAGE
{
    private int x;
         private JButton reg;
         private JButton custon;

         public Gui();
    public QA()
    {

我从YouTube视频(https://www.youtube.com/watch?v=6iV-v_m0z0w)中删除了代码,但我不确定问题是什么。感谢任何帮助:)

1 个答案:

答案 0 :(得分:0)

public Gui();没有任何退货类型且没有任何实施,且它不应该在QA

将此构造函数方法移至Gui class

public class Gui extends JFrame{

public Gui(){}

public class QA //THIS IS WHERE I'M GETTING THE ERROR MESSAGE
{
...
}