ユーザーからのリクエストが必要なアプリケーションを 1 つ作成しています。アプリの最初のバージョンでは、自分で 1 つの入力ウィンドウを作成しましたが、JOptionFrame から事前に成形されたツールであるため、showInputDialog を変更したほうがよいことがわかりました。現在、イベント トリガーに問題があります。以下のコードをチェックしてください。
検索画面:
public class SearchScreen extends EventSearch{
...
public SearchScreen(){
userQuery = (String) JOptionPane.showInputDialog("Type Keywords in english to be requested below:");
}
...
}
イベント検索:
public class EventSearch extends TabBuilder{
public EventSearch() {
}
public void actionPerformed(ActionEvent Ev) {
try {
System.out.println("worked");
} catch (IOException e1) {
e1.printStackTrace(); //print failure
JOptionPane.showMessageDialog(null, "FAIL");
}
};
}
タブビルダー:
public class TabBuilder implements ActionListener {
.....
}
次に、showInputDialog を介してイベントを呼び出す方法を尋ねます。出来ますか?誰が聞き役になるの?前もって感謝します