私は初めて SwingX をテストしようとしています。
次のような JTextField について提案したいと思います。
List items = [...];
JTextField textField = [...];
AutoCompleteDecorator.decorate(textField, items);
だから私はnetbeansでプロジェクトを作成します、これは私のコードです:
package test_swingx;
import java.awt.Dimension;
import java.awt.HeadlessException;
import java.util.ArrayList;
import java.util.List;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JTextField;
import org.jdesktop.swingx.autocomplete.AutoCompleteDecorator;
/**
*
* @author marwen
*/
public class Test_swingx extends JFrame {
public Test_swingx(String title) throws HeadlessException {
this.setTitle(title);
JPanel pan=new JPanel();
JTextField jtf=new JTextField();
jtf.setColumns(20);
List items = new ArrayList();
items.add("hello");
items.add("marwen");
items.add("allooo");
AutoCompleteDecorator.decorate(jtf, items);
pan.add(jtf);
this.setContentPane(pan);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setVisible(true);
this.setBounds(280, 150, 500, 200);
}
public static void main(String[] args) {
Test_swingx tsx=new Test_swingx("helloo swingx");
}
}

このエラーが発生します:
no suitable methode found for decorate....
私は構文によく従っていますが、エラーがどこにあるのかわかりませんか? 何か役に立ちますか?