JComponent Painter

时间:2013-06-27 07:07:59

标签: java eclipse swing compiler-errors jcomponent

我有这个源代码,我知道它可以在另一台机器上运行,但似乎不想在我的日食中正常工作。虽然我已经添加了必要的库,但我有点困惑。

private class PainterCloseButtonEnabledBackground implements Painter<JComponent> {
        @Override
        public void paint(Graphics2D g, JComponent c, int w, int h) {
            g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
            g.drawImage(CLOSE_BUTTON_ENABLED, 0, 0, w, h, null);
        }
    }

我遇到了一些错误。 第一个与PainterCloseButtonEnabledBackground:

有关
The type UtilityButtonStyle.CloseButton.PainterCloseButtonEnabledBackground must
  implement the inherited abstract method Painter.paint(Graphics2D, Object, int, int)

第二个与画家有关:

The type Painter<JComponent> is deprecated

第三个与绘画方法有关:

The method paint(Graphics2D, JComponent, int, int) of type 
  UtilityButtonStyle.CloseButton.PainterCloseButtonEnabledBackground 
  must override or implement a supertype method

这只是来自早期版本的java吗?我不确定如何解释这些错误,谷歌搜索没有帮助。任何建议都将不胜感激。

编辑:这是我的导入语句

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.List;
import java.util.zip.ZipEntry;
import java.util.zip.ZipException;
import java.util.zip.ZipFile;
import controller.ExtractionUpdateListener;

0 个答案:

没有答案