好吧,所以我的教授发布了一项任务,但我们应该使用的参考代码令我感到困惑.他创建了一个JFrame,在Jframe里面放了一个按钮,但是该按钮的beanclass是JHoverButton.Java的子类,它扩展了JButton.当我尝试在我的代码中执行此操作时,我无法将Bean类作为我自己的子类.我已经尝试过自定义创建代码,我尝试过绑定,我已经查看了堆栈溢出但我无法找到答案.任何帮助将不胜感激!
这是我老师发布的内容 
这就是我被困住的地方.
非常感谢任何帮助,谢谢!
BeanProjectTest.Java的源代码:
package beanproject;
import javax.swing.JOptionPane;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import javax.swing.plaf.metal.*;
public class BeanProjectTest extends javax.swing.JFrame {
/**
* Creates new form BeanProjectTest
*/
public BeanProjectTest() {
initComponents();
try{
UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
//UIManager.setLookAndFeel("com.sun.java.swing.plaf.gtk.GTKLookAndFeel");
MetalLookAndFeel.setCurrentTheme(new DefaultMetalTheme());
SwingUtilities.updateComponentTreeUI(this);
}catch(Exception e){
JOptionPane.showMessageDialog(this, e.toString());
}
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked") …Run Code Online (Sandbox Code Playgroud)